LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fhicl_key.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_detail_fhicl_key_h
2 #define art_Framework_Art_detail_fhicl_key_h
3 
4 // Class for concatenating FHiCL names into a dot-delimited FHiCL key
5 
6 #include <string>
7 
8 namespace art::detail {
9 
10  template <typename T>
11  std::enable_if_t<std::is_convertible_v<T, std::string>, std::string>
12  fhicl_key(T const& name)
13  {
14  return name;
15  }
16 
17  template <typename H, typename... T>
18  std::enable_if_t<std::is_convertible_v<H, std::string>, std::string>
19  fhicl_key(H const& hname, T const&... tnames)
20  {
21  std::string const head{hname};
22  return head.empty() ? fhicl_key(tnames...) :
23  head + "." + fhicl_key(tnames...);
24  }
25 } // namespace art::detail
26 
27 #endif /* art_Framework_Art_detail_fhicl_key_h */
28 
29 // Local variables:
30 // mode: c++
31 // End:
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
Definition: fhicl_key.h:12