brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 57ce933 Raw
53 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// XFAIL: c++03, c++1110 11// <map>12 13// class map14 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, and19// equal_range shall not participate in overload resolution unless the20// qualified-id Compare::is_transparent is valid and denotes a type21 22#include <map>23#include <cassert>24 25#include "test_macros.h"26#include "is_transparent.h"27 28int main(int, char**) {29  {30    typedef std::map<int, double, transparent_less> M;31    typedef std::pair<typename M::iterator, typename M::iterator> P;32    M example;33    P result = example.equal_range(C2Int{5});34    assert(result.first == result.second);35  }36  {37    typedef std::map<int, double, transparent_less_not_referenceable> M;38    typedef std::pair<typename M::iterator, typename M::iterator> P;39    M example;40    P result = example.equal_range(C2Int{5});41    assert(result.first == result.second);42  }43  {44    using M = std::map<int, double, transparent_less_nonempty>;45    using P = std::pair<typename M::iterator, typename M::iterator>;46    M example;47    P result = example.equal_range(C2Int{5});48    assert(result.first == result.second);49  }50 51  return 0;52}53