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// iterator upper_bound(const key_type& k);
16// const_iterator upper_bound(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#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 M example;
32 assert(example.upper_bound(C2Int{5}) == example.end());
33 }
34 {
35 typedef std::map<int, double, transparent_less_not_referenceable> M;
36 M example;
37 assert(example.upper_bound(C2Int{5}) == example.end());
38 }
39
40 return 0;
41}
42

source code of libcxx/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp