sparrow 0.3.0
Loading...
Searching...
No Matches
nullable.hpp File Reference
#include <compare>
#include <concepts>
#include <exception>
#include <type_traits>
#include <variant>
#include "sparrow/utils/mp_utils.hpp"
Include dependency graph for nullable.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sparrow::is_nullable< T >
 
struct  sparrow::is_nullable< nullable< T, B > >
 
struct  sparrow::nullable_traits< T >
 
struct  sparrow::nullable_traits< T & >
 
class  sparrow::bad_nullable_access
 
struct  sparrow::nullval_t
 nullval_t is an empty class used to indicate that a nullable is null. More...
 
class  sparrow::nullable< T, B >
 The nullable class models a value or a reference that can be "null", or missing, like values traditionally used in data science libraries. More...
 
class  sparrow::nullable_variant< T >
 variant of nullable, exposing has_value for convenience More...
 
struct  std::basic_common_reference< sparrow::nullable< T, TB >, sparrow::nullable< U, UB >, TQual, UQual >
 

Namespaces

namespace  sparrow
 
namespace  sparrow::impl
 
namespace  std
 

Concepts

concept  sparrow::is_nullable_of
 
concept  sparrow::is_nullable_of_convertible_to
 
concept  sparrow::range_of_nullables
 
concept  sparrow::impl::both_constructible_from_cref
 Concepts used to disambiguate the nullable class constructors.
 
concept  sparrow::impl::both_convertible_from_cref
 
concept  sparrow::impl::constructible_from_one
 
concept  sparrow::impl::convertible_from_one
 
concept  sparrow::impl::initializable_from_one
 
concept  sparrow::impl::initializable_from_refs
 
concept  sparrow::impl::assignable_from_one
 
concept  sparrow::impl::assignable_from_refs
 
concept  sparrow::impl::both_constructible_from_cond_ref
 
concept  sparrow::impl::both_convertible_from_cond_ref
 
concept  sparrow::impl::both_assignable_from_cref
 
concept  sparrow::impl::both_assignable_from_cond_ref
 

Macros

#define SPARROW_CONSTEXPR   constexpr
 

Typedefs

template<class T, class U>
using sparrow::impl::conditional_ref_t = std::conditional_t<std::is_reference_v<T>, const std::decay_t<U>&, std::decay_t<U>&&>
 

Functions

constexpr nullval_t sparrow::nullval (0)
 
template<class T, class B>
constexpr void sparrow::swap (nullable< T, B > &lhs, nullable< T, B > &rhs) noexcept
 
template<class T, class B>
constexpr bool sparrow::operator== (const nullable< T, B > &lhs, nullval_t) noexcept
 
template<class T, mpl::boolean_like B>
constexpr std::strong_ordering sparrow::operator<=> (const nullable< T, B > &lhs, nullval_t) noexcept
 
template<class T, class B, class U>
constexpr bool sparrow::operator== (const nullable< T, B > &lhs, const U &rhs) noexcept
 
template<class T, class B, class U>
requires (!impl::is_nullable_v<U> && std::three_way_comparable_with<U, T>)
constexpr std::compare_three_way_result_t< T, U > sparrow::operator<=> (const nullable< T, B > &lhs, const U &rhs) noexcept
 
template<class T, class B, class U, class UB>
constexpr bool sparrow::operator== (const nullable< T, B > &lhs, const nullable< U, UB > &rhs) noexcept
 
template<class T, class B, std::three_way_comparable_with< T > U, class UB>
constexpr std::compare_three_way_result_t< T, U > sparrow::operator<=> (const nullable< T, B > &lhs, const nullable< U, UB > &rhs) noexcept
 
template<class T, mpl::boolean_like B = bool>
constexpr nullable< T, B > sparrow::make_nullable (T &&value, B &&flag=true)
 

Variables

template<class T>
constexpr bool sparrow::is_nullable_v = is_nullable<T>::value
 
template<class T>
static constexpr bool sparrow::impl::is_nullable_v = mpl::is_type_instance_of_v<T, nullable>
 

Macro Definition Documentation

◆ SPARROW_CONSTEXPR

#define SPARROW_CONSTEXPR   constexpr

Definition at line 41 of file nullable.hpp.