brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 62491e2 Raw
43 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// size_type count(const key_type& k) const;16//17//   The member function templates find, count, lower_bound, upper_bound, and18// equal_range shall not participate in overload resolution unless the19// qualified-id Compare::is_transparent is valid and denotes a type20 21#include <map>22#include <cassert>23 24#include "test_macros.h"25#include "is_transparent.h"26 27int main(int, char**) {28  {29    typedef std::map<int, double, transparent_less> M;30    assert(M().count(C2Int{5}) == 0);31  }32  {33    typedef std::map<int, double, transparent_less_not_referenceable> M;34    assert(M().count(C2Int{5}) == 0);35  }36  {37    using M = std::map<int, double, transparent_less_nonempty>;38    assert(M().count(C2Int{5}) == 0);39  }40 41  return 0;42}43