This repository contains a never-valueless, strong guarantee, C++11/14/17 implementation of std::variant. See the documentation for more information.
The code requires Boost.Mp11 and Boost.Config.
The repository is intended to be placed into the libs/variant2 directory of
a Boost clone or release, but the header variant.hpp will also work
standalone.
Supported compilers:
-std=c++11 or above-std=c++11 or above<h1>variant2</h1> <p>This repository contains a never-valueless, strong guarantee, C++11/14/17 implementation of <a href="http://en.cppreference.com/w/cpp/utility/variant">std::variant</a>. See <a href="https://www.boost.org/doc/libs/master/libs/variant2/">the documentation</a> for more information.</p> <p>The code requires <a href="https://github.com/boostorg/mp11">Boost.Mp11</a> and Boost.Config.</p> <p>The repository is intended to be placed into the <code>libs/variant2</code> directory of a Boost clone or release, but the header <code>variant.hpp</code> will also work <a href="https://godbolt.org/z/nVUNKX">standalone</a>.</p> <p>Supported compilers:</p> <ul> <li>g++ 4.8 or later with <code>-std=c++11</code> or above</li> <li>clang++ 3.5 or later with <code>-std=c++11</code> or above</li> <li>Visual Studio 2015, 2017, 2019</li> </ul> <p>Tested on <a href="https://travis-ci.org/boostorg/variant2/">Travis</a> and <a href="https://ci.appveyor.com/project/pdimov/variant2/">Appveyor</a>.</p>
<h1>variant2</h1> <p>This repository contains a never-valueless, strong guarantee, C++11/14/17 implementation of <a href="http://en.cppreference.com/w/cpp/utility/variant">std::variant</a>. See <a href="https://www.boost.org/doc/libs/master/libs/variant2/">the documentation</a> for more information.</p> <p>The code requires <a href="https://github.com/boostorg/mp11">Boost.Mp11</a> and Boost.Config.</p> <p>The repository is intended to be placed into the <code>libs/variant2</code> directory of a Boost clone or release, but the header <code>variant.hpp</code> will also work <a href="https://godbolt.org/z/nVUNKX">standalone</a>.</p> <p>Supported compilers:</p> <ul> <li>g++ 4.8 or later with <code>-std=c++11</code> or above</li> <li>clang++ 3.5 or later with <code>-std=c++11</code> or above</li> <li>Visual Studio 2015, 2017, 2019</li> </ul> <p>Tested on <a href="https://travis-ci.org/boostorg/variant2/">Travis</a> and <a href="https://ci.appveyor.com/project/pdimov/variant2/">Appveyor</a>.</p>