Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:48

0001 // DEPRECATED in favor of adl_predestruct with deconstruct<T>().
0002 // A simple framework for creating objects with predestructors.
0003 // The objects must inherit from boost::signals2::predestructible, and
0004 // have their lifetimes managed by
0005 // boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
0006 // function.
0007 //
0008 // Copyright Frank Mori Hess 2007-2008.
0009 //
0010 //Use, modification and
0011 // distribution is subject to the Boost Software License, Version
0012 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 
0015 #ifndef BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP
0016 #define BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP
0017 
0018 namespace boost
0019 {
0020   namespace signals2
0021   {
0022     template<typename T> class predestructing_deleter;
0023 
0024     namespace predestructible_adl_barrier
0025     {
0026       class predestructible
0027       {
0028       protected:
0029         predestructible() {}
0030       public:
0031         template<typename T>
0032           friend void adl_postconstruct(const shared_ptr<T> &, ...)
0033         {}
0034         friend void adl_predestruct(predestructible *p)
0035         {
0036           p->predestruct();
0037         }
0038         virtual ~predestructible() {}
0039         virtual void predestruct() = 0;
0040       };
0041     } // namespace predestructible_adl_barrier
0042     using predestructible_adl_barrier::predestructible;
0043   }
0044 }
0045 
0046 #endif // BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP