mirror of
https://github.com/TartanLlama/optional.git
synced 2025-10-04 17:00:54 +02:00
17 lines
367 B
C++
17 lines
367 B
C++
#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);
|
|
}
|