/variant

Eggs.Variant is a C++11/14 generic, type-safe, discriminated union.

Primary LanguageC++Boost Software License 1.0BSL-1.0

Eggs.Variant

Introduction

Eggs.Variant is a C++11/14 generic, type-safe, discriminated union. See the documentation at http://eggs-cpp.github.io/variant/.

Requirements

The library requires a standard conformant implementation of C++11; a few additional features are only available under C++14. Some effort was done to support incomplete language or standard library implementations —see Config —. There are no external dependencies.

The library was successfully tested with the following configurations [*]:

  • Clang 3.3, 3.4 (both with libc++ and libstdc++)
  • GCC 4.8, 4.9
  • MSVC 2013

[*] Only Clang with libc++ implement enough functionality to support every feature of the library.

Future Work

The following is an incomplete list of pending functionality to be implemented:

  • Explicit control over the type of the discriminator, introduced via a basic_variant class template.

  • Layout optimization. Requires even more flavors of special storage.


Copyright Agustín Bergé, Fusion Fenix 2014-2015

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)