[PR c++/84492] stmt expr ending with overload
[official-gcc.git] / libstdc++-v3 / testsuite / backward / hash_set / 49060.cc
blob985cfcf6afdb76584829ffafaa5ae9c7e2604d01
1 // { dg-options "-Wno-deprecated" }
3 #include <backward/hashtable.h>
4 #include <utility>
6 struct modulo2_hash
8 size_t operator()(int const key) const
10 return key % 2;
14 struct modulo2_eq
16 bool operator()(int const left, int const right) const
18 return left % 2 == right % 2;
22 int main()
24 typedef std::_Select1st<std::pair<int const, int> > extract_type;
25 typedef
26 __gnu_cxx::hashtable<std::pair<int const, int>, int, modulo2_hash,
27 extract_type, modulo2_eq, std::allocator<int> >
28 table_type;
29 table_type table(4, modulo2_hash(), modulo2_eq(), extract_type(),
30 std::allocator<int>());
32 table.insert_equal(std::make_pair(2, 1));
33 table_type::iterator it(table.insert_equal(std::make_pair(4, 2)));
34 table.erase(it->first);