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: [patch] Fix libstdc++/36962


Paolo Carlini:

I think that the difference is detectable with get_deleter though.

If you can figure out a possible testcase, I would appreciate that.

Something like (untested, sorry)


   D d;
   std::unique_ptr<T,D&> p1( new T, d );

std::shared_ptr<T> p2( std::move( p1 ) );

   typedef std::reference_wrapper<D> D2;
   D2 * p3 = std::get_deleter<D2>( p2 );

   assert( p3 != 0 );
   assert( &p3->get() == &d );


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