المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : auto_ptr



C++ Programming
04-07-2009, 05:02 PM
Is there any difference between

auto_ptr p;
...
p = auto_ptr(new foo);


and

auto_ptr p;
...
p = new foo;


I saw the first form in examples and wondered why it was being used.

There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal