2019-09-16 23:56:02 -07:00
|
|
|
#include <catch2/catch.hpp>
|
2019-05-01 13:23:30 +01:00
|
|
|
#include <tl/optional.hpp>
|
2018-07-11 14:32:25 +01:00
|
|
|
#include <utility>
|
|
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
|
|
TEST_CASE("Emplace", "[emplace]") {
|
|
|
|
|
tl::optional<std::pair<std::pair<int,int>, std::pair<double, double>>> i;
|
|
|
|
|
i.emplace(std::piecewise_construct, std::make_tuple(0,2), std::make_tuple(3,4));
|
|
|
|
|
REQUIRE(i->first.first == 0);
|
|
|
|
|
REQUIRE(i->first.second == 2);
|
|
|
|
|
REQUIRE(i->second.first == 3);
|
|
|
|
|
REQUIRE(i->second.second == 4);
|
|
|
|
|
}
|