General Utility Library for C++14  2.11
Classes | Namespaces | Functions
variant.h File Reference

Detailed Description

Definition of the variant class template and associated functions and types.

Authors
Michael Park, (modifications for GUL14) Lars Froehlich

This header file provides a gul14::variant with the same API as C++17's std::variant. It is based on version 1.4.0 of the variant library by Michael Park (https://github.com/mpark/variant). Multiple header files from the original source have been merged into this single file, and multiple conditional compilation blocks have been removed because GUL14 does not support pre-C++14 compilers.

#include <cstddef>
#include <exception>
#include <functional>
#include <initializer_list>
#include <limits>
#include <new>
#include <type_traits>
#include <utility>
#include "gul14/internal.h"
#include "gul14/traits.h"
#include "gul14/utility.h"
Include dependency graph for variant.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gul14::bad_variant_access
 The exception thrown if the wrong type is accessed on a gul14::variant. More...
 
struct  gul14::OverloadSet< Fct1, Fcts >
 A function object that works like an overload set of functions. More...
 
struct  gul14::OverloadSet< Fct1 >
 OverloadSet for a single function object. More...
 

Namespaces

 gul14
 Namespace gul14 contains all functions and classes of the General Utility Library.
 

Functions

template<typename Visitor , typename... Variants>
constexpr decltype(auto) gul14::visit (Visitor &&visitor_fct, Variants &&... variants)
 Call a visitor function with the actual objects stored in the given variants. More...
 
template<typename... Fct>
auto gul14::make_overload_set (Fct... f)
 Create an OverloadSet from an arbitrary number of function objects. More...