Eggs.Variant is a C++11/14 generic, type-safe, discriminated union.
C++ CMake
Latest commit 5395915 Jan 15, 2017 @K-ballo K-ballo Poisoning the hash



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


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 is continuously tested with the following configurations: Build Status Build Status

  • Clang 3.6, 3.7, 3.8
  • GCC 4.9, 5, 6
  • Apple LLVM 7.0
  • MSVC 2013, 2015

[Note: Older versions of Clang (3.0+) and GCC (4.6+) are no longer tested, but should still work; please report any issues if you are using them. Older versions of MSVC are not supported.]

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-2017

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at