openMSX
Classes | Namespaces | Typedefs | Functions | Variables
optional.hh File Reference
#include <cassert>
#include <functional>
#include <initializer_list>
#include <stdexcept>
#include <type_traits>
#include <utility>
Include dependency graph for optional.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  optional< T >
 
struct  in_place_t
 
struct  nullopt_t
 
struct  nullopt_t::init
 
struct  bad_optional_access
 
struct  opt_impl::has_overloaded_addressof< T >
 
struct  opt_impl::trivial_init_t
 
union  opt_impl::storage_t< T >
 
union  opt_impl::constexpr_storage_t< T >
 
struct  opt_impl::optional_base< T >
 
struct  opt_impl::constexpr_optional_base< T >
 
class  optional< T >
 
class  optional< T & >
 
struct  std::hash<::optional< T > >
 
struct  std::hash<::optional< T & > >
 

Namespaces

 opt_impl
 
 opt_impl::swap_ns
 

Typedefs

template<typename T >
using opt_impl::OptionalBase = std::conditional_t< std::is_trivially_destructible< T >::value, constexpr_optional_base< std::remove_const_t< T > >, optional_base< std::remove_const_t< T > >>
 

Functions

template<typename T >
constexpr T && opt_impl::constexpr_forward (std::remove_reference_t< T > &t) noexcept
 
template<typename T >
constexpr T && opt_impl::constexpr_forward (std::remove_reference_t< T > &&t) noexcept
 
template<typename T >
constexpr std::remove_reference_t< T > && opt_impl::constexpr_move (T &&t) noexcept
 
template<typename T , std::enable_if_t<!has_overloaded_addressof< T >::value > * = nullptr>
constexpr T * opt_impl::static_addressof (T &ref)
 
template<typename T , std::enable_if_t< has_overloaded_addressof< T >::value > * = nullptr>
T * opt_impl::static_addressof (T &ref)
 
template<typename U >
constexpr U opt_impl::convert (U v)
 
template<typename T >
void opt_impl::swap_ns::adl_swap (T &t, T &u) noexcept(noexcept(swap(t, u)))
 
template<typename T >
constexpr bool operator== (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator!= (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator< (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator> (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator<= (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator>= (const optional< T > &x, const optional< T > &y)
 
template<typename T >
constexpr bool operator== (const optional< T > &x, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator== (nullopt_t, const optional< T > &x) noexcept
 
template<typename T >
constexpr bool operator!= (const optional< T > &x, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator!= (nullopt_t, const optional< T > &x) noexcept
 
template<typename T >
constexpr bool operator< (const optional< T > &, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator< (nullopt_t, const optional< T > &x) noexcept
 
template<typename T >
constexpr bool operator<= (const optional< T > &x, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator<= (nullopt_t, const optional< T > &) noexcept
 
template<typename T >
constexpr bool operator> (const optional< T > &x, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator> (nullopt_t, const optional< T > &) noexcept
 
template<typename T >
constexpr bool operator>= (const optional< T > &, nullopt_t) noexcept
 
template<typename T >
constexpr bool operator>= (nullopt_t, const optional< T > &x) noexcept
 
template<typename T >
constexpr bool operator== (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator== (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator!= (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator!= (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator< (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator> (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator> (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator< (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator>= (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator<= (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator<= (const optional< T > &x, const T &v)
 
template<typename T >
constexpr bool operator>= (const T &v, const optional< T > &x)
 
template<typename T >
constexpr bool operator== (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator== (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator!= (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator!= (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator< (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator> (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator> (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator< (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator>= (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator<= (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator<= (const optional< T &> &x, const T &v)
 
template<typename T >
constexpr bool operator>= (const T &v, const optional< T &> &x)
 
template<typename T >
constexpr bool operator== (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator== (const T &v, const optional< const T &> &x)
 
template<typename T >
constexpr bool operator!= (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator!= (const T &v, const optional< const T &> &x)
 
template<typename T >
constexpr bool operator< (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator> (const T &v, const optional< const T &> &x)
 
template<typename T >
constexpr bool operator> (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator< (const T &v, const optional< const T &> &x)
 
template<typename T >
constexpr bool operator>= (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator<= (const T &v, const optional< const T &> &x)
 
template<typename T >
constexpr bool operator<= (const optional< const T &> &x, const T &v)
 
template<typename T >
constexpr bool operator>= (const T &v, const optional< const T &> &x)
 
template<typename T >
void swap (optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
 
template<typename T >
constexpr optional< std::decay_t< T > > make_optional (T &&v)
 

Variables

constexpr struct in_place_t in_place
 
constexpr nullopt_t nullopt {nullopt_t::init()}
 
constexpr struct opt_impl::trivial_init_t opt_impl::trivial_init
 

Function Documentation

◆ make_optional()

template<typename T >
constexpr optional<std::decay_t<T> > make_optional ( T &&  v)

Definition at line 822 of file optional.hh.

◆ operator!=() [1/9]

template<typename T >
constexpr bool operator!= ( const optional< T > &  x,
const optional< T > &  y 
)

Definition at line 509 of file optional.hh.

◆ operator!=() [2/9]

template<typename T >
constexpr bool operator!= ( const optional< T > &  x,
nullopt_t   
)
noexcept

Definition at line 552 of file optional.hh.

◆ operator!=() [3/9]

template<typename T >
constexpr bool operator!= ( nullopt_t  ,
const optional< T > &  x 
)
noexcept

Definition at line 558 of file optional.hh.

◆ operator!=() [4/9]

template<typename T >
constexpr bool operator!= ( const optional< T > &  x,
const T &  v 
)

Definition at line 622 of file optional.hh.

◆ operator!=() [5/9]

template<typename T >
constexpr bool operator!= ( const T &  v,
const optional< T > &  x 
)

Definition at line 627 of file optional.hh.

◆ operator!=() [6/9]

template<typename T >
constexpr bool operator!= ( const optional< T &> &  x,
const T &  v 
)

Definition at line 686 of file optional.hh.

◆ operator!=() [7/9]

template<typename T >
constexpr bool operator!= ( const T &  v,
const optional< T &> &  x 
)

Definition at line 692 of file optional.hh.

◆ operator!=() [8/9]

template<typename T >
constexpr bool operator!= ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 755 of file optional.hh.

◆ operator!=() [9/9]

template<typename T >
constexpr bool operator!= ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 761 of file optional.hh.

◆ operator<() [1/9]

template<typename T >
constexpr bool operator< ( const optional< T > &  x,
const optional< T > &  y 
)

Definition at line 515 of file optional.hh.

◆ operator<() [2/9]

template<typename T >
constexpr bool operator< ( const optional< T > &  ,
nullopt_t   
)
noexcept

Definition at line 564 of file optional.hh.

◆ operator<() [3/9]

template<typename T >
constexpr bool operator< ( nullopt_t  ,
const optional< T > &  x 
)
noexcept

Definition at line 570 of file optional.hh.

◆ operator<() [4/9]

template<typename T >
constexpr bool operator< ( const optional< T > &  x,
const T &  v 
)

Definition at line 632 of file optional.hh.

◆ operator<() [5/9]

template<typename T >
constexpr bool operator< ( const T &  v,
const optional< T > &  x 
)

Definition at line 647 of file optional.hh.

◆ operator<() [6/9]

template<typename T >
constexpr bool operator< ( const optional< T &> &  x,
const T &  v 
)

Definition at line 697 of file optional.hh.

◆ operator<() [7/9]

template<typename T >
constexpr bool operator< ( const T &  v,
const optional< T &> &  x 
)

Definition at line 712 of file optional.hh.

◆ operator<() [8/9]

template<typename T >
constexpr bool operator< ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 767 of file optional.hh.

◆ operator<() [9/9]

template<typename T >
constexpr bool operator< ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 785 of file optional.hh.

◆ operator<=() [1/9]

template<typename T >
constexpr bool operator<= ( const optional< T > &  x,
const optional< T > &  y 
)

Definition at line 527 of file optional.hh.

◆ operator<=() [2/9]

template<typename T >
constexpr bool operator<= ( const optional< T > &  x,
nullopt_t   
)
noexcept

Definition at line 576 of file optional.hh.

◆ operator<=() [3/9]

template<typename T >
constexpr bool operator<= ( nullopt_t  ,
const optional< T > &   
)
noexcept

Definition at line 582 of file optional.hh.

◆ operator<=() [4/9]

template<typename T >
constexpr bool operator<= ( const T &  v,
const optional< T > &  x 
)

Definition at line 657 of file optional.hh.

◆ operator<=() [5/9]

template<typename T >
constexpr bool operator<= ( const optional< T > &  x,
const T &  v 
)

Definition at line 662 of file optional.hh.

◆ operator<=() [6/9]

template<typename T >
constexpr bool operator<= ( const T &  v,
const optional< T &> &  x 
)

Definition at line 724 of file optional.hh.

◆ operator<=() [7/9]

template<typename T >
constexpr bool operator<= ( const optional< T &> &  x,
const T &  v 
)

Definition at line 730 of file optional.hh.

◆ operator<=() [8/9]

template<typename T >
constexpr bool operator<= ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 797 of file optional.hh.

◆ operator<=() [9/9]

template<typename T >
constexpr bool operator<= ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 803 of file optional.hh.

◆ operator==() [1/9]

template<typename T >
constexpr bool operator== ( const optional< T > &  x,
const optional< T > &  y 
)

◆ operator==() [2/9]

template<typename T >
constexpr bool operator== ( const optional< T > &  x,
nullopt_t   
)
noexcept

Definition at line 540 of file optional.hh.

◆ operator==() [3/9]

template<typename T >
constexpr bool operator== ( nullopt_t  ,
const optional< T > &  x 
)
noexcept

Definition at line 546 of file optional.hh.

◆ operator==() [4/9]

template<typename T >
constexpr bool operator== ( const optional< T > &  x,
const T &  v 
)

Definition at line 612 of file optional.hh.

◆ operator==() [5/9]

template<typename T >
constexpr bool operator== ( const T &  v,
const optional< T > &  x 
)

Definition at line 617 of file optional.hh.

◆ operator==() [6/9]

template<typename T >
constexpr bool operator== ( const optional< T &> &  x,
const T &  v 
)

Definition at line 674 of file optional.hh.

◆ operator==() [7/9]

template<typename T >
constexpr bool operator== ( const T &  v,
const optional< T &> &  x 
)

Definition at line 680 of file optional.hh.

◆ operator==() [8/9]

template<typename T >
constexpr bool operator== ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 743 of file optional.hh.

◆ operator==() [9/9]

template<typename T >
constexpr bool operator== ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 749 of file optional.hh.

◆ operator>() [1/9]

template<typename T >
constexpr bool operator> ( const optional< T > &  x,
const optional< T > &  y 
)

Definition at line 521 of file optional.hh.

◆ operator>() [2/9]

template<typename T >
constexpr bool operator> ( const optional< T > &  x,
nullopt_t   
)
noexcept

Definition at line 588 of file optional.hh.

◆ operator>() [3/9]

template<typename T >
constexpr bool operator> ( nullopt_t  ,
const optional< T > &   
)
noexcept

Definition at line 594 of file optional.hh.

◆ operator>() [4/9]

template<typename T >
constexpr bool operator> ( const T &  v,
const optional< T > &  x 
)

Definition at line 637 of file optional.hh.

◆ operator>() [5/9]

template<typename T >
constexpr bool operator> ( const optional< T > &  x,
const T &  v 
)

Definition at line 642 of file optional.hh.

◆ operator>() [6/9]

template<typename T >
constexpr bool operator> ( const T &  v,
const optional< T &> &  x 
)

Definition at line 702 of file optional.hh.

◆ operator>() [7/9]

template<typename T >
constexpr bool operator> ( const optional< T &> &  x,
const T &  v 
)

Definition at line 707 of file optional.hh.

◆ operator>() [8/9]

template<typename T >
constexpr bool operator> ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 773 of file optional.hh.

◆ operator>() [9/9]

template<typename T >
constexpr bool operator> ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 779 of file optional.hh.

◆ operator>=() [1/9]

template<typename T >
constexpr bool operator>= ( const optional< T > &  x,
const optional< T > &  y 
)

Definition at line 533 of file optional.hh.

◆ operator>=() [2/9]

template<typename T >
constexpr bool operator>= ( const optional< T > &  ,
nullopt_t   
)
noexcept

Definition at line 600 of file optional.hh.

◆ operator>=() [3/9]

template<typename T >
constexpr bool operator>= ( nullopt_t  ,
const optional< T > &  x 
)
noexcept

Definition at line 606 of file optional.hh.

◆ operator>=() [4/9]

template<typename T >
constexpr bool operator>= ( const optional< T > &  x,
const T &  v 
)

Definition at line 652 of file optional.hh.

◆ operator>=() [5/9]

template<typename T >
constexpr bool operator>= ( const T &  v,
const optional< T > &  x 
)

Definition at line 667 of file optional.hh.

◆ operator>=() [6/9]

template<typename T >
constexpr bool operator>= ( const optional< T &> &  x,
const T &  v 
)

Definition at line 718 of file optional.hh.

◆ operator>=() [7/9]

template<typename T >
constexpr bool operator>= ( const T &  v,
const optional< T &> &  x 
)

Definition at line 736 of file optional.hh.

◆ operator>=() [8/9]

template<typename T >
constexpr bool operator>= ( const optional< const T &> &  x,
const T &  v 
)

Definition at line 791 of file optional.hh.

◆ operator>=() [9/9]

template<typename T >
constexpr bool operator>= ( const T &  v,
const optional< const T &> &  x 
)

Definition at line 809 of file optional.hh.

◆ swap()

template<typename T >
void swap ( optional< T > &  x,
optional< T > &  y 
)
noexcept

Definition at line 816 of file optional.hh.

Referenced by opt_impl::swap_ns::adl_swap(), openmsx::calcEdgesGL(), openmsx::VDP::calculateLineBlinkState(), openmsx::ZMBVEncoder::compressFrame(), openmsx::EventDistributor::deliverEvents(), openmsx::PNG::load(), openmsx::FileBase::mmap(), openmsx::TTFFont::operator=(), gl::Texture::operator=(), openmsx::MemBuffer< char, SSE2_ALIGNMENT >::operator=(), SDLSurfacePtr::operator=(), openmsx::TclObject::operator=(), gl::FrameBufferObject::operator=(), gl::PixelBuffer< unsigned >::operator=(), gl::BufferObject::operator=(), openmsx::CommandLineParser::parse(), openmsx::InputEventGenerator::poll(), openmsx::Scale2xScaler< Pixel >::scale1x1to1x2(), openmsx::SaI2xScaler< Pixel >::scale1x1to1x2(), openmsx::Scale2xScaler< Pixel >::scale1x1to2x2(), openmsx::SaI2xScaler< Pixel >::scale1x1to2x2(), openmsx::Scale3xScaler< Pixel >::scale1x1to3x3(), openmsx::LineRepeater< 0 >::scaleFixedLine(), openmsx::SDLImage::SDLImage(), openmsx::Replay::serialize(), openmsx::ReverseManager::setReRecordCount(), SDLSurfacePtr::swap(), openmsx::MemBuffer< char, SSE2_ALIGNMENT >::swap(), circular_buffer< std::unique_ptr< openmsx::Frame > >::swap(), optional< std::array< GLint, 4 > >::swap(), openmsx::DBParser::text(), openmsx::VDPVRAM::updateVRMode(), openmsx::GLHQScaler::uploadBlock(), openmsx::GLHQLiteScaler::uploadBlock(), openmsx::V9990BitmapConverter< Pixel >::V9990BitmapConverter(), openmsx::MSXtar::~MSXtar(), and openmsx::ReverseManager::~ReverseManager().

Variable Documentation

◆ in_place

constexpr struct in_place_t in_place

◆ nullopt

constexpr nullopt_t nullopt {nullopt_t::init()}

Definition at line 37 of file optional.hh.