Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Namespaces | Typedefs | Functions | Variables
optional.h File Reference

Container to hold optional data. More...

#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include "./base.h"
#include "./common.h"
#include "./logging.h"
#include "./type_traits.h"

Go to the source code of this file.

Data Structures

struct  dmlc::nullopt_t
 dummy type for assign null to optional More...
 
struct  dmlc::in_place_t
 disambiguation tags that can be passed to the constructors of dmlc::optional. A tag type to tell constructor to construct its value in-place More...
 
class  dmlc::optional< T >
 Is not constructible or convertible from any expression of type (possibly const) dmlc::optional<U>, i.e., the following 8 type traits are all false: Link: https://en.cppreference.com/w/cpp/utility/optional/optional. More...
 

Namespaces

namespace  dmlc
 namespace for dmlc
 
namespace  std
 

Typedefs

template<typename T >
using dmlc::decay_t = typename std::decay< T >::type
 C++14 aliases.
 
template<bool B, typename T = void>
using dmlc::enable_if_t = typename std::enable_if< B, T >::type
 
template<typename T , typename U , typename Other >
using dmlc::enable_constructor_from_other = enable_if_t< std::is_constructible< T, Other >::value &&!std::is_constructible< T, optional< U > & >::value &&!std::is_constructible< T, optional< U > && >::value &&!std::is_convertible< optional< U > &, T >::value &&!std::is_convertible< optional< U > &&, T >::value &&!std::is_constructible< T, const optional< U > & >::value &&!std::is_constructible< T, const optional< U > && >::value &&!std::is_convertible< const optional< U > &, T >::value &&!std::is_convertible< const optional< U > &&, T >::value >
 
template<typename T , typename U >
using dmlc::enable_constructor_from_value = enable_if_t< std::is_constructible< T, U && >::value &&!std::is_same< decay_t< U >, in_place_t >::value &&!std::is_same< optional< T >, decay_t< U > >::value >
 

Functions

template<typename T >
std::ostream & dmlc::operator<< (std::ostream &os, const optional< T > &t)
 serialize an optional object to string.
 
template<typename T >
std::istream & dmlc::operator>> (std::istream &is, optional< T > &t)
 parse a string object into optional<T>
 
std::istream & dmlc::operator>> (std::istream &is, optional< bool > &t)
 specialization of '>>' istream parsing for optional<bool>
 
 dmlc::DMLC_DECLARE_TYPE_NAME (optional< int >, "int or None")
 description for optional int
 
 dmlc::DMLC_DECLARE_TYPE_NAME (optional< bool >, "boolean or None")
 description for optional bool
 
 dmlc::DMLC_DECLARE_TYPE_NAME (optional< float >, "float or None")
 description for optional float
 
 dmlc::DMLC_DECLARE_TYPE_NAME (optional< double >, "double or None")
 description for optional double
 

Variables

constexpr const nullopt_t dmlc::nullopt = nullopt_t(0)
 

Detailed Description

Container to hold optional data.

Copyright (c) 2016 by Contributors