RESTinio
Loading...
Searching...
No Matches
restinio
utils
tagged_scalar.hpp
Go to the documentation of this file.
1
/*
2
* RESTinio
3
*/
4
12
#pragma once
13
14
#include <
restinio/compiler_features.hpp
>
15
16
#include <type_traits>
17
18
namespace
restinio
19
{
20
21
namespace
utils
22
{
23
24
//
25
// tagged_scalar_t
26
//
52
template
<
typename
Scalar,
typename
Tag >
53
class
tagged_scalar_t
54
{
55
static_assert
( std::is_scalar<Scalar>::value,
56
"Scalar is expected to be scalar type"
);
57
58
Scalar
m_value
;
59
60
public
:
61
constexpr
explicit
tagged_scalar_t
(
Scalar
value
)
noexcept
62
:
m_value
{
value
}
63
{}
64
65
[[
nodiscard
]]
66
constexpr
Scalar
67
value
()
const
noexcept
{
return
m_value
; }
68
};
69
70
}
/* namespace utils */
71
72
}
/* namespace restinio */
73
restinio::utils::tagged_scalar_t
Helper template for defining tagged scalar types.
Definition
tagged_scalar.hpp:54
restinio::utils::tagged_scalar_t::m_value
Scalar m_value
Definition
tagged_scalar.hpp:58
restinio::utils::tagged_scalar_t::tagged_scalar_t
constexpr tagged_scalar_t(Scalar value) noexcept
Definition
tagged_scalar.hpp:61
restinio::utils::tagged_scalar_t::value
constexpr Scalar value() const noexcept
Definition
tagged_scalar.hpp:67
compiler_features.hpp
Detection of compiler version and absence of various features.
restinio
Definition
asio_include.hpp:21
restinio::on_this_thread
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
Definition
http_server_run.hpp:123
Generated by
1.10.0