tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
monostate.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_VARIANT_MONOSTATE_HPP
4#define TETL_VARIANT_MONOSTATE_HPP
5
7
8namespace etl {
9
16struct monostate {
18 [[nodiscard]] friend constexpr auto operator==(monostate /*l*/, monostate /*r*/) noexcept -> bool { return true; }
19
21 [[nodiscard]] friend constexpr auto operator<=>(monostate /*l*/, monostate /*r*/) noexcept -> etl::strong_ordering
22 {
24 }
25};
26
27} // namespace etl
28
29#endif // TETL_VARIANT_MONOSTATE_HPP
Definition adjacent_find.hpp:8
Unit type intended for use as a well-behaved empty alternative in etl::variant. In particular,...
Definition monostate.hpp:16
friend constexpr auto operator==(monostate, monostate) noexcept -> bool
All instances of etl::monostate compare equal.
Definition monostate.hpp:18
friend constexpr auto operator<=>(monostate, monostate) noexcept -> etl::strong_ordering
All instances of etl::monostate compare equal.
Definition monostate.hpp:21
Definition strong_ordering.hpp:14
static strong_ordering const equal
Definition strong_ordering.hpp:16