Maki
Loading...
Searching...
No Matches
event.hpp
1
//Copyright Florian Goujeon 2021 - 2025.
2
//Distributed under the Boost Software License, Version 1.0.
3
//(See accompanying file LICENSE or copy at
4
//https://www.boost.org/LICENSE_1_0.txt)
5
//Official repository: https://github.com/fgoujeon/maki
6
7
#ifndef MAKI_EVENT_HPP
8
#define MAKI_EVENT_HPP
9
10
#include <type_traits>
11
12
namespace
maki
13
{
14
18
template
<
class
T>
19
struct
event_t
20
{
24
using
type
= T;
25
};
26
31
template
<
class
T,
class
U>
32
constexpr
bool
operator==
(
const
event_t<T>
/*lhs*/
,
const
event_t<U>
/*rhs*/
)
33
{
34
return
std::is_same_v<T, U>;
35
}
36
41
template
<
class
T>
42
constexpr
auto
event
=
event_t<T>
{};
43
44
namespace
detail
45
{
46
template
<
class
T>
47
struct
is_event
48
{
49
static
constexpr
auto
value =
false
;
50
};
51
52
template
<
class
T>
53
struct
is_event<event_t<T>>
54
{
55
static
constexpr
auto
value =
true
;
56
};
57
58
template
<
class
T>
59
constexpr
bool
is_event_v = is_event<T>::value;
60
}
61
62
}
//namespace
63
64
#endif
maki
The Maki library.
maki::event_t
Holds an event type.
Definition
event.hpp:20
maki::event_t::operator==
constexpr bool operator==(const event_t< T >, const event_t< U >)
Returns whether T and U are the same type.
Definition
event.hpp:32
maki::event_t::type
T type
An alias for the given type.
Definition
event.hpp:24
maki
event.hpp
Generated by
1.13.2