libpqxx
The C++ client library for PostgreSQL
pqxx::internal::float_string_traits< T > Struct Template Reference

String traits for builtin floating-point types. More...

#include <conversions.hxx>

Static Public Member Functions

static PQXX_LIBEXPORTfrom_string (std::string_view text, ctx={})
 
static PQXX_LIBEXPORT std::string_view to_buf (std::span< char > buf, T const &value, ctx c={})
 
static constexpr std::size_t digits10 (std::size_t value) noexcept
 
static constexpr PQXX_INLINE_COV std::size_t size_buffer (T const &) noexcept
 

Detailed Description

template<std::floating_point T>
struct pqxx::internal::float_string_traits< T >

String traits for builtin floating-point types.

It would make sense to define this directly as the definition for pqxx::string_traits<T> where T is a std::floating_point. However Visual Studio 2022 does not seem to accept that syntax.

So instead, we create a separate base class for std::floating_point types and then derive specialisations of pqxx::string_traits from that.

Member Function Documentation

◆ digits10()

template<std::floating_point T>
static constexpr std::size_t pqxx::internal::float_string_traits< T >::digits10 ( std::size_t  value)
inlinestaticconstexprnoexcept

◆ from_string()

template<std::floating_point T>
T pqxx::internal::float_string_traits< T >::from_string ( std::string_view  text,
pqxx::ctx  c = {} 
)
static

◆ size_buffer()

template<std::floating_point T>
static constexpr PQXX_INLINE_COV std::size_t pqxx::internal::float_string_traits< T >::size_buffer ( T const &  )
inlinestaticconstexprnoexcept

◆ to_buf()

template<std::floating_point T>
std::string_view pqxx::internal::float_string_traits< T >::to_buf ( std::span< char >  buf,
T const &  value,
ctx  c = {} 
)
static

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