osrm-backend/third_party/variant
2015-11-03 21:56:26 -08:00
..
scripts Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
test Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
.gitignore Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
.travis.yml Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
appveyor.yml Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
common.gypi Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
Jamroot Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
LICENSE Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
Makefile upgrade variant dependency 2015-03-04 12:48:19 +01:00
optional.hpp Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
README.md upgrade variant dependency 2015-03-04 12:48:19 +01:00
recursive_wrapper.hpp Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
variant_io.hpp Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
variant.gyp Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00
variant.hpp Update variant to 91ba0301a672ea0a3131390d44d304c5493de84a, specifically this commit: 39a631394e, which fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68073 under GCC 5.2.1. 2015-11-03 21:56:26 -08:00
vcbuild.bat Merge commit '884c9986229d4228374959265905cfd7b7c90c08' as 'third_party/variant' 2015-02-09 15:19:35 +01:00

Mapbox Variant

An alternative to boost::variant for C++11.

Build Status Build status Coverage Status

Why use Mapbox Variant?

Mapbox variant has the same speedy performance of boost::variant but is faster to compile, results in smaller binaries, and has no dependencies.

For example on OS X 10.9 with clang++ and libc++:

Test Mapbox Variant Boost Variant
Size of pre-compiled header (release / debug) 2.8/2.8 MB 12/15 MB
Size of simple program linking variant (release / debug) 8/24 K 12/40 K
Time to compile header 185 ms 675 ms

Depends

  • Compiler supporting -std=c++11

Tested with

  • g++-4.7
  • g++-4.8
  • clang++-3.4
  • clang++-3.5
  • Visual C++ Compiler November 2013 CTP
  • Visual C++ Compiler 2014 CTP 4

Note: get the "2013 Nov CTP" release at http://www.microsoft.com/en-us/download/details.aspx?id=41151 and the 2014 CTP at http://www.visualstudio.com/en-us/downloads/visual-studio-14-ctp-vs.aspx

Usage

There is nothing to build, just include variant.hpp and recursive_wrapper.hpp in your project.

Tests

The tests depend on:

  • Boost headers (for benchmarking against boost::variant)
  • Boost built with --with-timer (used for benchmark timing)

On Unix systems set your boost includes and libs locations and run make test:

export LDFLAGS='-L/opt/boost/lib'
export CXXFLAGS='-I/opt/boost/include'
make test

On windows do:

vcbuild

Benchmark

On Unix systems run the benchmark like:

make bench

Check object sizes

make sizes /path/to/boost/variant.hpp