galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Concepts.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_META_CONCEPTS_HPP_
9#define GALAXY_META_CONCEPTS_HPP_
10
11#include <concepts>
12#include <string>
13#include <type_traits>
14
15namespace galaxy
16{
17 namespace meta
18 {
26 template<typename Type>
27 concept is_class = std::is_class<Type>::value;
28
36 template<typename Type>
37 concept not_memory = !std::is_pointer<Type>::value && !std::is_reference<Type>::value && std::is_object<Type>::value;
38
46 template<typename Type>
47 concept is_arithmetic = std::is_arithmetic<Type>::value;
48
56 template<typename Type>
57 concept standard_type = is_arithmetic<Type> || std::is_same<std::string, Type>::value;
58
66 template<typename Type>
67 concept is_object = std::is_object<Type>::value;
68
76 template<typename Type>
77 concept is_bitset_flag = requires(Type type) { Type::value >= 0 && Type::value <= 7 && std::is_same<decltype(Type::value), unsigned short>::value; };
78
86 template<typename Type>
87 concept valid_component = std::is_move_assignable<Type>::value && std::is_move_constructible<Type>::value && std::is_class<Type>::value;
88
95 template<typename Loader, typename Resource>
96 concept is_loader = requires(Loader loader) { loader.operator() && std::is_class<Loader>::value; };
97 } // namespace meta
98} // namespace galaxy
99
100#endif
Arithmetic concept.
Definition Concepts.hpp:47
Makes sure a value is a valid value for a std::bitset.
Definition Concepts.hpp:77
Only class concept.
Definition Concepts.hpp:27
Ensures that the provided loader has an operator() that returns a shared pointer.
Definition Concepts.hpp:96
Tests for a type being a class, union, array, scalar or integral constant.
Definition Concepts.hpp:67
Concept to restrict templates to not pointers and not references.
Definition Concepts.hpp:37
Ensures a type is arithmetic or a std::string.
Definition Concepts.hpp:57
Makes sure a type is a valid component.
Definition Concepts.hpp:87
Timer.hpp galaxy.
Definition Async.hpp:17