LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ServiceHandleAllowed.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_Registry_detail_ServiceHandleAllowed_h
2 #define art_Framework_Services_Registry_detail_ServiceHandleAllowed_h
3 
4 // ======================================================================
5 // ServiceHandleAllowed is a compile-time trait that checks if a
6 // 'service_handle_allowed' constexpr boolean member is present in a
7 // service's class definition *and* has been set to false. If set to
8 // 'false', then the 'handle_allowed_v<T>' value is 'false'. If a
9 // 'service_handle_allowed' variable is not present in a service's
10 // definition, then the 'handle_allowed_v<T>' value is 'true'.
11 // ======================================================================
12 
13 #include <type_traits>
14 
15 namespace art {
16  namespace detail {
17  template <typename T, typename = void>
18  struct handle_allowed : std::true_type {
19  };
20 
21  template <typename T>
22  struct handle_allowed<T, std::enable_if_t<!T::service_handle_allowed>>
23  : std::false_type {
24  };
25 
26  template <typename T>
28  }
29 }
30 
31 #endif /* art_Framework_Services_Registry_detail_ServiceHandleAllowed_h */
32 
33 // Local Variables:
34 // mode: c++
35 // End:
bool constexpr handle_allowed_v
STL namespace.
HLT enums.