This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: should <bits/unique_ptr.h> include <backward/auto_ptr.h>?
> >> Both shared_ptr and unique_ptr have constructors taking an auto_ptr
> >> parameter, they just don't explicitly include the header because
> >> the usual way to use them is <memory> which includes auto_ptr.h
> >> before including shared_ptr.h or unique_ptr.h
Ahh, I see.
> > Maybe we could improve things with a patch like this (completely
> > untested). ÂIt should be equivalent for users who include <memory>
> > but would let us include bits/unique_ptr.h or bits/shared_ptr.h
> > internally without also pulling in auto_ptr
>
> Still untested but this version compiles at least, so is an
> improvement on the last one ;)
>
> It would probably be better to put the shared_ptr and unique_ptr
> constructors in a separate file rather than just the end of
> auto_ptr.h, but I'll test it like this and see if the idea works.
I like where you are going with this! Very smart. I was thinking
along these lines myself. I don't know if you need the separate file,
this seems ok to me.
-benjamin