16 template<
typename T>
using IsNotReference =
typename std::enable_if<!std::is_reference<T>::value,
void>::type;
18 template<
typename T,
template<
typename>
class CRTPType>
struct CRTP {
23 template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
class NamedType :
public Skills<NamedType<T, Parameter, Skills...>>... {
33 explicit constexpr NamedType(
T const& value)
noexcept(std::is_nothrow_copy_constructible<T>::value) :
raw(value) {}
35 template<
typename TType = T,
typename = IsNotReference<TType>>
36 explicit constexpr NamedType(
T&& value)
noexcept(std::is_nothrow_move_constructible<T>::value) :
raw(
std::
move(value)) {}
52 static_assert(
sizeof...(Ts) ==
sizeof...(
Us),
"Passing wrong number of arguments");
53 auto x = std::make_tuple(std::forward<Us>(args)...);
54 return f(std::move(std::get<Ts>(x))...);
194 template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
212 template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
223 template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
225 [[
nodiscard]]
constexpr operator T const&()
const {
return this->getUnderlying().get(); }
226 [[
nodiscard]]
constexpr operator T&() {
return this->getUnderlying().get(); }
231 template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
233 [[
nodiscard]]
constexpr std::remove_reference_t<T>
const*
operator->()
const {
return std::addressof(this->getUnderlying().
get()); }
269template<
typename T,
typename Parameter,
template<
typename>
class... Skills>
struct std::hash<
CeresEngine::NamedType<T, Parameter, Skills...>> {
271 using checkIfHashable =
typename std::enable_if<NamedType::is_hashable, void>::type;
274 static_assert(
noexcept(std::hash<T>()(x.get())),
"hash fuction should not throw");
276 return std::hash<T>()(x.get());
Definition NamedType.hpp:23
constexpr NamedType(T &&value) noexcept(std::is_nothrow_move_constructible< T >::value)
Definition NamedType.hpp:36
T raw
Definition NamedType.hpp:28
constexpr T & get() noexcept
Definition NamedType.hpp:39
NamedType< T &, Parameter, Skills... > ReferenceType
Definition NamedType.hpp:26
constexpr std::remove_reference_t< T > const & get() const noexcept
Definition NamedType.hpp:40
constexpr NamedType(T const &value) noexcept(std::is_nothrow_copy_constructible< T >::value)
Definition NamedType.hpp:33
T UnderlyingType
Definition NamedType.hpp:25
Definition Application.hpp:19
decltype(auto) get(BezierPath::Element &element) noexcept
Decomposes a bezier path element.
Definition BezierPath.hpp:723
constexpr Byte operator<<(const Byte arg, const _IntType shift) noexcept
Definition DataTypes.hpp:44
auto move(Vector3 position)
Moves a entity to the given position.
Definition Helpers.hpp:22
@ Destination
Specifies that the buffer can be used as the destination of a transfer command.
typename std::enable_if<!std::is_reference< T >::value, void >::type IsNotReference
Definition NamedType.hpp:16
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
constexpr StrongType< T > make_named(T const &value)
Definition NamedType.hpp:46
Definition NamedType.hpp:93
Definition NamedType.hpp:265
Definition NamedType.hpp:81
constexpr T operator+(T const &other) const
Definition NamedType.hpp:82
constexpr T & operator+=(T const &other)
Definition NamedType.hpp:83
Definition NamedType.hpp:98
constexpr T & operator-=(T const &other)
Definition NamedType.hpp:100
constexpr T operator-(T const &other) const
Definition NamedType.hpp:99
Definition NamedType.hpp:143
constexpr T operator&(T const &other) const
Definition NamedType.hpp:144
constexpr T & operator&=(T const &other)
Definition NamedType.hpp:145
Definition NamedType.hpp:139
constexpr T operator~() const
Definition NamedType.hpp:140
Definition NamedType.hpp:167
constexpr T operator<<(T const &other) const
Definition NamedType.hpp:168
constexpr T & operator<<=(T const &other)
Definition NamedType.hpp:169
Definition NamedType.hpp:151
constexpr T operator|(T const &other) const
Definition NamedType.hpp:152
constexpr T & operator|=(T const &other)
Definition NamedType.hpp:153
Definition NamedType.hpp:175
constexpr T & operator>>=(T const &other)
Definition NamedType.hpp:177
constexpr T operator>>(T const &other) const
Definition NamedType.hpp:176
Definition NamedType.hpp:159
constexpr T operator^(T const &other) const
Definition NamedType.hpp:160
constexpr T & operator^=(T const &other)
Definition NamedType.hpp:161
Definition NamedType.hpp:18
constexpr T const & getUnderlying() const
Definition NamedType.hpp:20
constexpr T & getUnderlying()
Definition NamedType.hpp:19
Definition NamedType.hpp:237
Definition NamedType.hpp:183
constexpr bool operator>(ComparableTrait< T > const &other) const
Definition NamedType.hpp:185
constexpr bool operator<=(ComparableTrait< T > const &other) const
Definition NamedType.hpp:186
constexpr bool operator!=(ComparableTrait< T > const &other) const
Definition NamedType.hpp:189
constexpr bool operator<(ComparableTrait< T > const &other) const
Definition NamedType.hpp:184
constexpr bool operator>=(ComparableTrait< T > const &other) const
Definition NamedType.hpp:187
constexpr bool operator==(ComparableTrait< T > const &other) const
Definition NamedType.hpp:188
Definition NamedType.hpp:244
constexpr std::remove_reference_t< T > const & operator*() const &
Definition NamedType.hpp:197
constexpr T & operator*() &
Definition NamedType.hpp:196
Definition NamedType.hpp:192
Definition NamedType.hpp:123
constexpr T operator/(T const &other) const
Definition NamedType.hpp:124
constexpr T & operator/=(T const &other)
Definition NamedType.hpp:125
Definition NamedType.hpp:221
Definition NamedType.hpp:219
static constexpr bool is_hashable
Definition NamedType.hpp:219
Definition NamedType.hpp:201
Definition NamedType.hpp:200
Definition NamedType.hpp:239
constexpr std::remove_reference_t< T > * operator->()
Definition NamedType.hpp:234
constexpr std::remove_reference_t< T > const * operator->() const
Definition NamedType.hpp:233
Definition NamedType.hpp:229
Definition NamedType.hpp:131
constexpr T & operator%=(T const &other)
Definition NamedType.hpp:133
constexpr T operator%(T const &other) const
Definition NamedType.hpp:132
Definition NamedType.hpp:115
constexpr T operator*(T const &other) const
Definition NamedType.hpp:116
constexpr T & operator*=(T const &other)
Definition NamedType.hpp:117
Definition NamedType.hpp:77
constexpr T operator--(int)
Definition NamedType.hpp:78
Definition NamedType.hpp:66
constexpr T operator++(int)
Definition NamedType.hpp:67
Definition NamedType.hpp:70
constexpr T & operator--()
Definition NamedType.hpp:71
Definition NamedType.hpp:59
constexpr T & operator++()
Definition NamedType.hpp:60
Definition NamedType.hpp:206
void print(std::ostream &os) const
Definition NamedType.hpp:209
static constexpr bool is_printable
Definition NamedType.hpp:207
Definition NamedType.hpp:110
Definition NamedType.hpp:89
constexpr T operator+() const
Definition NamedType.hpp:90
Definition NamedType.hpp:106
constexpr T operator-() const
Definition NamedType.hpp:107
Definition NamedType.hpp:49
auto operator()(Us &&... args) const
Definition NamedType.hpp:51
F f
Definition NamedType.hpp:50