AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::rest::ParamConverter< T > Struct Template Reference

#include <paramConverter.hpp>

Inheritance diagram for anch::rest::ParamConverter< T >:
Collaboration diagram for anch::rest::ParamConverter< T >:

Static Public Member Functions

static std::optional< T > convert (std::string_view value) noexcept
static std::optional< T > convert (std::string_view value) noexcept

Detailed Description

template<typename T>
requires (std::integral<T> && !std::same_as<T, bool>)
struct anch::rest::ParamConverter< T >

Integral path parameter (std::from_chars , the whole value has to be a number)

Template Parameters
Tthe integral type

Floating point path parameter (std::from_chars )

Template Parameters
Tthe floating point type

Member Function Documentation

◆ convert() [1/2]

template<typename T>
std::optional< T > anch::rest::ParamConverter< T >::convert ( std::string_view value)
staticnoexcept

Convert parameter

Parameters
valuethe parameter value
Returns
the number, empty when invalid or out of range

◆ convert() [2/2]

template<typename T>
std::optional< T > anch::rest::ParamConverter< T >::convert ( std::string_view value)
staticnoexcept

Convert parameter

Parameters
valuethe parameter value
Returns
the number, empty when invalid or out of range

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