llvm-project
47 строк · 1.4 Кб
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// XFAIL: c++03, c++11
10
11// <map>
12
13// class map
14
15// pair<iterator,iterator> equal_range(const key_type& k);
16// pair<const_iterator,const_iterator> equal_range(const key_type& k) const;
17//
18// The member function templates find, count, lower_bound, upper_bound, and
19// equal_range shall not participate in overload resolution unless the
20// qualified-id Compare::is_transparent is valid and denotes a type
21
22
23#include <map>24#include <cassert>25
26#include "test_macros.h"27#include "is_transparent.h"28
29int main(int, char**)30{
31{32typedef std::map<int, double, transparent_less> M;33typedef std::pair<typename M::iterator, typename M::iterator> P;34M example;35P result = example.equal_range(C2Int{5});36assert(result.first == result.second);37}38{39typedef std::map<int, double, transparent_less_not_referenceable> M;40typedef std::pair<typename M::iterator, typename M::iterator> P;41M example;42P result = example.equal_range(C2Int{5});43assert(result.first == result.second);44}45
46return 0;47}
48