11#include <catch2/catch.hpp>
24 explicit X(
int value) : member{ value } {}
25 explicit X(
int value, std::shared_ptr<X>) : member{ value } {}
63 REQUIRE(p1->member == 0);
65 REQUIRE(p2->member == 1);
68 auto p3 = f4(2, move(p2));
69 REQUIRE(p3->member == 2);
75 REQUIRE(p1->member == 0);
77 REQUIRE(p2->member == 1);
80 TakesNonTypeParameter<f1> t1{};
81 TakesNonTypeParameter<f2> t2{};
96 REQUIRE(p1->member == 0);
98 REQUIRE(p2->member == 1);
101 auto p3 = f4(2, move(p2));
102 REQUIRE(p3->member == 2);
108 REQUIRE(p1->member == 0);
110 REQUIRE(p2->member == 1);
113 TakesNonTypeParameter<f1> t1{};
114 TakesNonTypeParameter<f2> t2{};
131 TakesNonTypeParameter<f1> t1{};
132 TakesNonTypeParameter<f2> t2{};
138 constexpr auto f1 = UniqueMaker<X>();
139 constexpr auto f2 = UniqueMaker<X, int>();
143 UniqueMaker<X, int, std::shared_ptr<X>>();
147 REQUIRE(p1->member == 0);
149 REQUIRE(p2->member == 1);
152 auto p3 = f4(2, move(p2));
153 REQUIRE(p3->member == 2);
164 REQUIRE(p1->member == 0);
166 REQUIRE(p2->member == 1);
Functions and classes that generate callable objects.
Generates functions useable as non-type template parameters.
Generates functions useable as non-type template parameters.
Generates functions useable as non-type template parameters.
int & operator()(std::monostate) const
X(int value, std::shared_ptr< X >)