concepts.hpp

1
2
3
4
5
6
7
8
#pragma once


#include <concepts>
#include <type_traits>


namespace felspar::parse::concepts {

Shims for concepts missing on Android :-(

14
15
16
17
18
19
20
21
22
23
24
25
    template<class T>
    concept integral = std::is_integral_v<T>;

    template<class T>
    concept signed_integral = integral<T> and std::is_signed_v<T>;

    template<class T>
    concept unsigned_integral = integral<T> and not signed_integral<T>;


    template<class T>
    concept floating_point = std::is_floating_point_v<T>;

Numeric for anything integral or floating point

29
30
31
32
33
    template<class T>
    concept numeric = floating_point<T> or integral<T>;


}