Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:12

0001 #ifndef Framework_Utilities_make_sentry_h
0002 #define Framework_Utilities_make_sentry_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework/Utilities
0006 // Class  :     make_sentry
0007 //
0008 /**\function make_sentry make_sentry.h "FWCore/Utilities/interface/make_sentry.h"
0009 
0010  Description: Creates a std::unique_ptr from a lambda to be used as a sentry
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  root
0018 //         Created:  Fri, 19 Aug 2016 20:02:12 GMT
0019 //
0020 
0021 // system include files
0022 #include <memory>
0023 // user include files
0024 
0025 // forward declarations
0026 
0027 namespace edm {
0028   ///NOTE: if iObject is null, then iFunc will not be called
0029   template <typename T, typename F>
0030   std::unique_ptr<T, F> make_sentry(T* iObject, F iFunc) {
0031     return std::unique_ptr<T, F>(iObject, iFunc);
0032   }
0033 }  // namespace edm
0034 
0035 #endif