tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
convertible_to.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_CONVERTIBLE_TO_HPP
5#define TETL_CONCEPTS_CONVERTIBLE_TO_HPP
6
7#include <etl/_type_traits/add_rvalue_reference.hpp>
8#include <etl/_type_traits/is_convertible.hpp>
9
10namespace etl {
11
12/// \brief The concept convertible_to<From, To> specifies that an expression of
13/// the same type and value category as those of declval<From>() can be
14/// implicitly and explicitly converted to the type To, and the two forms of
15/// conversion are equivalent.
16/// \ingroup concepts
17template <typename From, typename To>
18concept convertible_to
19 = etl::is_convertible_v<From, To> and requires(etl::add_rvalue_reference_t<From> (&f)()) { static_cast<To>(f()); };
20
21} // namespace etl
22
23#endif // TETL_CONCEPTS_CONVERTIBLE_TO_HPP
Definition adjacent_find.hpp:9