
26 Apr
2008
26 Apr
'08
1:48 p.m.
Daniel Frey:
I refactored enable_shared_from_this in order to remove the _owner flag.
There's another problem with your new implementation, one that wasn't caught by esft_regtest (I updated it to catch it): void test4() { boost::shared_ptr<V> pv( new V ); boost::shared_ptr<V> pv2( pv.get(), null_deleter() ); } Your implementation modifies pv2. This ease with which one might inject subtle failures in remote code (such as Boost.Python, incidentally) makes me think that sp_accept_owner is a bit too dangerous. Maybe its shared_ptr argument needs to be made const. This would break the new constructorful esft though.