This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: std::shared_ptr vs allocators: by value or by const ref?!?


Hi,
> I don't think so. I have no idea why the shared_ptr constructors take
> allocators by value.
>
> The reset() inconsistency is probably my fault.  At one point I
> experimented with passing them by reference, so maybe I missed that
> one and it got committed.  I think I chose to pass by const-ref
> internally, because I couldn't see any reason not to.
>   
Ok, I'll send a message to the reflector. Also, I don't see why the
requirements insist that the copy constructor of the allocator doesn't
throw: AFAICS, Table 42 is pretty clear about that. About the
destructor, the issue can be more subtle, but again I have trouble
believing that must be enforced as part of the shared_ptr
requirements... I'm under the impression that shared_ptr has simply to
be updated / tweaked consistently with the more recent allocator work...

Paolo.


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