Say I have the following:
std::unique_ptr<A> pA; pA(new A);
In this confusing example, what should be the behavior of pA(new A); ?
As far as I can tell, in MSVC2010 void operator()(T*) const; from default_delete is called immediately after returning new and immediately deletes the pointer. If g ++ (4.7.0) gave me an error no match for call (std::unique_ptr<A>)(A*) .
source share