This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ 2.95.2 - auto_ptr


> (C++ lib 2.10)
> 
> Is this supposed to fail...
> 
> extern auto_ptr<Foo> NewFooFactory();
> auto_ptr<Foo> foo;
> foo = NewFooFactory(); // Compiler error.

Either

auto_ptr<Foo> foo = NewFooFactory();

or

auto_ptr<Foo> foo;
foo.reset(NewFooFactory());

Franz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]