@@ -85,3 +85,33 @@ TEST(LazySegtreeTest, Usage) {
8585 ASSERT_EQ (-5 , seg.prod (2 , 3 ));
8686 ASSERT_EQ (0 , seg.prod (2 , 4 ));
8787}
88+
89+ #if __cplusplus >= 201703L
90+
91+ int op_const (const int & a, const int & b) { return std::max (a, b); }
92+
93+ struct const_starry {
94+ static int op_ss (const int & a, const int & b) { return std::max (a, b); }
95+ static int op_ts (const int & a, const int & b) { return a + b; }
96+ static int op_tt (const int & a, const int & b) { return a + b; }
97+ };
98+
99+ TEST (SegtreeTest, ConstFunc) {
100+ lazy_segtree<int , const_starry::op_ss, starry::e_s, int ,
101+ const_starry::op_ts, const_starry::op_tt, starry::e_t >
102+ seg (10 );
103+ }
104+
105+ #endif
106+
107+ #if __cplusplus >= 202002L
108+
109+ TEST (LazySegtreeTest, LambdaFunc) {
110+ lazy_segtree<int , [](int a, int b) { return std::max (a, b); },
111+ []() { return -1'000'000'000 ; }, int ,
112+ [](int a, int b) { return a + b; },
113+ [](int a, int b) { return a + b; }, []() { return 0 ; }>
114+ seg (10 );
115+ }
116+
117+ #endif
0 commit comments