[RFC] A bit of rationale about C++0x shared_ptr vs allocators

Paolo Carlini paolo.carlini@oracle.com
Tue Jul 29 11:31:00 GMT 2008


Hi,

I'm noticing only now that N2232 (likewise the current draft) has:

  template<class Y, class D, class A> shared_ptr( Y * p, D d, A a );
  template<class Y, class D, class A> void reset( Y * p, D d, A a );

*not*:

  template<class Y, class D, class A> shared_ptr( Y * p, D d, const A& a );
  template<class Y, class D, class A> void reset( Y * p, D d, const A& a );

Is it possible to have a bit of rationale? Naively (I'm indeed not a share_prt expert), it seems really strange, usually allocators are passed around by const ref...

Many thanks in advance,
Paolo.




More information about the Libstdc++ mailing list