CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_assignable_from.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
12
13#include <type_traits>
14
15namespace CeresEngine::traits {
16
19 template<class LHS, class RHS, class = void> struct is_assignable_from : std::false_type {};
20
21 template<class LHS, class RHS>
24 // clang-format off
25 std::is_lvalue_reference_v<LHS> &&
26 std::is_same_v<decltype(std::declval<LHS>() = std::declval<RHS&&>()), LHS>
27 // clang-format on
28 >> : std::true_type {};
29
30 template<class LHS, class RHS> bool constexpr is_assignable_from_v = is_assignable_from<LHS, RHS>::value;
31
33 template<class LHS, class RHS>
35
36} // namespace CeresEngine::traits
Definition is_assignable_from.hpp:34
Definition Partitioner.hpp:146
bool constexpr is_assignable_from_v
Definition is_assignable_from.hpp:30
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 assignable_from concept.
Definition is_assignable_from.hpp:19