File: issue122.cpp

package info (click to toggle)
mapbox-variant 1.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,648 kB
  • sloc: cpp: 31,068; ansic: 959; python: 424; makefile: 145; objc: 59; sh: 36
file content (20 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "catch.hpp"

#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

// https://github.com/mapbox/variant/issues/122

struct X
{
    template <typename ValueType>
    X(const ValueType&)  {}
};


TEST_CASE("Correctly choose appropriate constructor", "[variant]")
{
    mapbox::util::variant<X, int> a{123};
    decltype(a) b(a);
    REQUIRE(a.which() == b.which());
}