tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
default_initializable.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_DEFAULT_INITIALIZABLE_HPP
5#define TETL_CONCEPTS_DEFAULT_INITIALIZABLE_HPP
6
7#include <etl/_concepts/constructible_from.hpp>
8#include <etl/_new/operator.hpp>
9
10namespace etl {
11
12/// \brief The default_initializable concept checks whether variables of type T
13/// can be value-initialized (T() is well-formed); direct-list-initialized from
14/// an empty initializer list (T{} is well-formed); and default-initialized (T
15/// t; is well-formed). Access checking is performed as if in a context
16/// unrelated to T. Only the validity of the immediate context of the variable
17/// initialization is considered.
18/// \ingroup concepts
19template <typename T>
20concept default_initializable
21 = constructible_from<T> and requires { T{}; } and requires { ::new (static_cast<void*>(nullptr)) T; };
22
23} // namespace etl
24
25#endif // TETL_CONCEPTS_DEFAULT_INITIALIZABLE_HPP
Definition adjacent_find.hpp:9