osrm-backend/test/compilation_failure/default_constructor.cpp
Patrick Niklaus 62e8601919 Squashed 'third_party/variant/' content from commit b585021
git-subtree-dir: third_party/variant
git-subtree-split: b5850212f16efeb409a112edb1e719d5f5edb604
2016-03-24 21:32:27 +01:00

23 lines
446 B
C++

// @EXPECTED: First type in variant must be default constructible to allow default construction of variant
#include <variant.hpp>
// Checks that the first type in a variant must be default constructible to
// make the variant default constructible.
struct no_def_constructor
{
int value;
no_def_constructor() = delete;
no_def_constructor(int v) : value(v) {}
};
int main()
{
mapbox::util::variant<no_def_constructor> x;
}