CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_movable.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
13
14#include <type_traits>
15
16namespace CeresEngine::traits {
17
20 template<class T, class = void> struct is_movable : std::false_type {};
21
22 template<class T>
23 struct is_movable<T,
25 // clang-format off
26 std::is_object_v<T> &&
27 is_move_constructible_v<T> &&
28 is_assignable_from_v<T&, T> &&
29 is_swappable_v<T>
30 // clang-format on
31 >> : std::true_type {};
32
34 template<class T> bool constexpr is_movable_v = is_movable<T>::value;
35
37 template<class T>
39
40} // namespace CeresEngine::traits
Definition is_movable.hpp:38
Definition Partitioner.hpp:146
bool constexpr is_movable_v
A C++17 type trait equivalent to the C++20 movable concept.
Definition is_movable.hpp:34
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668
A C++17 type trait equivalent to the C++20 movable concept.
Definition is_movable.hpp:20