ScalarTypes.hpp 902 Bytes
Newer Older
1
2
3
4
5
6
7
8
#pragma once

// std c++ headers
#include <type_traits>

namespace AMDiS
{
  namespace traits
9
  {
10
    template <class T>
11
12
    struct is_integral
        : public std::is_integral<std::decay_t<T>> {};
13
14

    template <class T>
15
16
    struct is_arithmetic
        : public std::is_arithmetic<std::decay_t<T>> {};
17
18
19

  } // end namespace traits

20
  namespace Concepts
21
  {
22
23
24
    /** \addtogroup Concepts
     *  @{
     **/
25

26
27
    /// \brief The types following the std type-trait \ref std::is_integral are
    /// categorized as *integral types*.
28
    template <class T>
29
30
    constexpr bool Integral = traits::is_integral<T>::value;

31
32
    /// \brief The types following the std type-trait \ref std::is_arithmetic are
    /// categorized as *arithmetic types*.
33
    template <class T>
34
35
    constexpr bool Arithmetic = traits::is_arithmetic<T>::value;

36
    /** @} **/
37

38
  } // end namespace Concepts
39

40
} // end namespace AMDiS