emlabcpp
modern opinionated embedded C++ library
status.h
Go to the documentation of this file.
1
#pragma once
23
24
#include <concepts>
25
26
namespace
emlabcpp
27
{
28
29
template
<
typename
Derived,
typename
Enum >
30
struct
[[nodiscard]]
status
31
{
32
using
enum_type
= Enum;
33
34
constexpr
status
(
enum_type
s ) noexcept
35
: s_( s )
36
{
37
}
38
39
constexpr
status
(
status
const
& ) noexcept =
default
;
40
constexpr
status
(
status
&& ) noexcept = default;
41
constexpr
status
& operator=(
status
const& ) noexcept = default;
42
constexpr
status
& operator=(
status
&& ) noexcept = default;
43
44
[[nodiscard]] constexpr
enum_type
value() const noexcept
45
{
46
return
s_;
47
}
48
49
constexpr
friend
auto
50
operator<=>
(
status
const
& lhs,
status
const
& rhs ) noexcept =
default
;
51
52
private
:
53
enum_type
s_;
54
};
55
56
}
// namespace emlabcpp
emlabcpp
MIT License.
Definition:
impl.h:31
emlabcpp::operator<=>
auto operator<=>(static_circular_buffer< T, N > const &lh, static_circular_buffer< T, N > const &rh)
Definition:
static_circular_buffer.h:290
emlabcpp::status
Definition:
status.h:31
emlabcpp::status::status
constexpr status(enum_type s) noexcept
Definition:
status.h:34
emlabcpp::status::enum_type
Enum enum_type
Definition:
status.h:32
emlabcpp::status::status
constexpr status(status const &) noexcept=default
emlabcpp::status::status
constexpr status(status &&) noexcept=default
include
emlabcpp
status.h
Generated on Sun Jul 27 2025 20:01:11 for emlabcpp by
1.9.1