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 = std::enable_if_t<std::is_base_of_v<Base, Derived>, AssignType>;
14
15template <class A, class B>
16using IsSame = std::enable_if_t<std::is_same_v<A, B>, AssignType>;
17
18template <class A, class B>
19using IsNotSame = std::enable_if_t<!std::is_same_v<A, B>, AssignType>;
20
21template <class T>
23 std::enable_if_t<std::is_floating_point_v<T>, AssignType>;
24
25} // namespace lsConcepts
Definition lsConcepts.hpp:6
constexpr AssignType assignable
Definition lsConcepts.hpp:10
std::enable_if_t<!std::is_same_v< A, B >, AssignType > IsNotSame
Definition lsConcepts.hpp:19
std::enable_if_t< std::is_same_v< A, B >, AssignType > IsSame
Definition lsConcepts.hpp:16
std::enable_if_t< std::is_floating_point_v< T >, AssignType > IsFloatingPoint
Definition lsConcepts.hpp:22
std::nullptr_t AssignType
Definition lsConcepts.hpp:8
std::enable_if_t< std::is_base_of_v< Base, Derived >, AssignType > IsBaseOf
Definition lsConcepts.hpp:13