Loading...
Searching...
No Matches
pqxx::no_null< TYPE > Struct Template Reference

Nullness traits describing a type which does not have a null value. More...

## Static Public Member Functions

static constexpr bool | is_null (TYPE const &) noexcept
| Does a given value correspond to an SQL null value?

## Static Public Attributes

static constexpr bool | has_null = false
| Does `TYPE` have a "built-in null value"?
static constexpr bool | always_null = false
| Are all values of this type null?

## Detailed Description

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

Nullness traits describing a type which does not have a null value.

## Member Function Documentation

## is_null()

template<typename TYPE>

constexpr bool pqxx::no_null< TYPE >::is_null | ( | TYPE const & |  | ) |

inline static nodiscard constexpr noexcept

Does a given value correspond to an SQL null value?

Most C++ types, such as `int` or `std::string`, have no inherent null value. But some types such as C-style string pointers do have a natural equivalent to an SQL null.

## Member Data Documentation

## always_null

template<typename TYPE>

bool pqxx::no_null< TYPE >::always_null = false

static constexpr

Are all values of this type null?

There are a few special C++ types which are always null - mainly `std::nullptr_t`.

## has_null

template<typename TYPE>

bool pqxx::no_null< TYPE >::has_null = false

static constexpr

Does `TYPE` have a "built-in null value"?

For example, a pointer can equal `nullptr`, which makes a very natural representation of an SQL null value. For such types, the code sometimes needs to make special allowances.

for most types, such as `int` or `std::string`, there is no built-in null. If you want to represent an SQL null value for such a type, you would have to wrap it in something that does have a null value. For example, you could use `std::optional<int>` for "either an @c int or a null value."

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

- /build/libpqxx-hcWu4i/libpqxx-7.10.0/include/pqxx/strconv.hxx