libpqxx
The C++ client library for PostgreSQL
pqxx::nullness< TYPE, ENABLE > Struct Template Referencefinal

Traits describing a type's "null value," if any. More...

#include <strconv.hxx>

Static Public Member Functions

static PQXX_PURE bool is_null (TYPE const &value)
 Is value a null? More...
 
static PQXX_PURE TYPE null ()
 Return a null value. More...
 

Static Public Attributes

static bool has_null
 Does this type have a null value? More...
 
static constexpr bool always_null = false
 Is this type always null? More...
 

Detailed Description

template<typename TYPE, typename ENABLE = void>
struct pqxx::nullness< TYPE, ENABLE >

Traits describing a type's "null value," if any.

Some C++ types have a special value or state which correspond directly to SQL's NULL.

The nullness traits describe whether it exists, and whether a particular value is null.

Warning
The ENABLE parameter is deprecated. It exists to enable use of std::enable_if. As of C++20, use requires or a concept instead.

Member Function Documentation

◆ is_null()

template<typename TYPE , typename ENABLE = void>
static PQXX_PURE bool pqxx::nullness< TYPE, ENABLE >::is_null ( TYPE const &  value)
static

Is value a null?

◆ null()

template<typename TYPE , typename ENABLE = void>
static PQXX_PURE TYPE pqxx::nullness< TYPE, ENABLE >::null ( )
static

Return a null value.

Don't use this in generic code to compare a value and see whether it is null. Some types may have multiple null values which do not compare as equal, or may define a null value which is not equal to anything including itself, like in SQL.

Member Data Documentation

◆ always_null

template<typename TYPE , typename ENABLE = void>
constexpr bool pqxx::nullness< TYPE, ENABLE >::always_null = false
staticconstexpr

Is this type always null?

This is only the case for a few types, such as std::nullptr_t.

◆ has_null

template<typename TYPE , typename ENABLE = void>
bool pqxx::nullness< TYPE, ENABLE >::has_null
static

Does this type have a null value?


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