]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/23_containers/unordered_multimap/operators/2.cc
1 // { dg-do run { target c++11 } }
3 // 2010-03-25 Paolo Carlini <paolo.carlini@oracle.com>
5 // Copyright (C) 2010-2019 Free Software Foundation, Inc.
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
22 #include <unordered_map>
24 #include <testsuite_hooks.h>
28 typedef std::pair
<const int, int> Pair
;
29 std::unordered_multimap
<int, int> umm1
, umm2
;
30 VERIFY( umm1
== umm2
);
31 VERIFY( !(umm1
!= umm2
) );
33 int second1
[] = { -1, -2, -3, -4, -5 };
34 int second2
[] = { -1, -2, -3, -4, -5 };
35 const unsigned size
= sizeof(second1
) / sizeof(int);
37 for (unsigned perm1
= 0; perm1
< 120; ++perm1
)
40 std::next_permutation(second1
, second1
+ size
);
41 for (unsigned i1
= 0; i1
< size
; ++i1
)
42 umm1
.insert(Pair(0, second1
[i1
]));
44 for (unsigned perm2
= 0; perm2
< 120; ++perm2
)
47 std::next_permutation(second2
, second2
+ size
);
48 for (unsigned i2
= 0; i2
< size
; ++i2
)
49 umm2
.insert(Pair(0, second2
[i2
]));
51 VERIFY( umm1
== umm2
);
52 VERIFY( !(umm1
!= umm2
) );