RESTinio
Public Member Functions | Private Attributes | List of all members
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 {};
std::size_t, max_parallel_connections_tag >;
struct max_active_accepts_tag {};
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);
...
};
constexpr tagged_scalar_t(Scalar value) noexcept
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.
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.
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: