ViennaLS
Loading...
Searching...
No Matches
lsConcepts.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <type_traits>
5
6namespace lsConcepts {
7// use any type that can be assigned any value (so anything but void)
8using AssignType = std::nullptr_t;
9// some value that can be used as the default parameter
10inline constexpr AssignType assignable = AssignType();
11
12template <class Base, class Derived>
13using IsBaseOf =
14 std::enable_if_t<std::is_base_of<Base, Derived>::value, AssignType>;
15
16template <class A, class B>
17using IsSame = std::enable_if_t<std::is_same<A, B>::value, AssignType>;
18
19template <class A, class B>
20using IsNotSame = std::enable_if_t<!std::is_same<A, B>::value, AssignType>;
21
22template <class T>
24 std::enable_if_t<std::is_floating_point<T>::value, AssignType>;
25
26} // namespace lsConcepts
Definition lsConcepts.hpp:6
std::enable_if_t<!std::is_same< A, B >::value, AssignType > IsNotSame
Definition lsConcepts.hpp:20
constexpr AssignType assignable
Definition lsConcepts.hpp:10
std::enable_if_t< std::is_base_of< Base, Derived >::value, AssignType > IsBaseOf
Definition lsConcepts.hpp:13
std::enable_if_t< std::is_same< A, B >::value, AssignType > IsSame
Definition lsConcepts.hpp:17
std::nullptr_t AssignType
Definition lsConcepts.hpp:8
std::enable_if_t< std::is_floating_point< T >::value, AssignType > IsFloatingPoint
Definition lsConcepts.hpp:23