restinio::utils::tagged_scalar_t< Scalar, Tag > Class Template Reference

Helper template for defining tagged scalar types. More...

`#include <tagged_scalar.hpp>`

## Public Member Functions

constexpr | tagged_scalar_t (Scalar value) noexcept
RESTINIO_NODISCARD constexpr Scalar | value () const noexcept

## Private Attributes

Scalar | m_value

## Detailed Description

template<typename Scalar, typename Tag>
class restinio::utils::tagged_scalar_t< Scalar, Tag >

Helper template for defining tagged scalar types.

Usage example:

struct max_parallel_connections_tag {};
using max_parallel_connections_t = tagged_scalar_t<
std::size_t, max_parallel_connections_tag >;
struct max_active_accepts_tag {};
using max_active_accepts_t = tagged_scalar_t<
std::size_t, max_active_accepts_tag >;
class limiter_t
{
public:
limiter_t(
max_parallel_connections_t parallel_connections,
max_active_accepts_t active_accepts);
...
};
restinio::utils::tagged_scalar_t::tagged_scalar_t
constexpr tagged_scalar_t(Scalar value) noexcept
Definition: tagged_scalar.hpp:61
restinio::connection_count_limits::max_active_accepts_t
restinio::utils::tagged_scalar_t< std::size_t, max_active_accepts_tag > max_active_accepts_t
A kind of strict typedef for maximum count of active accepts.
Definition: connection_count_limiter.hpp:52
restinio::connection_count_limits::max_parallel_connections_t
restinio::utils::tagged_scalar_t< std::size_t, max_parallel_connections_tag > max_parallel_connections_t
A kind of strict typedef for maximum count of active connections.
Definition: connection_count_limiter.hpp:39

Since
  v.0.6.12

Definition at line 53 of file tagged_scalar.hpp.

## Constructor & Destructor Documentation

## tagged_scalar_t()

template<typename Scalar , typename Tag >

constexpr restinio::utils::tagged_scalar_t< Scalar, Tag >::tagged_scalar_t | ( | Scalar | value | ) |

inlineexplicitconstexprnoexcept

Definition at line 61 of file tagged_scalar.hpp.

## Member Function Documentation

## value()

template<typename Scalar , typename Tag >

RESTINIO_NODISCARD constexpr Scalar restinio::utils::tagged_scalar_t< Scalar, Tag >::value | ( |  | ) | const

inlineconstexprnoexcept

Definition at line 67 of file tagged_scalar.hpp.

## Member Data Documentation

## m_value

template<typename Scalar , typename Tag >

Scalar restinio::utils::tagged_scalar_t< Scalar, Tag >::m_value

private

Definition at line 58 of file tagged_scalar.hpp.

The documentation for this class was generated from the following file:

- restinio/utils/tagged_scalar.hpp