kblib 0.2.3
General utilities library for modern C++
kblib::detail::str_type< T, typename > Struct Template Reference

Converts arithmetic types to strings, but provides the identity transformation for all other types. More...

#include <kblib/stringops.h>

Public Types

using type = std::string
 Arithmetic types can be converted into strings using the standard library. More...
 

Static Public Member Functions

static auto convert (T in) -> std::string
 Forwards to std::to_string. More...
 

Detailed Description

template<typename T, typename = arithmetic_type_t<T>>
struct kblib::detail::str_type< T, typename >

Converts arithmetic types to strings, but provides the identity transformation for all other types.

This is primarily an implementation detail of concat, provided in the main namespace because it might be generally useful.

Definition at line 114 of file stringops.h.

Member Typedef Documentation

◆ type

template<typename T , typename = arithmetic_type_t<T>>
using kblib::detail::str_type< T, typename >::type = std::string

Arithmetic types can be converted into strings using the standard library.

Definition at line 119 of file stringops.h.

Member Function Documentation

◆ convert()

template<typename T , typename = arithmetic_type_t<T>>
static auto kblib::detail::str_type< T, typename >::convert ( in) -> std::string
inlinestatic

Forwards to std::to_string.

Parameters
inA numeric value to convert to a string.
Returns
std::string A string representation of that number.

Definition at line 125 of file stringops.h.


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