Class field_ref

Class Documentation

class field_ref

Reference to a field in the result set.

Public Functions

inline std::string_view name() const &

The name of the field.

inline size_t num() const noexcept

The index number of the field.

template<typename T = std::string>
inline T get() const

Return the contents of this item as type

Template Parameters:

T

inline bool is_null() const

Returns true if the field contains NULL.

template<typename T>
inline auto value_or(const T &dv) const

Return the contents of this item as type

Template Parameters:

T – or, if not set, use dv as the default value.

inline field_ref(const_row_handle rh, uint16_t col, std::shared_ptr<result_impl> result_impl)

Constructor.

field_ref(const field_ref&) = default

Copy constructor.

field_ref(field_ref&&) = default

Move constructor.

field_ref &operator=(const field_ref&) = default

Copy assignment.

field_ref &operator=(field_ref&&) = default

Move assignment.