File: nullopt.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 (16 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "catch.hpp"
#include "optional.hpp"

TEST_CASE("Nullopt", "[nullopt]") {
  tl::optional<int> o1 = tl::nullopt;
  tl::optional<int> o2{tl::nullopt};
  tl::optional<int> o3(tl::nullopt);
  tl::optional<int> o4 = {tl::nullopt};

  REQUIRE(!o1);
  REQUIRE(!o2);
  REQUIRE(!o3);
  REQUIRE(!o4);

  REQUIRE(!std::is_default_constructible<tl::nullopt_t>::value);
}