Brian Silverman | da86135 | 2019-02-02 16:42:28 -0800 | [diff] [blame] | 1 | #include "catch.hpp" |
2 | #include "optional.hpp" | ||||
3 | #include <utility> | ||||
4 | #include <tuple> | ||||
5 | |||||
6 | TEST_CASE("Emplace", "[emplace]") { | ||||
7 | tl::optional<std::pair<std::pair<int,int>, std::pair<double, double>>> i; | ||||
8 | i.emplace(std::piecewise_construct, std::make_tuple(0,2), std::make_tuple(3,4)); | ||||
9 | REQUIRE(i->first.first == 0); | ||||
10 | REQUIRE(i->first.second == 2); | ||||
11 | REQUIRE(i->second.first == 3); | ||||
12 | REQUIRE(i->second.second == 4); | ||||
13 | } |