|
| constexpr | BasicOptional () noexcept |
| |
| constexpr | BasicOptional (std::nullopt_t, const ALLOC &allocator={}) noexcept |
| |
| constexpr | BasicOptional (const T &value, const ALLOC &allocator={}) |
| |
| constexpr | BasicOptional (T &&value, const ALLOC &allocator={}) |
| |
| constexpr | BasicOptional (const ALLOC &allocator) |
| |
| template<typename... ARGS, typename TT = T, std::enable_if_t<!detail::is_optional_heap_allocated_v< TT > > * = nullptr, std::enable_if_t<!is_first_allocator< ARGS... >::value > * = nullptr> |
| constexpr | BasicOptional (std::in_place_t, ARGS &&... args) |
| |
| template<typename... ARGS, typename TT = T, std::enable_if_t<!detail::is_optional_heap_allocated_v< TT > > * = nullptr> |
| constexpr | BasicOptional (std::in_place_t, const ALLOC &allocator, ARGS &&... args) |
| |
| template<typename... ARGS, typename TT = T, std::enable_if_t< detail::is_optional_heap_allocated_v< TT > > * = nullptr> |
| constexpr | BasicOptional (std::in_place_t, const ALLOC &allocator, ARGS &&... args) |
| |
| template<typename... ARGS, typename TT = T, std::enable_if_t< detail::is_optional_heap_allocated_v< TT > > * = nullptr, std::enable_if_t<!is_first_allocator< ARGS... >::value > * = nullptr> |
| constexpr | BasicOptional (std::in_place_t, ARGS &&... args) |
| |
| | ~BasicOptional () |
| |
| constexpr | BasicOptional (const BasicOptional &other) |
| |
| template<typename U > |
| constexpr | BasicOptional (const BasicOptional< ALLOC, U > &other) |
| |
| constexpr | BasicOptional (const BasicOptional &other, const ALLOC &allocator) |
| |
| template<typename A , typename U > |
| constexpr | BasicOptional (const BasicOptional< A, U > &other, const ALLOC &allocator) |
| |
| constexpr BasicOptional & | operator= (const BasicOptional &other) |
| |
| template<typename A , typename U > |
| BasicOptional & | operator= (const BasicOptional< A, U > &other) |
| |
| BasicOptional & | operator= (std::nullopt_t) |
| |
| template<typename U = T, std::enable_if_t<!detail::is_optional_v< std::decay_t< U > > &&!(std::is_same_v< T, std::decay_t< U > > &&std::is_scalar_v< U >)> * = nullptr> |
| BasicOptional & | operator= (U &&value) |
| |
| | BasicOptional (BasicOptional &&other) |
| |
| | BasicOptional (BasicOptional &&other, const ALLOC &allocator) |
| |
| BasicOptional & | operator= (BasicOptional &&other) |
| |
| template<typename U > |
| constexpr | BasicOptional (BasicOptional< ALLOC, U > &&other) |
| |
| template<typename U > |
| constexpr | BasicOptional (BasicOptional< ALLOC, U > &&other, const ALLOC &allocator) |
| |
| template<typename U > |
| BasicOptional & | operator= (BasicOptional< ALLOC, U > &&other) |
| |
| constexpr bool | has_value () const noexcept |
| |
| void | reset () |
| |
| void | swap (BasicOptional &other) |
| |
| constexpr | operator bool () const noexcept |
| |
| template<typename... ARGS> |
| T & | emplace (ARGS &&... args) |
| |
| constexpr T & | value () & |
| |
| constexpr T && | value () && |
| |
| constexpr const T & | value () const & |
| |
| constexpr const T && | value () const && |
| |
| T & | operator* () & |
| |
| T && | operator* () && |
| |
| const T & | operator* () const & |
| |
| const T && | operator* () const && |
| |
| T * | operator-> () |
| |
| const T * | operator-> () const |
| |
| template<typename U > |
| T | value_or (U &&def) |
| |
| template<typename U > |
| T | value_or (U &&def) const |
| |
| | AllocatorHolder () |
| |
| | AllocatorHolder (const allocator_type &allocator) |
| |
| | AllocatorHolder (allocator_type &&allocator) |
| |
| allocator_type | get_allocator () const |
| |
| | AllocatorHolder (const AllocatorHolder &other)=default |
| |
| AllocatorHolder & | operator= (const AllocatorHolder &other)=default |
| |
| | AllocatorHolder (AllocatorHolder &&other)=default |
| |
| AllocatorHolder & | operator= (AllocatorHolder &&other)=default |
| |
Implementation of optional type which allocates memory when type
- the type is explicitly tagged with IS_RECURSIVE type OR
- doesn't fit under 3*sizeof(void*)
Largely compatible with std::optional with following differences:
- BasicOptional(U&&) implemented only with T because the required is_constructible constrain can't be used on incomplete types
- operator=(U&&) implemented without is_constructible constrain because that can't be used on incomplete types
- BasicOptional(std::in_place_t, std::initializer_list) not implemented
- Monadic operations from C++23 not implemented
- Conditional noexcept and conditional explicit-ness on certain members not implemented
Definition at line 107 of file Optional.h.