tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
copy_constructible.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_CONCEPTS_COPY_CONSTRUCTIBLE_HPP
5#define TETL_CONCEPTS_COPY_CONSTRUCTIBLE_HPP
6
7#include <etl/_concepts/constructible_from.hpp>
8#include <etl/_concepts/convertible_to.hpp>
9#include <etl/_concepts/move_constructible.hpp>
10
11namespace etl {
12
13/// \brief The concept copy_constructible is satisfied if T is an lvalue
14/// reference type, or if it is a move_constructible object type where an object
15/// of that type can constructed from a (possibly const) lvalue or const rvalue
16/// of that type in both direct- and copy-initialization contexts with the usual
17/// semantics (a copy is constructed with the source unchanged).
18/// \ingroup concepts
19template <typename T>
20concept copy_constructible = move_constructible<T>
21 and constructible_from<T, T&>
22 and convertible_to<T&, T>
23 and constructible_from<T, T const&>
24 and convertible_to<T const&, T>
25 and constructible_from<T, T const>
26 and convertible_to<T const, T>;
27
28} // namespace etl
29
30#endif // TETL_CONCEPTS_COPY_CONSTRUCTIBLE_HPP
Definition adjacent_find.hpp:9