Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:18

0001 #ifndef FWCore_Utilities_do_nothing_deleter_h
0002 #define FWCore_Utilities_do_nothing_deleter_h
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 // do_nothing_deleter.h
0007 //
0008 // Purpose: do_nothing_deleter provides a way to use std::shared_ptr
0009 // or boost::shared_array for those cases where the object or array
0010 // may be either in dynamic (heap) storage, or in static storage,
0011 // as long as which of these applies is known when the shared_ptr or shared_array
0012 // is constructed.
0013 //
0014 // For objects:
0015 //
0016 // If the object is allocated in dynamic storage, use
0017 // std::shared_ptr<T> (new T(...));
0018 
0019 // If the object "t" is in static storage, use
0020 // std::shared_ptr<T> (&t, do_nothing_deleter());
0021 //
0022 // For arrays:
0023 //
0024 // If the array is allocated in dynamic storage, use
0025 // boost::shared_array<T> (new T(...)[]);
0026 
0027 // If the array "t" is in static storage, use
0028 // boost::shared_array<T> (t, do_nothing_deleter());
0029 //
0030 //
0031 // ----------------------------------------------------------------------
0032 
0033 namespace edm {
0034   struct do_nothing_deleter {
0035     void operator()(void const*) const {}
0036   };
0037 }  // namespace edm
0038 
0039 #endif