I have a function that creates a unique pointer to a dynamically allocated object "c".

```
template<typename T, typename... TArgs> void addComponent(TArgs&&... MArgs) {

    if(!components.count(typeid(T))) {
        T* c = new T(std::forward<TArgs>(MArgs)...);
        c->entity = this;
        std::unique_ptr<Component> uPtr{ c };
        components[typeid(T)] = (std::move(uPtr));
        c->init();
    }

}

```

My understanding is that the unique\_ptr takes control of the value of c because you can't have another pointer pointing too a unique\_ptr, however c->init still works after c has been turned into a unique\_ptr.

Why does this work? Does c somehow still point to the same new T() or is an entirely new object created?