g++ 2.95.2 - auto_ptr

Franz Fehringer fehrin@t-online.de
Sat Mar 30 01:13:00 GMT 2002


> (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



More information about the Gcc-help mailing list