IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
strong_type_base.hxx
Go to the documentation of this file.
1
3
4#pragma once
5#include <type_traits>
6#include <concepts>
7
8namespace ice
9{
10
11 namespace detail
12 {
13
14 template<typename T>
15 concept HasMemberValue = requires(T t) {
16 { t.value } -> std::convertible_to<decltype(T::value)>;
17 };
18
19 template<typename T>
20 concept OnlyMemberValue = HasMemberValue<T> && sizeof(T) == sizeof(T::value);
21
22 template<typename T, typename ExpectedTag>
23 concept HasAliasTypeTag = std::is_same_v<typename T::TypeTag, ExpectedTag>;
24
25 template<typename Type>
27
28 template<typename Owner, typename ValueType>
29 struct ExtractMemberType<ValueType Owner::*>
30 {
31 using Type = ValueType;
32 };
33
34 template<typename Type>
36
37 template<template <typename> typename TType, typename ExtractedType>
38 struct ExtractTemplateType<TType<ExtractedType>>
39 {
40 using Type = ExtractedType;
41 };
42
43 } // namespace detail
44
45} // namespace ice
Definition strong_type_base.hxx:23
Definition strong_type_base.hxx:15
Definition strong_type_base.hxx:20
Definition hashmap_details.hxx:13
SPDX-License-Identifier: MIT.
Definition array.hxx:12
ValueType Type
Definition strong_type_base.hxx:31
Definition strong_type_base.hxx:26
ExtractedType Type
Definition strong_type_base.hxx:40
Definition strong_type_base.hxx:35