File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -91,3 +91,21 @@ void TestFunctionalPlaceholdersArgumentValueCategories()
91
91
ASSERT_EQUAL (expr (::cuda::std::move (a), ::cuda::std::move (b)), 13 ); // pass x-value
92
92
}
93
93
DECLARE_UNITTEST (TestFunctionalPlaceholdersArgumentValueCategories);
94
+
95
+ void TestFunctionalPlaceholdersSemiRegular ()
96
+ {
97
+ using namespace thrust ::placeholders;
98
+ using Expr = decltype (_1 * _1 + _2 * _2);
99
+ Expr expr; // default-constructible
100
+ ASSERT_EQUAL (expr (2 , 3 ), 13 );
101
+ Expr expr2 = expr; // copy-constructible
102
+ ASSERT_EQUAL (expr2 (2 , 3 ), 13 );
103
+ Expr expr3;
104
+ expr3 = expr; // copy-assignable
105
+ ASSERT_EQUAL (expr3 (2 , 3 ), 13 );
106
+
107
+ #if _CCCL_STD_VER >= 2014
108
+ static_assert (::cuda::std::semiregular<Expr>, " " );
109
+ #endif // _CCCL_STD_VER >= 2014
110
+ }
111
+ DECLARE_UNITTEST (TestFunctionalPlaceholdersSemiRegular);
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ struct composite;
102
102
template <typename Eval, typename SubExpr>
103
103
struct composite <Eval, SubExpr>
104
104
{
105
+ constexpr composite () = default;
106
+
105
107
// TODO(bgruber): drop ctor and use aggregate initialization in C++17
106
108
_CCCL_HOST_DEVICE composite (const Eval& eval, const SubExpr& subexpr)
107
109
: m_eval(eval)
@@ -123,6 +125,8 @@ struct composite<Eval, SubExpr>
123
125
template <typename Eval, typename SubExpr1, typename SubExpr2>
124
126
struct composite <Eval, SubExpr1, SubExpr2>
125
127
{
128
+ constexpr composite () = default;
129
+
126
130
// TODO(bgruber): drop ctor and use aggregate initialization in C++17
127
131
_CCCL_HOST_DEVICE composite (const Eval& eval, const SubExpr1& subexpr1, const SubExpr2& subexpr2)
128
132
: m_eval(eval)
@@ -151,6 +155,8 @@ struct actor;
151
155
template <typename F>
152
156
struct operator_adaptor : F
153
157
{
158
+ constexpr operator_adaptor () = default;
159
+
154
160
_CCCL_HOST_DEVICE operator_adaptor (F f)
155
161
: F(::cuda::std::move(f))
156
162
{}
You can’t perform that action at this time.
0 commit comments