93 lines · plain
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-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP_FLAT_MAP11#define _LIBCPP_FLAT_MAP12 13/*14 Header <flat_map> synopsis15 16#include <compare> // see [compare.syn]17#include <initializer_list> // see [initializer.list.syn]18 19namespace std {20 // [flat.map], class template flat_map21 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_map34 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,35 class Predicate>36 typename flat_map<Key, T, Compare, KeyContainer, MappedContainer>::size_type37 erase_if(flat_map<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred);38 39 // [flat.multimap], class template flat_multimap40 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_multimap53 template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,54 class Predicate>55 typename flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>::size_type56 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#else62# include <__config>63 64# if _LIBCPP_STD_VER >= 2365# 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# endif70 71// for feature-test macros72# include <version>73 74// standard required includes75 76// [iterator.range]77# include <__iterator/access.h>78# include <__iterator/data.h>79# include <__iterator/empty.h>80# include <__iterator/reverse_access.h>81# include <__iterator/size.h>82 83// [flat.map.syn]84# include <compare>85# include <initializer_list>86 87# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)88# pragma GCC system_header89# endif90#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)91 92#endif // _LIBCPP_FLAT_MAP93