IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
core
public
ice
concept
strong_type_base.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <type_traits>
6
#include <concepts>
7
8
namespace
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>
26
struct
ExtractMemberType
{ };
27
28
template
<
typename
Owner,
typename
ValueType>
29
struct
ExtractMemberType
<ValueType Owner::*>
30
{
31
using
Type
= ValueType;
32
};
33
34
template
<
typename
Type>
35
struct
ExtractTemplateType
{ };
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
ice::detail::HasAliasTypeTag
Definition
strong_type_base.hxx:23
ice::detail::HasMemberValue
Definition
strong_type_base.hxx:15
ice::detail::OnlyMemberValue
Definition
strong_type_base.hxx:20
ice::detail
Definition
hashmap_details.hxx:13
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::detail::ExtractMemberType< ValueType Owner::* >::Type
ValueType Type
Definition
strong_type_base.hxx:31
ice::detail::ExtractMemberType
Definition
strong_type_base.hxx:26
ice::detail::ExtractTemplateType< TType< ExtractedType > >::Type
ExtractedType Type
Definition
strong_type_base.hxx:40
ice::detail::ExtractTemplateType
Definition
strong_type_base.hxx:35
Generated by
1.18.0