// { dg-do compile { target c++26 } } #include #include #include #include #include #if !defined(__cpp_lib_algorithm_default_value_type) #error "Feature test macro for default template type for algorithms' values is missing" #elif __cpp_lib_algorithm_default_value_type < 202403L #error "Feature test macro for default template type for algorithms' values is wrong" #endif struct S { S(int, double); friend auto operator<=>(const S&, const S&) = default; }; template typename Container> void test_erase() { Container c; std::erase(c, {1, 3.14}); } void test() { test_erase(); test_erase(); test_erase(); test_erase(); std::string s; std::erase(s, {'x'}); std::wstring ws; std::erase(ws, {L'x'}); }