A library for working with phylogenetic and population genetic data.
v0.27.0
optional.hpp File Reference
#include <cassert>
#include <stdexcept>

Go to the source code of this file.

Classes

class  BadOptionalAccess
 Optional access error for empty values. More...
 
struct  nullopt_t
 Type for nullopt. More...
 
struct  nullopt_t::init
 
class  Optional< T >
 Simplistic optional: requires T to be default constructible, copyable. More...
 

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Macros

#define GENESIS_OPTIONAL_CPLUSPLUS   __cplusplus
 
#define GENESIS_OPTIONAL_HAVE_STD_OPTIONAL   0
 
#define GENESIS_OPTIONAL_USES_STD_OPTIONAL   GENESIS_OPTIONAL_HAVE_STD_OPTIONAL
 

Functions

template<typename T >
Optional< T > make_optional (T const &v)
 Convenience function to create an Optional. More...
 
template<typename T >
bool operator!= (nullopt_t, Optional< T > const &x)
 
template<typename T >
bool operator!= (Optional< T > const &x, nullopt_t)
 
template<typename T , typename U >
bool operator!= (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator!= (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator!= (U const &v, Optional< T > const &x)
 
template<typename T >
bool operator< (nullopt_t, Optional< T > const &x)
 
template<typename T >
bool operator< (Optional< T > const &, nullopt_t)
 
template<typename T , typename U >
bool operator< (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator< (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator< (U const &v, Optional< T > const &x)
 
template<typename T >
bool operator<= (nullopt_t, Optional< T > const &)
 
template<typename T >
bool operator<= (Optional< T > const &x, nullopt_t)
 
template<typename T , typename U >
bool operator<= (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator<= (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator<= (U const &v, Optional< T > const &x)
 
template<typename T >
bool operator== (nullopt_t, Optional< T > const &x)
 
template<typename T >
bool operator== (Optional< T > const &x, nullopt_t)
 
template<typename T , typename U >
bool operator== (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator== (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator== (U const &v, Optional< T > const &x)
 
template<typename T >
bool operator> (nullopt_t, Optional< T > const &)
 
template<typename T >
bool operator> (Optional< T > const &x, nullopt_t)
 
template<typename T , typename U >
bool operator> (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator> (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator> (U const &v, Optional< T > const &x)
 
template<typename T >
bool operator>= (nullopt_t, Optional< T > const &x)
 
template<typename T >
bool operator>= (Optional< T > const &, nullopt_t)
 
template<typename T , typename U >
bool operator>= (Optional< T > const &x, Optional< U > const &y)
 
template<typename T , typename U >
bool operator>= (Optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator>= (U const &v, Optional< T > const &x)
 
template<typename T >
void swap (Optional< T > &x, Optional< T > &y)
 

Variables

const nullopt_t nullopt ((nullopt_t::init()))
 Optional to indicate an empty value. More...
 

Macro Definition Documentation

◆ GENESIS_OPTIONAL_CPLUSPLUS

#define GENESIS_OPTIONAL_CPLUSPLUS   __cplusplus

Definition at line 77 of file optional.hpp.

◆ GENESIS_OPTIONAL_HAVE_STD_OPTIONAL

#define GENESIS_OPTIONAL_HAVE_STD_OPTIONAL   0

Definition at line 89 of file optional.hpp.

◆ GENESIS_OPTIONAL_USES_STD_OPTIONAL

#define GENESIS_OPTIONAL_USES_STD_OPTIONAL   GENESIS_OPTIONAL_HAVE_STD_OPTIONAL

Definition at line 95 of file optional.hpp.