File: emplace.cpp

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,488 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (13 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "catch.hpp"
#include "optional.hpp"
#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);    
}