LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fromFutureImport.h
Go to the documentation of this file.
1 
10 #ifndef LARCOREALG_COREUTILS_FROMFUTUREIMPORT_H
11 #define LARCOREALG_COREUTILS_FROMFUTUREIMPORT_H
12 
13 #include <utility> // std::forward()
14 
32 namespace util::pre_std {
33 
34 #if (__cplusplus < 202000L) // still to be defined, should be C++20
35 
37  struct identity {
38 
39  struct is_transparent {}; // STL algorithms will be happy to find this
40 
41  template <typename T>
42  constexpr T&& operator()(T&& t) const noexcept
43  {
44  return std::forward<T>(t);
45  }
46 
47  }; // identity<>
48 
49 #endif // (__cplusplus < 202000L)
50 
51 } // namespace pre_std
52 
53 #endif // LARCOREALG_COREUTILS_FROMFUTUREIMPORT_H
constexpr T && operator()(T &&t) const noexcept
Transparent functor that returns its argument just as passed.