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 library is part of Boost, starting from release 1.71, 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/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 library is part of Boost, starting from release 1.71, 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-fkab9">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/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 library is part of Boost, starting from release 1.71, 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-fkab9">Appveyor</a>.</p>