tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
derived_from.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_DERIVED_FROM_HPP
5#define TETL_CONCEPTS_DERIVED_FROM_HPP
6
7#include <etl/_type_traits/is_base_of.hpp>
8#include <etl/_type_traits/is_convertible.hpp>
9
10namespace etl {
11
12/// \brief The concept derived_from<Derived, Base> is satisfied if and only if
13/// Base is a class type that is either Derived or a public and unambiguous base
14/// of Derived, ignoring cv-qualifiers. Note that this behaviour is different to
15/// is_base_of when Base is a private or protected base of Derived.
16/// \ingroup concepts
17template <typename Derived, typename Base>
18concept derived_from = is_base_of_v<Base, Derived> and is_convertible_v<Derived const volatile*, Base const volatile*>;
19
20} // namespace etl
21
22#endif // TETL_CONCEPTS_DERIVED_FROM_HPP
Definition adjacent_find.hpp:9