1// -*- C++ -*- 2//===----------------------------------------------------------------------===// 3// 4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5// See https://llvm.org/LICENSE.txt for license information. 6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef _LIBCPP_FLAT_MAP 11#define _LIBCPP_FLAT_MAP 12 13/* 14 Header <flat_map> synopsis 15 16#include <compare> // see [compare.syn] 17#include <initializer_list> // see [initializer.list.syn] 18 19namespace std { 20 // [flat.map], class template flat_map 21 template<class Key, class T, class Compare = less<Key>, 22 class KeyContainer = vector<Key>, class MappedContainer = vector<T>> 23 class flat_map; 24 25 struct sorted_unique_t { explicit sorted_unique_t() = default; }; 26 inline constexpr sorted_unique_t sorted_unique{}; 27 28 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer, 29 class Allocator> 30 struct uses_allocator<flat_map<Key, T, Compare, KeyContainer, MappedContainer>, 31 Allocator>; 32 33 // [flat.map.erasure], erasure for flat_map 34 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer, 35 class Predicate> 36 typename flat_map<Key, T, Compare, KeyContainer, MappedContainer>::size_type 37 erase_if(flat_map<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred); 38 39 // [flat.multimap], class template flat_multimap 40 template<class Key, class T, class Compare = less<Key>, 41 class KeyContainer = vector<Key>, class MappedContainer = vector<T>> 42 class flat_multimap; 43 44 struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; }; 45 inline constexpr sorted_equivalent_t sorted_equivalent{}; 46 47 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer, 48 class Allocator> 49 struct uses_allocator<flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>, 50 Allocator>; 51 52 // [flat.multimap.erasure], erasure for flat_multimap 53 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer, 54 class Predicate> 55 typename flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>::size_type 56 erase_if(flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred); 57*/ 58 59#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) 60# include <__cxx03/__config> 61#else 62# include <__config> 63 64# if _LIBCPP_STD_VER >= 23 65# include <__flat_map/flat_map.h> 66# include <__flat_map/flat_multimap.h> 67# include <__flat_map/sorted_equivalent.h> 68# include <__flat_map/sorted_unique.h> 69# endif 70 71// for feature-test macros 72# include <version> 73 74// standard required includes 75# include <compare> 76# include <initializer_list> 77 78# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 79# pragma GCC system_header 80# endif 81#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) 82 83#endif // _LIBCPP_FLAT_MAP 84