MCPcopy Create free account
hub / github.com/ConorWilliams/libfork / test_value

Function test_value

test/source/core/eventually.cpp:41–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <typename T, bool Exception>
41void test_value() {
42 eventually<T> even;
43
44 REQUIRE(!even.has_value());
45
46 std::remove_reference_t<T> val = {};
47 std::remove_reference_t<T> copy = val;
48
49 if constexpr (std::is_rvalue_reference_v<T>) {
50 even = std::move(copy);
51 } else {
52 even = copy;
53 }
54
55 REQUIRE(even.has_value());
56 REQUIRE(*even == val);
57}
58
59} // namespace
60

Callers

nothing calls this directly

Calls 1

has_valueMethod · 0.45

Tested by

no test coverage detected