RISC-V: Make FRM as global register [PR118103]
[gcc.git] / libstdc++-v3 / testsuite / 23_containers / default_template_value.cc
blobb7615032686df58f8ebce338ef4ce6b6b68037bc
1 // { dg-do compile { target c++26 } }
3 #include <deque>
4 #include <forward_list>
5 #include <list>
6 #include <string>
7 #include <vector>
9 #if !defined(__cpp_lib_algorithm_default_value_type)
10 #error "Feature test macro for default template type for algorithms' values is missing"
11 #elif __cpp_lib_algorithm_default_value_type < 202403L
12 #error "Feature test macro for default template type for algorithms' values is wrong"
13 #endif
15 struct S {
16 S(int, double);
17 friend auto operator<=>(const S&, const S&) = default;
20 template<template<typename...> typename Container>
21 void test_erase()
23 Container<S> c;
24 std::erase(c, {1, 3.14});
27 void
28 test()
30 test_erase<std::deque>();
31 test_erase<std::forward_list>();
32 test_erase<std::list>();
33 test_erase<std::vector>();
35 std::string s;
36 std::erase(s, {'x'});
38 std::wstring ws;
39 std::erase(ws, {L'x'});