tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
assignable_from.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_CONCEPTS_ASSIGNABLE_FROM_HPP
5#define TETL_CONCEPTS_ASSIGNABLE_FROM_HPP
6
7#include <etl/_concepts/common_reference_with.hpp>
8#include <etl/_concepts/same_as.hpp>
9#include <etl/_type_traits/is_lvalue_reference.hpp>
10#include <etl/_type_traits/remove_reference.hpp>
11#include <etl/_utility/forward.hpp>
12
13namespace etl {
14
15// clang-format off
16
17/// \headerfile etl/concepts.hpp
18/// \ingroup concepts
19template<typename LHS, typename RHS>
20concept assignable_from =
21 is_lvalue_reference_v<LHS>
22 // and common_reference_with<remove_reference_t<LHS> const&, remove_reference_t<RHS> const&>
23 and requires(LHS lhs, RHS&& rhs) {
24 { lhs = etl::forward<RHS>(rhs) } -> same_as<LHS>;
25 };
26
27// clang-format on
28
29} // namespace etl
30
31#endif // TETL_CONCEPTS_ASSIGNABLE_FROM_HPP
Definition adjacent_find.hpp:9