14684ddb6SLionel Sambuc// -*- C++ -*- 24684ddb6SLionel Sambuc//===---------------------------- set -------------------------------------===// 34684ddb6SLionel Sambuc// 44684ddb6SLionel Sambuc// The LLVM Compiler Infrastructure 54684ddb6SLionel Sambuc// 64684ddb6SLionel Sambuc// This file is dual licensed under the MIT and the University of Illinois Open 74684ddb6SLionel Sambuc// Source Licenses. See LICENSE.TXT for details. 84684ddb6SLionel Sambuc// 94684ddb6SLionel Sambuc//===----------------------------------------------------------------------===// 104684ddb6SLionel Sambuc 114684ddb6SLionel Sambuc#ifndef _LIBCPP_SET 124684ddb6SLionel Sambuc#define _LIBCPP_SET 134684ddb6SLionel Sambuc 144684ddb6SLionel Sambuc/* 154684ddb6SLionel Sambuc 164684ddb6SLionel Sambuc set synopsis 174684ddb6SLionel Sambuc 184684ddb6SLionel Sambucnamespace std 194684ddb6SLionel Sambuc{ 204684ddb6SLionel Sambuc 214684ddb6SLionel Sambuctemplate <class Key, class Compare = less<Key>, 224684ddb6SLionel Sambuc class Allocator = allocator<Key>> 234684ddb6SLionel Sambucclass set 244684ddb6SLionel Sambuc{ 254684ddb6SLionel Sambucpublic: 264684ddb6SLionel Sambuc // types: 274684ddb6SLionel Sambuc typedef Key key_type; 284684ddb6SLionel Sambuc typedef key_type value_type; 294684ddb6SLionel Sambuc typedef Compare key_compare; 304684ddb6SLionel Sambuc typedef key_compare value_compare; 314684ddb6SLionel Sambuc typedef Allocator allocator_type; 324684ddb6SLionel Sambuc typedef typename allocator_type::reference reference; 334684ddb6SLionel Sambuc typedef typename allocator_type::const_reference const_reference; 344684ddb6SLionel Sambuc typedef typename allocator_type::size_type size_type; 354684ddb6SLionel Sambuc typedef typename allocator_type::difference_type difference_type; 364684ddb6SLionel Sambuc typedef typename allocator_type::pointer pointer; 374684ddb6SLionel Sambuc typedef typename allocator_type::const_pointer const_pointer; 384684ddb6SLionel Sambuc 394684ddb6SLionel Sambuc typedef implementation-defined iterator; 404684ddb6SLionel Sambuc typedef implementation-defined const_iterator; 414684ddb6SLionel Sambuc typedef std::reverse_iterator<iterator> reverse_iterator; 424684ddb6SLionel Sambuc typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 434684ddb6SLionel Sambuc 444684ddb6SLionel Sambuc // construct/copy/destroy: 454684ddb6SLionel Sambuc set() 464684ddb6SLionel Sambuc noexcept( 474684ddb6SLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 484684ddb6SLionel Sambuc is_nothrow_default_constructible<key_compare>::value && 494684ddb6SLionel Sambuc is_nothrow_copy_constructible<key_compare>::value); 504684ddb6SLionel Sambuc explicit set(const value_compare& comp); 514684ddb6SLionel Sambuc set(const value_compare& comp, const allocator_type& a); 524684ddb6SLionel Sambuc template <class InputIterator> 534684ddb6SLionel Sambuc set(InputIterator first, InputIterator last, 544684ddb6SLionel Sambuc const value_compare& comp = value_compare()); 554684ddb6SLionel Sambuc template <class InputIterator> 564684ddb6SLionel Sambuc set(InputIterator first, InputIterator last, const value_compare& comp, 574684ddb6SLionel Sambuc const allocator_type& a); 584684ddb6SLionel Sambuc set(const set& s); 594684ddb6SLionel Sambuc set(set&& s) 604684ddb6SLionel Sambuc noexcept( 614684ddb6SLionel Sambuc is_nothrow_move_constructible<allocator_type>::value && 624684ddb6SLionel Sambuc is_nothrow_move_constructible<key_compare>::value); 634684ddb6SLionel Sambuc explicit set(const allocator_type& a); 644684ddb6SLionel Sambuc set(const set& s, const allocator_type& a); 654684ddb6SLionel Sambuc set(set&& s, const allocator_type& a); 664684ddb6SLionel Sambuc set(initializer_list<value_type> il, const value_compare& comp = value_compare()); 674684ddb6SLionel Sambuc set(initializer_list<value_type> il, const value_compare& comp, 684684ddb6SLionel Sambuc const allocator_type& a); 694684ddb6SLionel Sambuc template <class InputIterator> 704684ddb6SLionel Sambuc set(InputIterator first, InputIterator last, const allocator_type& a) 714684ddb6SLionel Sambuc : set(first, last, Compare(), a) {} // C++14 724684ddb6SLionel Sambuc set(initializer_list<value_type> il, const allocator_type& a) 734684ddb6SLionel Sambuc : set(il, Compare(), a) {} // C++14 744684ddb6SLionel Sambuc ~set(); 754684ddb6SLionel Sambuc 764684ddb6SLionel Sambuc set& operator=(const set& s); 774684ddb6SLionel Sambuc set& operator=(set&& s) 784684ddb6SLionel Sambuc noexcept( 794684ddb6SLionel Sambuc allocator_type::propagate_on_container_move_assignment::value && 804684ddb6SLionel Sambuc is_nothrow_move_assignable<allocator_type>::value && 814684ddb6SLionel Sambuc is_nothrow_move_assignable<key_compare>::value); 824684ddb6SLionel Sambuc set& operator=(initializer_list<value_type> il); 834684ddb6SLionel Sambuc 844684ddb6SLionel Sambuc // iterators: 854684ddb6SLionel Sambuc iterator begin() noexcept; 864684ddb6SLionel Sambuc const_iterator begin() const noexcept; 874684ddb6SLionel Sambuc iterator end() noexcept; 884684ddb6SLionel Sambuc const_iterator end() const noexcept; 894684ddb6SLionel Sambuc 904684ddb6SLionel Sambuc reverse_iterator rbegin() noexcept; 914684ddb6SLionel Sambuc const_reverse_iterator rbegin() const noexcept; 924684ddb6SLionel Sambuc reverse_iterator rend() noexcept; 934684ddb6SLionel Sambuc const_reverse_iterator rend() const noexcept; 944684ddb6SLionel Sambuc 954684ddb6SLionel Sambuc const_iterator cbegin() const noexcept; 964684ddb6SLionel Sambuc const_iterator cend() const noexcept; 974684ddb6SLionel Sambuc const_reverse_iterator crbegin() const noexcept; 984684ddb6SLionel Sambuc const_reverse_iterator crend() const noexcept; 994684ddb6SLionel Sambuc 1004684ddb6SLionel Sambuc // capacity: 1014684ddb6SLionel Sambuc bool empty() const noexcept; 1024684ddb6SLionel Sambuc size_type size() const noexcept; 1034684ddb6SLionel Sambuc size_type max_size() const noexcept; 1044684ddb6SLionel Sambuc 1054684ddb6SLionel Sambuc // modifiers: 1064684ddb6SLionel Sambuc template <class... Args> 1074684ddb6SLionel Sambuc pair<iterator, bool> emplace(Args&&... args); 1084684ddb6SLionel Sambuc template <class... Args> 1094684ddb6SLionel Sambuc iterator emplace_hint(const_iterator position, Args&&... args); 1104684ddb6SLionel Sambuc pair<iterator,bool> insert(const value_type& v); 1114684ddb6SLionel Sambuc pair<iterator,bool> insert(value_type&& v); 1124684ddb6SLionel Sambuc iterator insert(const_iterator position, const value_type& v); 1134684ddb6SLionel Sambuc iterator insert(const_iterator position, value_type&& v); 1144684ddb6SLionel Sambuc template <class InputIterator> 1154684ddb6SLionel Sambuc void insert(InputIterator first, InputIterator last); 1164684ddb6SLionel Sambuc void insert(initializer_list<value_type> il); 1174684ddb6SLionel Sambuc 1184684ddb6SLionel Sambuc iterator erase(const_iterator position); 119*0a6a1f1dSLionel Sambuc iterator erase(iterator position); // C++14 1204684ddb6SLionel Sambuc size_type erase(const key_type& k); 1214684ddb6SLionel Sambuc iterator erase(const_iterator first, const_iterator last); 1224684ddb6SLionel Sambuc void clear() noexcept; 1234684ddb6SLionel Sambuc 1244684ddb6SLionel Sambuc void swap(set& s) 1254684ddb6SLionel Sambuc noexcept( 1264684ddb6SLionel Sambuc __is_nothrow_swappable<key_compare>::value && 1274684ddb6SLionel Sambuc (!allocator_type::propagate_on_container_swap::value || 1284684ddb6SLionel Sambuc __is_nothrow_swappable<allocator_type>::value)); 1294684ddb6SLionel Sambuc 1304684ddb6SLionel Sambuc // observers: 1314684ddb6SLionel Sambuc allocator_type get_allocator() const noexcept; 1324684ddb6SLionel Sambuc key_compare key_comp() const; 1334684ddb6SLionel Sambuc value_compare value_comp() const; 1344684ddb6SLionel Sambuc 1354684ddb6SLionel Sambuc // set operations: 1364684ddb6SLionel Sambuc iterator find(const key_type& k); 1374684ddb6SLionel Sambuc const_iterator find(const key_type& k) const; 1384684ddb6SLionel Sambuc template<typename K> 1394684ddb6SLionel Sambuc iterator find(const K& x); 1404684ddb6SLionel Sambuc template<typename K> 1414684ddb6SLionel Sambuc const_iterator find(const K& x) const; // C++14 1424684ddb6SLionel Sambuc template<typename K> 1434684ddb6SLionel Sambuc size_type count(const K& x) const; // C++14 1444684ddb6SLionel Sambuc 1454684ddb6SLionel Sambuc size_type count(const key_type& k) const; 1464684ddb6SLionel Sambuc iterator lower_bound(const key_type& k); 1474684ddb6SLionel Sambuc const_iterator lower_bound(const key_type& k) const; 1484684ddb6SLionel Sambuc template<typename K> 1494684ddb6SLionel Sambuc iterator lower_bound(const K& x); // C++14 1504684ddb6SLionel Sambuc template<typename K> 1514684ddb6SLionel Sambuc const_iterator lower_bound(const K& x) const; // C++14 1524684ddb6SLionel Sambuc 1534684ddb6SLionel Sambuc iterator upper_bound(const key_type& k); 1544684ddb6SLionel Sambuc const_iterator upper_bound(const key_type& k) const; 1554684ddb6SLionel Sambuc template<typename K> 1564684ddb6SLionel Sambuc iterator upper_bound(const K& x); // C++14 1574684ddb6SLionel Sambuc template<typename K> 1584684ddb6SLionel Sambuc const_iterator upper_bound(const K& x) const; // C++14 1594684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const key_type& k); 1604684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const key_type& k) const; 1614684ddb6SLionel Sambuc template<typename K> 1624684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const K& x); // C++14 1634684ddb6SLionel Sambuc template<typename K> 1644684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14 1654684ddb6SLionel Sambuc}; 1664684ddb6SLionel Sambuc 1674684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1684684ddb6SLionel Sambucbool 1694684ddb6SLionel Sambucoperator==(const set<Key, Compare, Allocator>& x, 1704684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1714684ddb6SLionel Sambuc 1724684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1734684ddb6SLionel Sambucbool 1744684ddb6SLionel Sambucoperator< (const set<Key, Compare, Allocator>& x, 1754684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1764684ddb6SLionel Sambuc 1774684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1784684ddb6SLionel Sambucbool 1794684ddb6SLionel Sambucoperator!=(const set<Key, Compare, Allocator>& x, 1804684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1814684ddb6SLionel Sambuc 1824684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1834684ddb6SLionel Sambucbool 1844684ddb6SLionel Sambucoperator> (const set<Key, Compare, Allocator>& x, 1854684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1864684ddb6SLionel Sambuc 1874684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1884684ddb6SLionel Sambucbool 1894684ddb6SLionel Sambucoperator>=(const set<Key, Compare, Allocator>& x, 1904684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1914684ddb6SLionel Sambuc 1924684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1934684ddb6SLionel Sambucbool 1944684ddb6SLionel Sambucoperator<=(const set<Key, Compare, Allocator>& x, 1954684ddb6SLionel Sambuc const set<Key, Compare, Allocator>& y); 1964684ddb6SLionel Sambuc 1974684ddb6SLionel Sambuc// specialized algorithms: 1984684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 1994684ddb6SLionel Sambucvoid 2004684ddb6SLionel Sambucswap(set<Key, Compare, Allocator>& x, set<Key, Compare, Allocator>& y) 2014684ddb6SLionel Sambuc noexcept(noexcept(x.swap(y))); 2024684ddb6SLionel Sambuc 2034684ddb6SLionel Sambuctemplate <class Key, class Compare = less<Key>, 2044684ddb6SLionel Sambuc class Allocator = allocator<Key>> 2054684ddb6SLionel Sambucclass multiset 2064684ddb6SLionel Sambuc{ 2074684ddb6SLionel Sambucpublic: 2084684ddb6SLionel Sambuc // types: 2094684ddb6SLionel Sambuc typedef Key key_type; 2104684ddb6SLionel Sambuc typedef key_type value_type; 2114684ddb6SLionel Sambuc typedef Compare key_compare; 2124684ddb6SLionel Sambuc typedef key_compare value_compare; 2134684ddb6SLionel Sambuc typedef Allocator allocator_type; 2144684ddb6SLionel Sambuc typedef typename allocator_type::reference reference; 2154684ddb6SLionel Sambuc typedef typename allocator_type::const_reference const_reference; 2164684ddb6SLionel Sambuc typedef typename allocator_type::size_type size_type; 2174684ddb6SLionel Sambuc typedef typename allocator_type::difference_type difference_type; 2184684ddb6SLionel Sambuc typedef typename allocator_type::pointer pointer; 2194684ddb6SLionel Sambuc typedef typename allocator_type::const_pointer const_pointer; 2204684ddb6SLionel Sambuc 2214684ddb6SLionel Sambuc typedef implementation-defined iterator; 2224684ddb6SLionel Sambuc typedef implementation-defined const_iterator; 2234684ddb6SLionel Sambuc typedef std::reverse_iterator<iterator> reverse_iterator; 2244684ddb6SLionel Sambuc typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 2254684ddb6SLionel Sambuc 2264684ddb6SLionel Sambuc // construct/copy/destroy: 2274684ddb6SLionel Sambuc multiset() 2284684ddb6SLionel Sambuc noexcept( 2294684ddb6SLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 2304684ddb6SLionel Sambuc is_nothrow_default_constructible<key_compare>::value && 2314684ddb6SLionel Sambuc is_nothrow_copy_constructible<key_compare>::value); 2324684ddb6SLionel Sambuc explicit multiset(const value_compare& comp); 2334684ddb6SLionel Sambuc multiset(const value_compare& comp, const allocator_type& a); 2344684ddb6SLionel Sambuc template <class InputIterator> 2354684ddb6SLionel Sambuc multiset(InputIterator first, InputIterator last, 2364684ddb6SLionel Sambuc const value_compare& comp = value_compare()); 2374684ddb6SLionel Sambuc template <class InputIterator> 2384684ddb6SLionel Sambuc multiset(InputIterator first, InputIterator last, 2394684ddb6SLionel Sambuc const value_compare& comp, const allocator_type& a); 2404684ddb6SLionel Sambuc multiset(const multiset& s); 2414684ddb6SLionel Sambuc multiset(multiset&& s) 2424684ddb6SLionel Sambuc noexcept( 2434684ddb6SLionel Sambuc is_nothrow_move_constructible<allocator_type>::value && 2444684ddb6SLionel Sambuc is_nothrow_move_constructible<key_compare>::value); 2454684ddb6SLionel Sambuc explicit multiset(const allocator_type& a); 2464684ddb6SLionel Sambuc multiset(const multiset& s, const allocator_type& a); 2474684ddb6SLionel Sambuc multiset(multiset&& s, const allocator_type& a); 2484684ddb6SLionel Sambuc multiset(initializer_list<value_type> il, const value_compare& comp = value_compare()); 2494684ddb6SLionel Sambuc multiset(initializer_list<value_type> il, const value_compare& comp, 2504684ddb6SLionel Sambuc const allocator_type& a); 2514684ddb6SLionel Sambuc template <class InputIterator> 2524684ddb6SLionel Sambuc multiset(InputIterator first, InputIterator last, const allocator_type& a) 2534684ddb6SLionel Sambuc : set(first, last, Compare(), a) {} // C++14 2544684ddb6SLionel Sambuc multiset(initializer_list<value_type> il, const allocator_type& a) 2554684ddb6SLionel Sambuc : set(il, Compare(), a) {} // C++14 2564684ddb6SLionel Sambuc ~multiset(); 2574684ddb6SLionel Sambuc 2584684ddb6SLionel Sambuc multiset& operator=(const multiset& s); 2594684ddb6SLionel Sambuc multiset& operator=(multiset&& s) 2604684ddb6SLionel Sambuc noexcept( 2614684ddb6SLionel Sambuc allocator_type::propagate_on_container_move_assignment::value && 2624684ddb6SLionel Sambuc is_nothrow_move_assignable<allocator_type>::value && 2634684ddb6SLionel Sambuc is_nothrow_move_assignable<key_compare>::value); 2644684ddb6SLionel Sambuc multiset& operator=(initializer_list<value_type> il); 2654684ddb6SLionel Sambuc 2664684ddb6SLionel Sambuc // iterators: 2674684ddb6SLionel Sambuc iterator begin() noexcept; 2684684ddb6SLionel Sambuc const_iterator begin() const noexcept; 2694684ddb6SLionel Sambuc iterator end() noexcept; 2704684ddb6SLionel Sambuc const_iterator end() const noexcept; 2714684ddb6SLionel Sambuc 2724684ddb6SLionel Sambuc reverse_iterator rbegin() noexcept; 2734684ddb6SLionel Sambuc const_reverse_iterator rbegin() const noexcept; 2744684ddb6SLionel Sambuc reverse_iterator rend() noexcept; 2754684ddb6SLionel Sambuc const_reverse_iterator rend() const noexcept; 2764684ddb6SLionel Sambuc 2774684ddb6SLionel Sambuc const_iterator cbegin() const noexcept; 2784684ddb6SLionel Sambuc const_iterator cend() const noexcept; 2794684ddb6SLionel Sambuc const_reverse_iterator crbegin() const noexcept; 2804684ddb6SLionel Sambuc const_reverse_iterator crend() const noexcept; 2814684ddb6SLionel Sambuc 2824684ddb6SLionel Sambuc // capacity: 2834684ddb6SLionel Sambuc bool empty() const noexcept; 2844684ddb6SLionel Sambuc size_type size() const noexcept; 2854684ddb6SLionel Sambuc size_type max_size() const noexcept; 2864684ddb6SLionel Sambuc 2874684ddb6SLionel Sambuc // modifiers: 2884684ddb6SLionel Sambuc template <class... Args> 2894684ddb6SLionel Sambuc iterator emplace(Args&&... args); 2904684ddb6SLionel Sambuc template <class... Args> 2914684ddb6SLionel Sambuc iterator emplace_hint(const_iterator position, Args&&... args); 2924684ddb6SLionel Sambuc iterator insert(const value_type& v); 2934684ddb6SLionel Sambuc iterator insert(value_type&& v); 2944684ddb6SLionel Sambuc iterator insert(const_iterator position, const value_type& v); 2954684ddb6SLionel Sambuc iterator insert(const_iterator position, value_type&& v); 2964684ddb6SLionel Sambuc template <class InputIterator> 2974684ddb6SLionel Sambuc void insert(InputIterator first, InputIterator last); 2984684ddb6SLionel Sambuc void insert(initializer_list<value_type> il); 2994684ddb6SLionel Sambuc 3004684ddb6SLionel Sambuc iterator erase(const_iterator position); 301*0a6a1f1dSLionel Sambuc iterator erase(iterator position); // C++14 3024684ddb6SLionel Sambuc size_type erase(const key_type& k); 3034684ddb6SLionel Sambuc iterator erase(const_iterator first, const_iterator last); 3044684ddb6SLionel Sambuc void clear() noexcept; 3054684ddb6SLionel Sambuc 3064684ddb6SLionel Sambuc void swap(multiset& s) 3074684ddb6SLionel Sambuc noexcept( 3084684ddb6SLionel Sambuc __is_nothrow_swappable<key_compare>::value && 3094684ddb6SLionel Sambuc (!allocator_type::propagate_on_container_swap::value || 3104684ddb6SLionel Sambuc __is_nothrow_swappable<allocator_type>::value)); 3114684ddb6SLionel Sambuc 3124684ddb6SLionel Sambuc // observers: 3134684ddb6SLionel Sambuc allocator_type get_allocator() const noexcept; 3144684ddb6SLionel Sambuc key_compare key_comp() const; 3154684ddb6SLionel Sambuc value_compare value_comp() const; 3164684ddb6SLionel Sambuc 3174684ddb6SLionel Sambuc // set operations: 3184684ddb6SLionel Sambuc iterator find(const key_type& k); 3194684ddb6SLionel Sambuc const_iterator find(const key_type& k) const; 3204684ddb6SLionel Sambuc template<typename K> 3214684ddb6SLionel Sambuc iterator find(const K& x); 3224684ddb6SLionel Sambuc template<typename K> 3234684ddb6SLionel Sambuc const_iterator find(const K& x) const; // C++14 3244684ddb6SLionel Sambuc 3254684ddb6SLionel Sambuc size_type count(const key_type& k) const; 3264684ddb6SLionel Sambuc iterator lower_bound(const key_type& k); 3274684ddb6SLionel Sambuc const_iterator lower_bound(const key_type& k) const; 3284684ddb6SLionel Sambuc template<typename K> 3294684ddb6SLionel Sambuc iterator lower_bound(const K& x); // C++14 3304684ddb6SLionel Sambuc template<typename K> 3314684ddb6SLionel Sambuc const_iterator lower_bound(const K& x) const; // C++14 3324684ddb6SLionel Sambuc 3334684ddb6SLionel Sambuc iterator upper_bound(const key_type& k); 3344684ddb6SLionel Sambuc const_iterator upper_bound(const key_type& k) const; 3354684ddb6SLionel Sambuc template<typename K> 3364684ddb6SLionel Sambuc iterator upper_bound(const K& x); // C++14 3374684ddb6SLionel Sambuc template<typename K> 3384684ddb6SLionel Sambuc const_iterator upper_bound(const K& x) const; // C++14 3394684ddb6SLionel Sambuc 3404684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const key_type& k); 3414684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const key_type& k) const; 3424684ddb6SLionel Sambuc template<typename K> 3434684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const K& x); // C++14 3444684ddb6SLionel Sambuc template<typename K> 3454684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14 3464684ddb6SLionel Sambuc}; 3474684ddb6SLionel Sambuc 3484684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3494684ddb6SLionel Sambucbool 3504684ddb6SLionel Sambucoperator==(const multiset<Key, Compare, Allocator>& x, 3514684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3524684ddb6SLionel Sambuc 3534684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3544684ddb6SLionel Sambucbool 3554684ddb6SLionel Sambucoperator< (const multiset<Key, Compare, Allocator>& x, 3564684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3574684ddb6SLionel Sambuc 3584684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3594684ddb6SLionel Sambucbool 3604684ddb6SLionel Sambucoperator!=(const multiset<Key, Compare, Allocator>& x, 3614684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3624684ddb6SLionel Sambuc 3634684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3644684ddb6SLionel Sambucbool 3654684ddb6SLionel Sambucoperator> (const multiset<Key, Compare, Allocator>& x, 3664684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3674684ddb6SLionel Sambuc 3684684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3694684ddb6SLionel Sambucbool 3704684ddb6SLionel Sambucoperator>=(const multiset<Key, Compare, Allocator>& x, 3714684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3724684ddb6SLionel Sambuc 3734684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3744684ddb6SLionel Sambucbool 3754684ddb6SLionel Sambucoperator<=(const multiset<Key, Compare, Allocator>& x, 3764684ddb6SLionel Sambuc const multiset<Key, Compare, Allocator>& y); 3774684ddb6SLionel Sambuc 3784684ddb6SLionel Sambuc// specialized algorithms: 3794684ddb6SLionel Sambuctemplate <class Key, class Compare, class Allocator> 3804684ddb6SLionel Sambucvoid 3814684ddb6SLionel Sambucswap(multiset<Key, Compare, Allocator>& x, multiset<Key, Compare, Allocator>& y) 3824684ddb6SLionel Sambuc noexcept(noexcept(x.swap(y))); 3834684ddb6SLionel Sambuc 3844684ddb6SLionel Sambuc} // std 3854684ddb6SLionel Sambuc 3864684ddb6SLionel Sambuc*/ 3874684ddb6SLionel Sambuc 3884684ddb6SLionel Sambuc#include <__config> 3894684ddb6SLionel Sambuc#include <__tree> 3904684ddb6SLionel Sambuc#include <functional> 3914684ddb6SLionel Sambuc 3924684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 3934684ddb6SLionel Sambuc#pragma GCC system_header 3944684ddb6SLionel Sambuc#endif 3954684ddb6SLionel Sambuc 3964684ddb6SLionel Sambuc_LIBCPP_BEGIN_NAMESPACE_STD 3974684ddb6SLionel Sambuc 3984684ddb6SLionel Sambuctemplate <class _Key, class _Compare = less<_Key>, 3994684ddb6SLionel Sambuc class _Allocator = allocator<_Key> > 4004684ddb6SLionel Sambucclass _LIBCPP_TYPE_VIS_ONLY set 4014684ddb6SLionel Sambuc{ 4024684ddb6SLionel Sambucpublic: 4034684ddb6SLionel Sambuc // types: 4044684ddb6SLionel Sambuc typedef _Key key_type; 4054684ddb6SLionel Sambuc typedef key_type value_type; 4064684ddb6SLionel Sambuc typedef _Compare key_compare; 4074684ddb6SLionel Sambuc typedef key_compare value_compare; 4084684ddb6SLionel Sambuc typedef _Allocator allocator_type; 4094684ddb6SLionel Sambuc typedef value_type& reference; 4104684ddb6SLionel Sambuc typedef const value_type& const_reference; 4114684ddb6SLionel Sambuc 4124684ddb6SLionel Sambucprivate: 4134684ddb6SLionel Sambuc typedef __tree<value_type, value_compare, allocator_type> __base; 4144684ddb6SLionel Sambuc typedef allocator_traits<allocator_type> __alloc_traits; 4154684ddb6SLionel Sambuc typedef typename __base::__node_holder __node_holder; 4164684ddb6SLionel Sambuc 4174684ddb6SLionel Sambuc __base __tree_; 4184684ddb6SLionel Sambuc 4194684ddb6SLionel Sambucpublic: 4204684ddb6SLionel Sambuc typedef typename __base::pointer pointer; 4214684ddb6SLionel Sambuc typedef typename __base::const_pointer const_pointer; 4224684ddb6SLionel Sambuc typedef typename __base::size_type size_type; 4234684ddb6SLionel Sambuc typedef typename __base::difference_type difference_type; 4244684ddb6SLionel Sambuc typedef typename __base::const_iterator iterator; 4254684ddb6SLionel Sambuc typedef typename __base::const_iterator const_iterator; 4264684ddb6SLionel Sambuc typedef _VSTD::reverse_iterator<iterator> reverse_iterator; 4274684ddb6SLionel Sambuc typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; 4284684ddb6SLionel Sambuc 4294684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 430*0a6a1f1dSLionel Sambuc set() 4314684ddb6SLionel Sambuc _NOEXCEPT_( 4324684ddb6SLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 4334684ddb6SLionel Sambuc is_nothrow_default_constructible<key_compare>::value && 4344684ddb6SLionel Sambuc is_nothrow_copy_constructible<key_compare>::value) 435*0a6a1f1dSLionel Sambuc : __tree_(value_compare()) {} 436*0a6a1f1dSLionel Sambuc 4374684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 438*0a6a1f1dSLionel Sambuc explicit set(const value_compare& __comp) 439*0a6a1f1dSLionel Sambuc _NOEXCEPT_( 440*0a6a1f1dSLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 441*0a6a1f1dSLionel Sambuc is_nothrow_copy_constructible<key_compare>::value) 442*0a6a1f1dSLionel Sambuc : __tree_(__comp) {} 443*0a6a1f1dSLionel Sambuc 444*0a6a1f1dSLionel Sambuc _LIBCPP_INLINE_VISIBILITY 445*0a6a1f1dSLionel Sambuc explicit set(const value_compare& __comp, const allocator_type& __a) 4464684ddb6SLionel Sambuc : __tree_(__comp, __a) {} 4474684ddb6SLionel Sambuc template <class _InputIterator> 4484684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4494684ddb6SLionel Sambuc set(_InputIterator __f, _InputIterator __l, 4504684ddb6SLionel Sambuc const value_compare& __comp = value_compare()) 4514684ddb6SLionel Sambuc : __tree_(__comp) 4524684ddb6SLionel Sambuc { 4534684ddb6SLionel Sambuc insert(__f, __l); 4544684ddb6SLionel Sambuc } 4554684ddb6SLionel Sambuc 4564684ddb6SLionel Sambuc template <class _InputIterator> 4574684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4584684ddb6SLionel Sambuc set(_InputIterator __f, _InputIterator __l, const value_compare& __comp, 4594684ddb6SLionel Sambuc const allocator_type& __a) 4604684ddb6SLionel Sambuc : __tree_(__comp, __a) 4614684ddb6SLionel Sambuc { 4624684ddb6SLionel Sambuc insert(__f, __l); 4634684ddb6SLionel Sambuc } 4644684ddb6SLionel Sambuc 4654684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 4664684ddb6SLionel Sambuc template <class _InputIterator> 4674684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4684684ddb6SLionel Sambuc set(_InputIterator __f, _InputIterator __l, const allocator_type& __a) 4694684ddb6SLionel Sambuc : set(__f, __l, key_compare(), __a) {} 4704684ddb6SLionel Sambuc#endif 4714684ddb6SLionel Sambuc 4724684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4734684ddb6SLionel Sambuc set(const set& __s) 4744684ddb6SLionel Sambuc : __tree_(__s.__tree_) 4754684ddb6SLionel Sambuc { 4764684ddb6SLionel Sambuc insert(__s.begin(), __s.end()); 4774684ddb6SLionel Sambuc } 4784684ddb6SLionel Sambuc 4794684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4804684ddb6SLionel Sambuc set& operator=(const set& __s) 4814684ddb6SLionel Sambuc { 4824684ddb6SLionel Sambuc __tree_ = __s.__tree_; 4834684ddb6SLionel Sambuc return *this; 4844684ddb6SLionel Sambuc } 4854684ddb6SLionel Sambuc 4864684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 4874684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4884684ddb6SLionel Sambuc set(set&& __s) 4894684ddb6SLionel Sambuc _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) 4904684ddb6SLionel Sambuc : __tree_(_VSTD::move(__s.__tree_)) {} 4914684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 4924684ddb6SLionel Sambuc 4934684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4944684ddb6SLionel Sambuc explicit set(const allocator_type& __a) 4954684ddb6SLionel Sambuc : __tree_(__a) {} 4964684ddb6SLionel Sambuc 4974684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 4984684ddb6SLionel Sambuc set(const set& __s, const allocator_type& __a) 4994684ddb6SLionel Sambuc : __tree_(__s.__tree_.value_comp(), __a) 5004684ddb6SLionel Sambuc { 5014684ddb6SLionel Sambuc insert(__s.begin(), __s.end()); 5024684ddb6SLionel Sambuc } 5034684ddb6SLionel Sambuc 5044684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 5054684ddb6SLionel Sambuc set(set&& __s, const allocator_type& __a); 5064684ddb6SLionel Sambuc#endif 5074684ddb6SLionel Sambuc 5084684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 5094684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5104684ddb6SLionel Sambuc set(initializer_list<value_type> __il, const value_compare& __comp = value_compare()) 5114684ddb6SLionel Sambuc : __tree_(__comp) 5124684ddb6SLionel Sambuc { 5134684ddb6SLionel Sambuc insert(__il.begin(), __il.end()); 5144684ddb6SLionel Sambuc } 5154684ddb6SLionel Sambuc 5164684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5174684ddb6SLionel Sambuc set(initializer_list<value_type> __il, const value_compare& __comp, 5184684ddb6SLionel Sambuc const allocator_type& __a) 5194684ddb6SLionel Sambuc : __tree_(__comp, __a) 5204684ddb6SLionel Sambuc { 5214684ddb6SLionel Sambuc insert(__il.begin(), __il.end()); 5224684ddb6SLionel Sambuc } 5234684ddb6SLionel Sambuc 5244684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 5254684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5264684ddb6SLionel Sambuc set(initializer_list<value_type> __il, const allocator_type& __a) 5274684ddb6SLionel Sambuc : set(__il, key_compare(), __a) {} 5284684ddb6SLionel Sambuc#endif 5294684ddb6SLionel Sambuc 5304684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5314684ddb6SLionel Sambuc set& operator=(initializer_list<value_type> __il) 5324684ddb6SLionel Sambuc { 5334684ddb6SLionel Sambuc __tree_.__assign_unique(__il.begin(), __il.end()); 5344684ddb6SLionel Sambuc return *this; 5354684ddb6SLionel Sambuc } 5364684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 5374684ddb6SLionel Sambuc 5384684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 5394684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5404684ddb6SLionel Sambuc set& operator=(set&& __s) 5414684ddb6SLionel Sambuc _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) 5424684ddb6SLionel Sambuc { 5434684ddb6SLionel Sambuc __tree_ = _VSTD::move(__s.__tree_); 5444684ddb6SLionel Sambuc return *this; 5454684ddb6SLionel Sambuc } 5464684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 5474684ddb6SLionel Sambuc 5484684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5494684ddb6SLionel Sambuc iterator begin() _NOEXCEPT {return __tree_.begin();} 5504684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5514684ddb6SLionel Sambuc const_iterator begin() const _NOEXCEPT {return __tree_.begin();} 5524684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5534684ddb6SLionel Sambuc iterator end() _NOEXCEPT {return __tree_.end();} 5544684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5554684ddb6SLionel Sambuc const_iterator end() const _NOEXCEPT {return __tree_.end();} 5564684ddb6SLionel Sambuc 5574684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5584684ddb6SLionel Sambuc reverse_iterator rbegin() _NOEXCEPT 5594684ddb6SLionel Sambuc {return reverse_iterator(end());} 5604684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5614684ddb6SLionel Sambuc const_reverse_iterator rbegin() const _NOEXCEPT 5624684ddb6SLionel Sambuc {return const_reverse_iterator(end());} 5634684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5644684ddb6SLionel Sambuc reverse_iterator rend() _NOEXCEPT 5654684ddb6SLionel Sambuc {return reverse_iterator(begin());} 5664684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5674684ddb6SLionel Sambuc const_reverse_iterator rend() const _NOEXCEPT 5684684ddb6SLionel Sambuc {return const_reverse_iterator(begin());} 5694684ddb6SLionel Sambuc 5704684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5714684ddb6SLionel Sambuc const_iterator cbegin() const _NOEXCEPT {return begin();} 5724684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5734684ddb6SLionel Sambuc const_iterator cend() const _NOEXCEPT {return end();} 5744684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5754684ddb6SLionel Sambuc const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} 5764684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5774684ddb6SLionel Sambuc const_reverse_iterator crend() const _NOEXCEPT {return rend();} 5784684ddb6SLionel Sambuc 5794684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5804684ddb6SLionel Sambuc bool empty() const _NOEXCEPT {return __tree_.size() == 0;} 5814684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5824684ddb6SLionel Sambuc size_type size() const _NOEXCEPT {return __tree_.size();} 5834684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5844684ddb6SLionel Sambuc size_type max_size() const _NOEXCEPT {return __tree_.max_size();} 5854684ddb6SLionel Sambuc 5864684ddb6SLionel Sambuc // modifiers: 5874684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) 5884684ddb6SLionel Sambuc template <class... _Args> 5894684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5904684ddb6SLionel Sambuc pair<iterator, bool> emplace(_Args&&... __args) 5914684ddb6SLionel Sambuc {return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);} 5924684ddb6SLionel Sambuc template <class... _Args> 5934684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5944684ddb6SLionel Sambuc iterator emplace_hint(const_iterator __p, _Args&&... __args) 5954684ddb6SLionel Sambuc {return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);} 5964684ddb6SLionel Sambuc#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) 5974684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 5984684ddb6SLionel Sambuc pair<iterator,bool> insert(const value_type& __v) 5994684ddb6SLionel Sambuc {return __tree_.__insert_unique(__v);} 6004684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 6014684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6024684ddb6SLionel Sambuc pair<iterator,bool> insert(value_type&& __v) 6034684ddb6SLionel Sambuc {return __tree_.__insert_unique(_VSTD::move(__v));} 6044684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 6054684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6064684ddb6SLionel Sambuc iterator insert(const_iterator __p, const value_type& __v) 6074684ddb6SLionel Sambuc {return __tree_.__insert_unique(__p, __v);} 6084684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 6094684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6104684ddb6SLionel Sambuc iterator insert(const_iterator __p, value_type&& __v) 6114684ddb6SLionel Sambuc {return __tree_.__insert_unique(__p, _VSTD::move(__v));} 6124684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 6134684ddb6SLionel Sambuc template <class _InputIterator> 6144684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6154684ddb6SLionel Sambuc void insert(_InputIterator __f, _InputIterator __l) 6164684ddb6SLionel Sambuc { 6174684ddb6SLionel Sambuc for (const_iterator __e = cend(); __f != __l; ++__f) 6184684ddb6SLionel Sambuc __tree_.__insert_unique(__e, *__f); 6194684ddb6SLionel Sambuc } 6204684ddb6SLionel Sambuc 6214684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 6224684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6234684ddb6SLionel Sambuc void insert(initializer_list<value_type> __il) 6244684ddb6SLionel Sambuc {insert(__il.begin(), __il.end());} 6254684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 6264684ddb6SLionel Sambuc 6274684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6284684ddb6SLionel Sambuc iterator erase(const_iterator __p) {return __tree_.erase(__p);} 6294684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6304684ddb6SLionel Sambuc size_type erase(const key_type& __k) 6314684ddb6SLionel Sambuc {return __tree_.__erase_unique(__k);} 6324684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6334684ddb6SLionel Sambuc iterator erase(const_iterator __f, const_iterator __l) 6344684ddb6SLionel Sambuc {return __tree_.erase(__f, __l);} 6354684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6364684ddb6SLionel Sambuc void clear() _NOEXCEPT {__tree_.clear();} 6374684ddb6SLionel Sambuc 6384684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6394684ddb6SLionel Sambuc void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) 6404684ddb6SLionel Sambuc {__tree_.swap(__s.__tree_);} 6414684ddb6SLionel Sambuc 6424684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6434684ddb6SLionel Sambuc allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();} 6444684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6454684ddb6SLionel Sambuc key_compare key_comp() const {return __tree_.value_comp();} 6464684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6474684ddb6SLionel Sambuc value_compare value_comp() const {return __tree_.value_comp();} 6484684ddb6SLionel Sambuc 6494684ddb6SLionel Sambuc // set operations: 6504684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6514684ddb6SLionel Sambuc iterator find(const key_type& __k) {return __tree_.find(__k);} 6524684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6534684ddb6SLionel Sambuc const_iterator find(const key_type& __k) const {return __tree_.find(__k);} 6544684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 6554684ddb6SLionel Sambuc template <typename _K2> 6564684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6574684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type 6584684ddb6SLionel Sambuc find(const _K2& __k) {return __tree_.find(__k);} 6594684ddb6SLionel Sambuc template <typename _K2> 6604684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6614684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type 6624684ddb6SLionel Sambuc find(const _K2& __k) const {return __tree_.find(__k);} 6634684ddb6SLionel Sambuc#endif 6644684ddb6SLionel Sambuc 6654684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6664684ddb6SLionel Sambuc size_type count(const key_type& __k) const 6674684ddb6SLionel Sambuc {return __tree_.__count_unique(__k);} 668*0a6a1f1dSLionel Sambuc#if _LIBCPP_STD_VER > 11 669*0a6a1f1dSLionel Sambuc template <typename _K2> 670*0a6a1f1dSLionel Sambuc _LIBCPP_INLINE_VISIBILITY 671*0a6a1f1dSLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type 672*0a6a1f1dSLionel Sambuc count(const _K2& __k) {return __tree_.__count_unique(__k);} 673*0a6a1f1dSLionel Sambuc#endif 6744684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6754684ddb6SLionel Sambuc iterator lower_bound(const key_type& __k) 6764684ddb6SLionel Sambuc {return __tree_.lower_bound(__k);} 6774684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6784684ddb6SLionel Sambuc const_iterator lower_bound(const key_type& __k) const 6794684ddb6SLionel Sambuc {return __tree_.lower_bound(__k);} 6804684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 6814684ddb6SLionel Sambuc template <typename _K2> 6824684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6834684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type 6844684ddb6SLionel Sambuc lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);} 6854684ddb6SLionel Sambuc 6864684ddb6SLionel Sambuc template <typename _K2> 6874684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6884684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type 6894684ddb6SLionel Sambuc lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);} 6904684ddb6SLionel Sambuc#endif 6914684ddb6SLionel Sambuc 6924684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6934684ddb6SLionel Sambuc iterator upper_bound(const key_type& __k) 6944684ddb6SLionel Sambuc {return __tree_.upper_bound(__k);} 6954684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 6964684ddb6SLionel Sambuc const_iterator upper_bound(const key_type& __k) const 6974684ddb6SLionel Sambuc {return __tree_.upper_bound(__k);} 6984684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 6994684ddb6SLionel Sambuc template <typename _K2> 7004684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7014684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type 7024684ddb6SLionel Sambuc upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);} 7034684ddb6SLionel Sambuc template <typename _K2> 7044684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7054684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type 7064684ddb6SLionel Sambuc upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);} 7074684ddb6SLionel Sambuc#endif 7084684ddb6SLionel Sambuc 7094684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7104684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const key_type& __k) 7114684ddb6SLionel Sambuc {return __tree_.__equal_range_unique(__k);} 7124684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7134684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const key_type& __k) const 7144684ddb6SLionel Sambuc {return __tree_.__equal_range_unique(__k);} 7154684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 7164684ddb6SLionel Sambuc template <typename _K2> 7174684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7184684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type 7194684ddb6SLionel Sambuc equal_range(const _K2& __k) {return __tree_.__equal_range_unique(__k);} 7204684ddb6SLionel Sambuc template <typename _K2> 7214684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 7224684ddb6SLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type 7234684ddb6SLionel Sambuc equal_range(const _K2& __k) const {return __tree_.__equal_range_unique(__k);} 7244684ddb6SLionel Sambuc#endif 7254684ddb6SLionel Sambuc}; 7264684ddb6SLionel Sambuc 7274684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 7284684ddb6SLionel Sambuc 7294684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7304684ddb6SLionel Sambucset<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a) 7314684ddb6SLionel Sambuc : __tree_(_VSTD::move(__s.__tree_), __a) 7324684ddb6SLionel Sambuc{ 7334684ddb6SLionel Sambuc if (__a != __s.get_allocator()) 7344684ddb6SLionel Sambuc { 7354684ddb6SLionel Sambuc const_iterator __e = cend(); 7364684ddb6SLionel Sambuc while (!__s.empty()) 7374684ddb6SLionel Sambuc insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_)); 7384684ddb6SLionel Sambuc } 7394684ddb6SLionel Sambuc} 7404684ddb6SLionel Sambuc 7414684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 7424684ddb6SLionel Sambuc 7434684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7444684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7454684ddb6SLionel Sambucbool 7464684ddb6SLionel Sambucoperator==(const set<_Key, _Compare, _Allocator>& __x, 7474684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7484684ddb6SLionel Sambuc{ 7494684ddb6SLionel Sambuc return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); 7504684ddb6SLionel Sambuc} 7514684ddb6SLionel Sambuc 7524684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7534684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7544684ddb6SLionel Sambucbool 7554684ddb6SLionel Sambucoperator< (const set<_Key, _Compare, _Allocator>& __x, 7564684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7574684ddb6SLionel Sambuc{ 7584684ddb6SLionel Sambuc return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); 7594684ddb6SLionel Sambuc} 7604684ddb6SLionel Sambuc 7614684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7624684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7634684ddb6SLionel Sambucbool 7644684ddb6SLionel Sambucoperator!=(const set<_Key, _Compare, _Allocator>& __x, 7654684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7664684ddb6SLionel Sambuc{ 7674684ddb6SLionel Sambuc return !(__x == __y); 7684684ddb6SLionel Sambuc} 7694684ddb6SLionel Sambuc 7704684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7714684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7724684ddb6SLionel Sambucbool 7734684ddb6SLionel Sambucoperator> (const set<_Key, _Compare, _Allocator>& __x, 7744684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7754684ddb6SLionel Sambuc{ 7764684ddb6SLionel Sambuc return __y < __x; 7774684ddb6SLionel Sambuc} 7784684ddb6SLionel Sambuc 7794684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7804684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7814684ddb6SLionel Sambucbool 7824684ddb6SLionel Sambucoperator>=(const set<_Key, _Compare, _Allocator>& __x, 7834684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7844684ddb6SLionel Sambuc{ 7854684ddb6SLionel Sambuc return !(__x < __y); 7864684ddb6SLionel Sambuc} 7874684ddb6SLionel Sambuc 7884684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7894684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 7904684ddb6SLionel Sambucbool 7914684ddb6SLionel Sambucoperator<=(const set<_Key, _Compare, _Allocator>& __x, 7924684ddb6SLionel Sambuc const set<_Key, _Compare, _Allocator>& __y) 7934684ddb6SLionel Sambuc{ 7944684ddb6SLionel Sambuc return !(__y < __x); 7954684ddb6SLionel Sambuc} 7964684ddb6SLionel Sambuc 7974684ddb6SLionel Sambuc// specialized algorithms: 7984684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 7994684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 8004684ddb6SLionel Sambucvoid 8014684ddb6SLionel Sambucswap(set<_Key, _Compare, _Allocator>& __x, 8024684ddb6SLionel Sambuc set<_Key, _Compare, _Allocator>& __y) 8034684ddb6SLionel Sambuc _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 8044684ddb6SLionel Sambuc{ 8054684ddb6SLionel Sambuc __x.swap(__y); 8064684ddb6SLionel Sambuc} 8074684ddb6SLionel Sambuc 8084684ddb6SLionel Sambuctemplate <class _Key, class _Compare = less<_Key>, 8094684ddb6SLionel Sambuc class _Allocator = allocator<_Key> > 8104684ddb6SLionel Sambucclass _LIBCPP_TYPE_VIS_ONLY multiset 8114684ddb6SLionel Sambuc{ 8124684ddb6SLionel Sambucpublic: 8134684ddb6SLionel Sambuc // types: 8144684ddb6SLionel Sambuc typedef _Key key_type; 8154684ddb6SLionel Sambuc typedef key_type value_type; 8164684ddb6SLionel Sambuc typedef _Compare key_compare; 8174684ddb6SLionel Sambuc typedef key_compare value_compare; 8184684ddb6SLionel Sambuc typedef _Allocator allocator_type; 8194684ddb6SLionel Sambuc typedef value_type& reference; 8204684ddb6SLionel Sambuc typedef const value_type& const_reference; 8214684ddb6SLionel Sambuc 8224684ddb6SLionel Sambucprivate: 8234684ddb6SLionel Sambuc typedef __tree<value_type, value_compare, allocator_type> __base; 8244684ddb6SLionel Sambuc typedef allocator_traits<allocator_type> __alloc_traits; 8254684ddb6SLionel Sambuc typedef typename __base::__node_holder __node_holder; 8264684ddb6SLionel Sambuc 8274684ddb6SLionel Sambuc __base __tree_; 8284684ddb6SLionel Sambuc 8294684ddb6SLionel Sambucpublic: 8304684ddb6SLionel Sambuc typedef typename __base::pointer pointer; 8314684ddb6SLionel Sambuc typedef typename __base::const_pointer const_pointer; 8324684ddb6SLionel Sambuc typedef typename __base::size_type size_type; 8334684ddb6SLionel Sambuc typedef typename __base::difference_type difference_type; 8344684ddb6SLionel Sambuc typedef typename __base::const_iterator iterator; 8354684ddb6SLionel Sambuc typedef typename __base::const_iterator const_iterator; 8364684ddb6SLionel Sambuc typedef _VSTD::reverse_iterator<iterator> reverse_iterator; 8374684ddb6SLionel Sambuc typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; 8384684ddb6SLionel Sambuc 8394684ddb6SLionel Sambuc // construct/copy/destroy: 8404684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 841*0a6a1f1dSLionel Sambuc multiset() 8424684ddb6SLionel Sambuc _NOEXCEPT_( 8434684ddb6SLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 8444684ddb6SLionel Sambuc is_nothrow_default_constructible<key_compare>::value && 8454684ddb6SLionel Sambuc is_nothrow_copy_constructible<key_compare>::value) 846*0a6a1f1dSLionel Sambuc : __tree_(value_compare()) {} 847*0a6a1f1dSLionel Sambuc 8484684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 849*0a6a1f1dSLionel Sambuc explicit multiset(const value_compare& __comp) 850*0a6a1f1dSLionel Sambuc _NOEXCEPT_( 851*0a6a1f1dSLionel Sambuc is_nothrow_default_constructible<allocator_type>::value && 852*0a6a1f1dSLionel Sambuc is_nothrow_copy_constructible<key_compare>::value) 853*0a6a1f1dSLionel Sambuc : __tree_(__comp) {} 854*0a6a1f1dSLionel Sambuc 855*0a6a1f1dSLionel Sambuc _LIBCPP_INLINE_VISIBILITY 856*0a6a1f1dSLionel Sambuc explicit multiset(const value_compare& __comp, const allocator_type& __a) 8574684ddb6SLionel Sambuc : __tree_(__comp, __a) {} 8584684ddb6SLionel Sambuc template <class _InputIterator> 8594684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 8604684ddb6SLionel Sambuc multiset(_InputIterator __f, _InputIterator __l, 8614684ddb6SLionel Sambuc const value_compare& __comp = value_compare()) 8624684ddb6SLionel Sambuc : __tree_(__comp) 8634684ddb6SLionel Sambuc { 8644684ddb6SLionel Sambuc insert(__f, __l); 8654684ddb6SLionel Sambuc } 8664684ddb6SLionel Sambuc 8674684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 8684684ddb6SLionel Sambuc template <class _InputIterator> 8694684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 8704684ddb6SLionel Sambuc multiset(_InputIterator __f, _InputIterator __l, const allocator_type& __a) 8714684ddb6SLionel Sambuc : multiset(__f, __l, key_compare(), __a) {} 8724684ddb6SLionel Sambuc#endif 8734684ddb6SLionel Sambuc 8744684ddb6SLionel Sambuc template <class _InputIterator> 8754684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 8764684ddb6SLionel Sambuc multiset(_InputIterator __f, _InputIterator __l, 8774684ddb6SLionel Sambuc const value_compare& __comp, const allocator_type& __a) 8784684ddb6SLionel Sambuc : __tree_(__comp, __a) 8794684ddb6SLionel Sambuc { 8804684ddb6SLionel Sambuc insert(__f, __l); 8814684ddb6SLionel Sambuc } 8824684ddb6SLionel Sambuc 8834684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 8844684ddb6SLionel Sambuc multiset(const multiset& __s) 8854684ddb6SLionel Sambuc : __tree_(__s.__tree_.value_comp(), 8864684ddb6SLionel Sambuc __alloc_traits::select_on_container_copy_construction(__s.__tree_.__alloc())) 8874684ddb6SLionel Sambuc { 8884684ddb6SLionel Sambuc insert(__s.begin(), __s.end()); 8894684ddb6SLionel Sambuc } 8904684ddb6SLionel Sambuc 8914684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 8924684ddb6SLionel Sambuc multiset& operator=(const multiset& __s) 8934684ddb6SLionel Sambuc { 8944684ddb6SLionel Sambuc __tree_ = __s.__tree_; 8954684ddb6SLionel Sambuc return *this; 8964684ddb6SLionel Sambuc } 8974684ddb6SLionel Sambuc 8984684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 8994684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9004684ddb6SLionel Sambuc multiset(multiset&& __s) 9014684ddb6SLionel Sambuc _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) 9024684ddb6SLionel Sambuc : __tree_(_VSTD::move(__s.__tree_)) {} 9034684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 9044684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9054684ddb6SLionel Sambuc explicit multiset(const allocator_type& __a) 9064684ddb6SLionel Sambuc : __tree_(__a) {} 9074684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9084684ddb6SLionel Sambuc multiset(const multiset& __s, const allocator_type& __a) 9094684ddb6SLionel Sambuc : __tree_(__s.__tree_.value_comp(), __a) 9104684ddb6SLionel Sambuc { 9114684ddb6SLionel Sambuc insert(__s.begin(), __s.end()); 9124684ddb6SLionel Sambuc } 9134684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 9144684ddb6SLionel Sambuc multiset(multiset&& __s, const allocator_type& __a); 9154684ddb6SLionel Sambuc#endif 9164684ddb6SLionel Sambuc 9174684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 9184684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9194684ddb6SLionel Sambuc multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare()) 9204684ddb6SLionel Sambuc : __tree_(__comp) 9214684ddb6SLionel Sambuc { 9224684ddb6SLionel Sambuc insert(__il.begin(), __il.end()); 9234684ddb6SLionel Sambuc } 9244684ddb6SLionel Sambuc 9254684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9264684ddb6SLionel Sambuc multiset(initializer_list<value_type> __il, const value_compare& __comp, 9274684ddb6SLionel Sambuc const allocator_type& __a) 9284684ddb6SLionel Sambuc : __tree_(__comp, __a) 9294684ddb6SLionel Sambuc { 9304684ddb6SLionel Sambuc insert(__il.begin(), __il.end()); 9314684ddb6SLionel Sambuc } 9324684ddb6SLionel Sambuc 9334684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 9344684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9354684ddb6SLionel Sambuc multiset(initializer_list<value_type> __il, const allocator_type& __a) 9364684ddb6SLionel Sambuc : multiset(__il, key_compare(), __a) {} 9374684ddb6SLionel Sambuc#endif 9384684ddb6SLionel Sambuc 9394684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9404684ddb6SLionel Sambuc multiset& operator=(initializer_list<value_type> __il) 9414684ddb6SLionel Sambuc { 9424684ddb6SLionel Sambuc __tree_.__assign_multi(__il.begin(), __il.end()); 9434684ddb6SLionel Sambuc return *this; 9444684ddb6SLionel Sambuc } 9454684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 9464684ddb6SLionel Sambuc 9474684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 9484684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9494684ddb6SLionel Sambuc multiset& operator=(multiset&& __s) 9504684ddb6SLionel Sambuc _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) 9514684ddb6SLionel Sambuc { 9524684ddb6SLionel Sambuc __tree_ = _VSTD::move(__s.__tree_); 9534684ddb6SLionel Sambuc return *this; 9544684ddb6SLionel Sambuc } 9554684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 9564684ddb6SLionel Sambuc 9574684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9584684ddb6SLionel Sambuc iterator begin() _NOEXCEPT {return __tree_.begin();} 9594684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9604684ddb6SLionel Sambuc const_iterator begin() const _NOEXCEPT {return __tree_.begin();} 9614684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9624684ddb6SLionel Sambuc iterator end() _NOEXCEPT {return __tree_.end();} 9634684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9644684ddb6SLionel Sambuc const_iterator end() const _NOEXCEPT {return __tree_.end();} 9654684ddb6SLionel Sambuc 9664684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9674684ddb6SLionel Sambuc reverse_iterator rbegin() _NOEXCEPT 9684684ddb6SLionel Sambuc {return reverse_iterator(end());} 9694684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9704684ddb6SLionel Sambuc const_reverse_iterator rbegin() const _NOEXCEPT 9714684ddb6SLionel Sambuc {return const_reverse_iterator(end());} 9724684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9734684ddb6SLionel Sambuc reverse_iterator rend() _NOEXCEPT 9744684ddb6SLionel Sambuc {return reverse_iterator(begin());} 9754684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9764684ddb6SLionel Sambuc const_reverse_iterator rend() const _NOEXCEPT 9774684ddb6SLionel Sambuc {return const_reverse_iterator(begin());} 9784684ddb6SLionel Sambuc 9794684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9804684ddb6SLionel Sambuc const_iterator cbegin() const _NOEXCEPT {return begin();} 9814684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9824684ddb6SLionel Sambuc const_iterator cend() const _NOEXCEPT {return end();} 9834684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9844684ddb6SLionel Sambuc const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} 9854684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9864684ddb6SLionel Sambuc const_reverse_iterator crend() const _NOEXCEPT {return rend();} 9874684ddb6SLionel Sambuc 9884684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9894684ddb6SLionel Sambuc bool empty() const _NOEXCEPT {return __tree_.size() == 0;} 9904684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9914684ddb6SLionel Sambuc size_type size() const _NOEXCEPT {return __tree_.size();} 9924684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9934684ddb6SLionel Sambuc size_type max_size() const _NOEXCEPT {return __tree_.max_size();} 9944684ddb6SLionel Sambuc 9954684ddb6SLionel Sambuc // modifiers: 9964684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) 9974684ddb6SLionel Sambuc template <class... _Args> 9984684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 9994684ddb6SLionel Sambuc iterator emplace(_Args&&... __args) 10004684ddb6SLionel Sambuc {return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);} 10014684ddb6SLionel Sambuc template <class... _Args> 10024684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10034684ddb6SLionel Sambuc iterator emplace_hint(const_iterator __p, _Args&&... __args) 10044684ddb6SLionel Sambuc {return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);} 10054684ddb6SLionel Sambuc#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) 10064684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10074684ddb6SLionel Sambuc iterator insert(const value_type& __v) 10084684ddb6SLionel Sambuc {return __tree_.__insert_multi(__v);} 10094684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 10104684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10114684ddb6SLionel Sambuc iterator insert(value_type&& __v) 10124684ddb6SLionel Sambuc {return __tree_.__insert_multi(_VSTD::move(__v));} 10134684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 10144684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10154684ddb6SLionel Sambuc iterator insert(const_iterator __p, const value_type& __v) 10164684ddb6SLionel Sambuc {return __tree_.__insert_multi(__p, __v);} 10174684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 10184684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10194684ddb6SLionel Sambuc iterator insert(const_iterator __p, value_type&& __v) 10204684ddb6SLionel Sambuc {return __tree_.__insert_multi(_VSTD::move(__v));} 10214684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 10224684ddb6SLionel Sambuc template <class _InputIterator> 10234684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10244684ddb6SLionel Sambuc void insert(_InputIterator __f, _InputIterator __l) 10254684ddb6SLionel Sambuc { 10264684ddb6SLionel Sambuc for (const_iterator __e = cend(); __f != __l; ++__f) 10274684ddb6SLionel Sambuc __tree_.__insert_multi(__e, *__f); 10284684ddb6SLionel Sambuc } 10294684ddb6SLionel Sambuc 10304684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 10314684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10324684ddb6SLionel Sambuc void insert(initializer_list<value_type> __il) 10334684ddb6SLionel Sambuc {insert(__il.begin(), __il.end());} 10344684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 10354684ddb6SLionel Sambuc 10364684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10374684ddb6SLionel Sambuc iterator erase(const_iterator __p) {return __tree_.erase(__p);} 10384684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10394684ddb6SLionel Sambuc size_type erase(const key_type& __k) {return __tree_.__erase_multi(__k);} 10404684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10414684ddb6SLionel Sambuc iterator erase(const_iterator __f, const_iterator __l) 10424684ddb6SLionel Sambuc {return __tree_.erase(__f, __l);} 10434684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10444684ddb6SLionel Sambuc void clear() _NOEXCEPT {__tree_.clear();} 10454684ddb6SLionel Sambuc 10464684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10474684ddb6SLionel Sambuc void swap(multiset& __s) 10484684ddb6SLionel Sambuc _NOEXCEPT_(__is_nothrow_swappable<__base>::value) 10494684ddb6SLionel Sambuc {__tree_.swap(__s.__tree_);} 10504684ddb6SLionel Sambuc 10514684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10524684ddb6SLionel Sambuc allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();} 10534684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10544684ddb6SLionel Sambuc key_compare key_comp() const {return __tree_.value_comp();} 10554684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10564684ddb6SLionel Sambuc value_compare value_comp() const {return __tree_.value_comp();} 10574684ddb6SLionel Sambuc 10584684ddb6SLionel Sambuc // set operations: 10594684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10604684ddb6SLionel Sambuc iterator find(const key_type& __k) {return __tree_.find(__k);} 10614684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10624684ddb6SLionel Sambuc const_iterator find(const key_type& __k) const {return __tree_.find(__k);} 10634684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 10644684ddb6SLionel Sambuc template <typename _K2> 10654684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10664684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type 10674684ddb6SLionel Sambuc find(const _K2& __k) {return __tree_.find(__k);} 10684684ddb6SLionel Sambuc template <typename _K2> 10694684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10704684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type 10714684ddb6SLionel Sambuc find(const _K2& __k) const {return __tree_.find(__k);} 10724684ddb6SLionel Sambuc#endif 10734684ddb6SLionel Sambuc 10744684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10754684ddb6SLionel Sambuc size_type count(const key_type& __k) const 10764684ddb6SLionel Sambuc {return __tree_.__count_multi(__k);} 1077*0a6a1f1dSLionel Sambuc#if _LIBCPP_STD_VER > 11 1078*0a6a1f1dSLionel Sambuc template <typename _K2> 1079*0a6a1f1dSLionel Sambuc _LIBCPP_INLINE_VISIBILITY 1080*0a6a1f1dSLionel Sambuc typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type 1081*0a6a1f1dSLionel Sambuc count(const _K2& __k) {return __tree_.__count_multi(__k);} 1082*0a6a1f1dSLionel Sambuc#endif 10834684ddb6SLionel Sambuc 10844684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10854684ddb6SLionel Sambuc iterator lower_bound(const key_type& __k) 10864684ddb6SLionel Sambuc {return __tree_.lower_bound(__k);} 10874684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10884684ddb6SLionel Sambuc const_iterator lower_bound(const key_type& __k) const 10894684ddb6SLionel Sambuc {return __tree_.lower_bound(__k);} 10904684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 10914684ddb6SLionel Sambuc template <typename _K2> 10924684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10934684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type 10944684ddb6SLionel Sambuc lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);} 10954684ddb6SLionel Sambuc 10964684ddb6SLionel Sambuc template <typename _K2> 10974684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 10984684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type 10994684ddb6SLionel Sambuc lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);} 11004684ddb6SLionel Sambuc#endif 11014684ddb6SLionel Sambuc 11024684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11034684ddb6SLionel Sambuc iterator upper_bound(const key_type& __k) 11044684ddb6SLionel Sambuc {return __tree_.upper_bound(__k);} 11054684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11064684ddb6SLionel Sambuc const_iterator upper_bound(const key_type& __k) const 11074684ddb6SLionel Sambuc {return __tree_.upper_bound(__k);} 11084684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 11094684ddb6SLionel Sambuc template <typename _K2> 11104684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11114684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,iterator>::type 11124684ddb6SLionel Sambuc upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);} 11134684ddb6SLionel Sambuc template <typename _K2> 11144684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11154684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,const_iterator>::type 11164684ddb6SLionel Sambuc upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);} 11174684ddb6SLionel Sambuc#endif 11184684ddb6SLionel Sambuc 11194684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11204684ddb6SLionel Sambuc pair<iterator,iterator> equal_range(const key_type& __k) 11214684ddb6SLionel Sambuc {return __tree_.__equal_range_multi(__k);} 11224684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11234684ddb6SLionel Sambuc pair<const_iterator,const_iterator> equal_range(const key_type& __k) const 11244684ddb6SLionel Sambuc {return __tree_.__equal_range_multi(__k);} 11254684ddb6SLionel Sambuc#if _LIBCPP_STD_VER > 11 11264684ddb6SLionel Sambuc template <typename _K2> 11274684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11284684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type 11294684ddb6SLionel Sambuc equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);} 11304684ddb6SLionel Sambuc template <typename _K2> 11314684ddb6SLionel Sambuc _LIBCPP_INLINE_VISIBILITY 11324684ddb6SLionel Sambuc typename _VSTD::enable_if<_VSTD::__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type 11334684ddb6SLionel Sambuc equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);} 11344684ddb6SLionel Sambuc#endif 11354684ddb6SLionel Sambuc}; 11364684ddb6SLionel Sambuc 11374684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 11384684ddb6SLionel Sambuc 11394684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11404684ddb6SLionel Sambucmultiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a) 11414684ddb6SLionel Sambuc : __tree_(_VSTD::move(__s.__tree_), __a) 11424684ddb6SLionel Sambuc{ 11434684ddb6SLionel Sambuc if (__a != __s.get_allocator()) 11444684ddb6SLionel Sambuc { 11454684ddb6SLionel Sambuc const_iterator __e = cend(); 11464684ddb6SLionel Sambuc while (!__s.empty()) 11474684ddb6SLionel Sambuc insert(__e, _VSTD::move(__s.__tree_.remove(__s.begin())->__value_)); 11484684ddb6SLionel Sambuc } 11494684ddb6SLionel Sambuc} 11504684ddb6SLionel Sambuc 11514684ddb6SLionel Sambuc#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 11524684ddb6SLionel Sambuc 11534684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11544684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 11554684ddb6SLionel Sambucbool 11564684ddb6SLionel Sambucoperator==(const multiset<_Key, _Compare, _Allocator>& __x, 11574684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 11584684ddb6SLionel Sambuc{ 11594684ddb6SLionel Sambuc return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); 11604684ddb6SLionel Sambuc} 11614684ddb6SLionel Sambuc 11624684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11634684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 11644684ddb6SLionel Sambucbool 11654684ddb6SLionel Sambucoperator< (const multiset<_Key, _Compare, _Allocator>& __x, 11664684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 11674684ddb6SLionel Sambuc{ 11684684ddb6SLionel Sambuc return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); 11694684ddb6SLionel Sambuc} 11704684ddb6SLionel Sambuc 11714684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11724684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 11734684ddb6SLionel Sambucbool 11744684ddb6SLionel Sambucoperator!=(const multiset<_Key, _Compare, _Allocator>& __x, 11754684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 11764684ddb6SLionel Sambuc{ 11774684ddb6SLionel Sambuc return !(__x == __y); 11784684ddb6SLionel Sambuc} 11794684ddb6SLionel Sambuc 11804684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11814684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 11824684ddb6SLionel Sambucbool 11834684ddb6SLionel Sambucoperator> (const multiset<_Key, _Compare, _Allocator>& __x, 11844684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 11854684ddb6SLionel Sambuc{ 11864684ddb6SLionel Sambuc return __y < __x; 11874684ddb6SLionel Sambuc} 11884684ddb6SLionel Sambuc 11894684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11904684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 11914684ddb6SLionel Sambucbool 11924684ddb6SLionel Sambucoperator>=(const multiset<_Key, _Compare, _Allocator>& __x, 11934684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 11944684ddb6SLionel Sambuc{ 11954684ddb6SLionel Sambuc return !(__x < __y); 11964684ddb6SLionel Sambuc} 11974684ddb6SLionel Sambuc 11984684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 11994684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 12004684ddb6SLionel Sambucbool 12014684ddb6SLionel Sambucoperator<=(const multiset<_Key, _Compare, _Allocator>& __x, 12024684ddb6SLionel Sambuc const multiset<_Key, _Compare, _Allocator>& __y) 12034684ddb6SLionel Sambuc{ 12044684ddb6SLionel Sambuc return !(__y < __x); 12054684ddb6SLionel Sambuc} 12064684ddb6SLionel Sambuc 12074684ddb6SLionel Sambuctemplate <class _Key, class _Compare, class _Allocator> 12084684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY 12094684ddb6SLionel Sambucvoid 12104684ddb6SLionel Sambucswap(multiset<_Key, _Compare, _Allocator>& __x, 12114684ddb6SLionel Sambuc multiset<_Key, _Compare, _Allocator>& __y) 12124684ddb6SLionel Sambuc _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 12134684ddb6SLionel Sambuc{ 12144684ddb6SLionel Sambuc __x.swap(__y); 12154684ddb6SLionel Sambuc} 12164684ddb6SLionel Sambuc 12174684ddb6SLionel Sambuc_LIBCPP_END_NAMESPACE_STD 12184684ddb6SLionel Sambuc 12194684ddb6SLionel Sambuc#endif // _LIBCPP_SET 1220