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


Hi,
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 );
Yes, this one "works", in the sense that if I apply my patchlet the first assert fails at run-time.

Thanks a lot, I will add it to the testsuite!
Paolo.


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