funcy  1.6.1
type_traits.h
1 #pragma once
2 
3 #include <type_traits>
4 
5 namespace funcy
6 {
8  namespace static_check
9  {
10  namespace test
11  {
12  namespace nested_type
13  {
14  // access underlying type of the expression templates of the Eigen library
15  template < class EigenArg >
16  using PlainObject = typename EigenArg::PlainObject;
17  } // namespace nested_type
18  } // namespace test
19  } // namespace static_check
21 
23  template < class F, class = void >
24  struct Decay
25  {
26  using type = F;
27  };
28 
30  template < class F >
31  struct Decay< F, std::void_t< static_check::test::nested_type::PlainObject< F > > >
32  {
33  using type = typename F::PlainObject;
34  };
35 
37  template < class F >
38  struct is_arithmetic : std::is_arithmetic< F >
39  {
40  };
41 
42  template < class F >
43  inline constexpr bool is_arithmetic_v = is_arithmetic< F >::value;
44 
46  template < class F >
47  using decay_t = typename Decay< std::decay_t< F > >::type;
48 
50  template < class F >
52 
53  template < class Type, int id >
54  struct IndexedType
55  {
56  using type = Type;
57  static constexpr int index = id;
58 
59  Type value;
60  };
61 } // namespace funcy
Specialize this template class to register arithmetic types that are not built-in.
Definition: type_traits.h:38
typename Decay< std::remove_reference_t< F > >::type remove_reference_t
Access underlying type (if it is hidden by expression templates).
Definition: type_traits.h:51
Identity, i.e. Decay<F>::type == F
Definition: type_traits.h:24
Main namespace of the funcy library.
typename Decay< std::decay_t< F > >::type decay_t
Access underlying type (if it is hidden by expression templates).
Definition: type_traits.h:47
Definition: type_traits.h:54