libpqxx
The C++ client library for PostgreSQL
pqxx::forbidden_conversion< TYPE > Struct Template Reference

String traits for a forbidden type conversion. More...

#include <strconv.hxx>

Static Public Member Functions

static std::string_view to_buf (std::span< char >, TYPE const &, ctx={})=delete
 
static TYPE from_string (std::string_view, ctx={})=delete
 
static std::size_t size_buffer (TYPE const &) noexcept=delete
 

Detailed Description

template<typename TYPE>
struct pqxx::forbidden_conversion< TYPE >

String traits for a forbidden type conversion.

If you have a C++ type for which you explicitly wish to forbid SQL conversion, you can derive a pqxx::string_traits specialisation for that type from this struct. Any attempt to convert the type will then fail to build, and produce an error referring to this type. It may help debug build errors.

Member Function Documentation

◆ from_string()

template<typename TYPE >
static TYPE pqxx::forbidden_conversion< TYPE >::from_string ( std::string_view  ,
ctx  = {} 
)
staticdelete

◆ size_buffer()

template<typename TYPE >
static std::size_t pqxx::forbidden_conversion< TYPE >::size_buffer ( TYPE const &  )
staticdeletenoexcept

◆ to_buf()

template<typename TYPE >
static std::string_view pqxx::forbidden_conversion< TYPE >::to_buf ( std::span< char >  ,
TYPE const &  ,
ctx  = {} 
)
staticdelete

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