CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/FWCore/Utilities/interface/do_nothing_deleter.h

Go to the documentation of this file.
00001 #ifndef FWCore_Utilities_do_nothing_deleter_h
00002 #define FWCore_Utilities_do_nothing_deleter_h
00003 
00004 // ----------------------------------------------------------------------
00005 //
00006 // do_nothing_deleter.h
00007 //
00008 // Purpose: do_nothing_deleter provides a way to use boost::shared_ptr
00009 // or boost::shared_array for those cases where the object or array
00010 // may be either in dynamic (heap) storage, or in static storage,
00011 // as long as which of these applies is known when the shared_ptr or shared_array
00012 // is constructed.
00013 //
00014 // For objects:
00015 //
00016 // If the object is allocated in dynamic storage, use
00017 // boost::shared_ptr<T> (new T(...));
00018 
00019 // If the object "t" is in static storage, use
00020 // boost::shared_ptr<T> (&t, do_nothing_deleter());
00021 //
00022 // For arrays:
00023 //
00024 // If the array is allocated in dynamic storage, use
00025 // boost::shared_array<T> (new T(...)[]);
00026 
00027 // If the array "t" is in static storage, use
00028 // boost::shared_array<T> (t, do_nothing_deleter());
00029 //
00030 //
00031 // ----------------------------------------------------------------------
00032 
00033 namespace edm {
00034   struct do_nothing_deleter {
00035     void operator()(void const*) const {}
00036   };
00037 }
00038 
00039 #endif