no_delete.h
Go to the documentation of this file.
1 #ifndef cetlib_no_delete_h
2 #define cetlib_no_delete_h
3 
4 /*
5  ======================================================================
6 
7  no_delete.h
8 
9  !!==========================================================!!
10  !! Please consult with the art team before using this class !!
11  !!==========================================================!!
12 
13  Purpose: no_delete provides a way to use std::shared_ptr or
14  std::unique_ptr for those cases where the object may be
15  either in dynamic (heap) storage, or in static storage, as
16  long as which of these applies is known when the shared_ptr
17  or unique_ptr is constructed.
18 
19  For objects:
20 
21  If the object is allocated in dynamic storage, use
22  std::make_shared<T>(...);
23 
24  If the object "t" is in static storage, use
25  std::shared_ptr<T> (&t, cet::no_delete());
26 
27  ======================================================================
28 */
29 
30 namespace cet {
31  struct no_delete {
32  void
33  operator()(void const*) const
34  {}
35  };
36 }
37 
38 #endif /* cetlib_no_delete_h */
39 
40 // Local variables:
41 // mode: c++
42 // End:
void operator()(void const *) const
Definition: no_delete.h:33