Skip to content

Commit

Permalink
add default ctor test
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Jun 12, 2014
1 parent 4d038f1 commit d7fa62b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ TEST_CASE( "variant type traits", "[variant::detail]" ) {
}


TEST_CASE( "variant default constructor", "variant()" ) {
// By default variant is initilised with (default constructed) first type in template parameters pack
// As a reusult first type in Types... must be defaul constructable
REQUIRE((util::variant<int, double, std::string>().get_type_index() == 0));
}

int main (int argc, char* const argv[])
{
int result = Catch::Session().run( argc, argv );
Expand Down

0 comments on commit d7fa62b

Please sign in to comment.