ScalarTypes.hpp 938 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

// std c++ headers
#include <type_traits>
#include <amdis/common/Utility.hpp>

namespace AMDiS
{
  namespace Traits
  {
    template <class T>
    struct IsIntegral
        : public std::is_integral<remove_cvref_t<T>> {};

    template <class T>
    struct IsArithmetic
        : public std::is_arithmetic<remove_cvref_t<T>> {};

  } // end namespace traits

  namespace Concepts
  {
    /** \addtogroup Concepts
     *  @{
     **/

    /// \brief The types following the std type-trait \ref std::is_integral are
    /// categorized as *integral types*.
    template <class T>
    constexpr bool Integral = Traits::IsIntegral<T>::value;

    /// \brief The types following the std type-trait \ref std::is_arithmetic are
    /// categorized as *arithmetic types*.
    template <class T>
    constexpr bool Arithmetic = Traits::IsArithmetic<T>::value;

    /** @} **/

  } // end namespace Concepts

} // end namespace AMDiS