tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
nullopt.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_OPTIONAL_NULLOPT_HPP
5#define TETL_OPTIONAL_NULLOPT_HPP
6
7namespace etl {
8
9/// etl::nullopt_t is an empty class type used to indicate optional type
10/// with uninitialized state. In particular, etl::optional has a constructor
11/// with nullopt_t as a single argument, which creates an optional that does not
12/// contain a value.
13/// \ingroup optional
14struct nullopt_t {
15 explicit constexpr nullopt_t(int /*unused*/) { }
16};
17
18/// etl::nullopt is a constant of type etl::nullopt_t that is used to
19/// indicate optional type with uninitialized state.
20/// \relates nullopt_t
21/// \ingroup optional
22inline constexpr auto nullopt = etl::nullopt_t{0};
23
24} // namespace etl
25
26#endif // TETL_OPTIONAL_NULLOPT_HPP
constexpr auto nullopt
etl::nullopt is a constant of type etl::nullopt_t that is used to indicate optional type with uniniti...
Definition nullopt.hpp:22
Definition adjacent_find.hpp:9
etl::nullopt_t is an empty class type used to indicate optional type with uninitialized state....
Definition nullopt.hpp:14
constexpr nullopt_t(int)
Definition nullopt.hpp:15