1f8457a07SMarshall Clow //===----------------------------------------------------------------------===//
2f8457a07SMarshall Clow //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6f8457a07SMarshall Clow //
7f8457a07SMarshall Clow //===----------------------------------------------------------------------===//
8f8457a07SMarshall Clow //
931cbe0f2SLouis Dionne // XFAIL: c++03, c++11
10f8457a07SMarshall Clow
11f8457a07SMarshall Clow // <map>
12f8457a07SMarshall Clow
13f8457a07SMarshall Clow // class map
14f8457a07SMarshall Clow
15*cd854e68SMarek Kurdej // pair<iterator,iterator> equal_range(const key_type& k);
16*cd854e68SMarek Kurdej // pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
17f8457a07SMarshall Clow //
18f8457a07SMarshall Clow // The member function templates find, count, lower_bound, upper_bound, and
19f8457a07SMarshall Clow // equal_range shall not participate in overload resolution unless the
20f8457a07SMarshall Clow // qualified-id Compare::is_transparent is valid and denotes a type
21f8457a07SMarshall Clow
22f8457a07SMarshall Clow
23f8457a07SMarshall Clow #include <map>
24f8457a07SMarshall Clow #include <cassert>
25f8457a07SMarshall Clow
267fc6a556SMarshall Clow #include "test_macros.h"
27f8457a07SMarshall Clow #include "is_transparent.h"
28f8457a07SMarshall Clow
main(int,char **)292df59c50SJF Bastien int main(int, char**)
30f8457a07SMarshall Clow {
31b707e7f3SMarshall Clow {
32f8457a07SMarshall Clow typedef std::map<int, double, transparent_less> M;
3383252766SBilly Robert O'Neal III typedef std::pair<typename M::iterator, typename M::iterator> P;
3483252766SBilly Robert O'Neal III M example;
3583252766SBilly Robert O'Neal III P result = example.equal_range(C2Int{5});
3683252766SBilly Robert O'Neal III assert(result.first == result.second);
37f8457a07SMarshall Clow }
38b707e7f3SMarshall Clow {
39b707e7f3SMarshall Clow typedef std::map<int, double, transparent_less_not_referenceable> M;
4083252766SBilly Robert O'Neal III typedef std::pair<typename M::iterator, typename M::iterator> P;
4183252766SBilly Robert O'Neal III M example;
4283252766SBilly Robert O'Neal III P result = example.equal_range(C2Int{5});
4383252766SBilly Robert O'Neal III assert(result.first == result.second);
44b707e7f3SMarshall Clow }
452df59c50SJF Bastien
462df59c50SJF Bastien return 0;
47b707e7f3SMarshall Clow }
48