variant icon indicating copy to clipboard operation
variant copied to clipboard

C++11/C++14 Variant

Results 34 variant issues
Sort by recently updated
recently updated
newest added

Running `make test` with gcc 7.0.1 fails due to new aliasing warnings, promoted to errors by the `-Werror` switch in the makefile: ``` g++ -c -o out/binary_visitor_1.o test/t/binary_visitor_1.cpp -Iinclude -isystem...

I created a Visual Studio Native Visualizer file for variant. This file enable the debugger to view the value in a variant variable. There are two files here: 1. Variant.natvis...

#include #include #include using namespace std; using namespace mapbox::util; // Forward declaration struct HPArray; struct HPTable; using HPVariant = variant; struct HPArray{ template HPArray(Args ...args){ values.emplace(std::forward(args)...); } unordered_map values; };...

The copy constructor only actually compiles when all member types are copyable, as it should. However, when checking whether the variant type is copy-constructible via SFINAE, e.g. with `std::is_copy_constructible`, you...

Code style and ".clang-format" file don't match. We need to change "AccessModifierOffset" option to -4, or change offset in files.

``` out/recursive_wrapper_test 321000000 TYPE OF RESULT-> TYPE_ID=N4test9binary_opINS_3subEEE 1542000us total=321000000 2+3-4=1 ----- sum of 1000 ones ----- construction 57397us calculation 7377us total=1000000 ----- sum of 5000 ones ----- construction 1485368us calculation...

It is simpler to design `recursive_wrapper` as "wrapper" over ready-to-use to RAII `std::unique_ptr`. Just add value semantics ([example](https://github.com/tomilov/variant/blob/master/include/versatile/recursive_wrapper.hpp)).

enhancement

My understanding is that calling `sizeof` on a variant should produce the size of the largest type the variant includes. And my assumption is that `sizeof` for a given type...

See for instance https://travis-ci.org/mapbox/variant/jobs/188957587 . You have to expand the "after_script" to see this. The job itself doesn't fail, though. Protozero has the same problem with Python, but in that...

Our implementation of variant allows access via `get()` even if the type appears several times in the variant. This can be potentially confusing and error prone, especially when type aliasing...

question