[patch] Fix libstdc++/36962
Paolo Carlini
paolo.carlini@oracle.com
Fri Sep 5 16:57:00 GMT 2008
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.
More information about the Libstdc++
mailing list