@@ -1778,28 +1778,36 @@ public:
17781778 static_assert (sizeof (std::__diagnose_non_const_comparator<_Key, _Compare>()), " " );
17791779 }
17801780
1781- _LIBCPP_HIDE_FROM_ABI iterator begin () _NOEXCEPT { return __tree_.begin (); }
1782- _LIBCPP_HIDE_FROM_ABI const_iterator begin () const _NOEXCEPT { return __tree_.begin (); }
1783- _LIBCPP_HIDE_FROM_ABI iterator end () _NOEXCEPT { return __tree_.end (); }
1784- _LIBCPP_HIDE_FROM_ABI const_iterator end () const _NOEXCEPT { return __tree_.end (); }
1781+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator begin () _NOEXCEPT { return __tree_.begin (); }
1782+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator begin () const _NOEXCEPT { return __tree_.begin (); }
1783+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator end () _NOEXCEPT { return __tree_.end (); }
1784+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator end () const _NOEXCEPT { return __tree_.end (); }
17851785
1786- _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin () _NOEXCEPT { return reverse_iterator (end ()); }
1787- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin () const _NOEXCEPT { return const_reverse_iterator (end ()); }
1788- _LIBCPP_HIDE_FROM_ABI reverse_iterator rend () _NOEXCEPT { return reverse_iterator (begin ()); }
1789- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend () const _NOEXCEPT { return const_reverse_iterator (begin ()); }
1786+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin () _NOEXCEPT { return reverse_iterator (end ()); }
1787+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin () const _NOEXCEPT {
1788+ return const_reverse_iterator (end ());
1789+ }
1790+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI reverse_iterator rend () _NOEXCEPT { return reverse_iterator (begin ()); }
1791+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend () const _NOEXCEPT {
1792+ return const_reverse_iterator (begin ());
1793+ }
17901794
1791- _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const _NOEXCEPT { return begin (); }
1792- _LIBCPP_HIDE_FROM_ABI const_iterator cend () const _NOEXCEPT { return end (); }
1793- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin () const _NOEXCEPT { return rbegin (); }
1794- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend () const _NOEXCEPT { return rend (); }
1795+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const _NOEXCEPT { return begin (); }
1796+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator cend () const _NOEXCEPT { return end (); }
1797+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin () const _NOEXCEPT { return rbegin (); }
1798+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend () const _NOEXCEPT { return rend (); }
17951799
17961800 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty () const _NOEXCEPT { return __tree_.size () == 0 ; }
1797- _LIBCPP_HIDE_FROM_ABI size_type size () const _NOEXCEPT { return __tree_.size (); }
1798- _LIBCPP_HIDE_FROM_ABI size_type max_size () const _NOEXCEPT { return __tree_.max_size (); }
1801+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type size () const _NOEXCEPT { return __tree_.size (); }
1802+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type max_size () const _NOEXCEPT { return __tree_.max_size (); }
17991803
1800- _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator () const _NOEXCEPT { return allocator_type (__tree_.__alloc ()); }
1801- _LIBCPP_HIDE_FROM_ABI key_compare key_comp () const { return __tree_.value_comp ().key_comp (); }
1802- _LIBCPP_HIDE_FROM_ABI value_compare value_comp () const { return value_compare (__tree_.value_comp ().key_comp ()); }
1804+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator () const _NOEXCEPT {
1805+ return allocator_type (__tree_.__alloc ());
1806+ }
1807+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI key_compare key_comp () const { return __tree_.value_comp ().key_comp (); }
1808+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI value_compare value_comp () const {
1809+ return value_compare (__tree_.value_comp ().key_comp ());
1810+ }
18031811
18041812# ifndef _LIBCPP_CXX03_LANG
18051813
@@ -1869,10 +1877,10 @@ public:
18691877 " node_type with incompatible allocator passed to multimap::insert()" );
18701878 return __tree_.template __node_handle_insert_multi <node_type>(__hint.__i_ , std::move (__nh));
18711879 }
1872- _LIBCPP_HIDE_FROM_ABI node_type extract (key_type const & __key) {
1880+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract (key_type const & __key) {
18731881 return __tree_.template __node_handle_extract <node_type>(__key);
18741882 }
1875- _LIBCPP_HIDE_FROM_ABI node_type extract (const_iterator __it) {
1883+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI node_type extract (const_iterator __it) {
18761884 return __tree_.template __node_handle_extract <node_type>(__it.__i_ );
18771885 }
18781886 template <class _Compare2 >
@@ -1907,83 +1915,89 @@ public:
19071915 __tree_.swap (__m.__tree_ );
19081916 }
19091917
1910- _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __k) { return __tree_.find (__k); }
1911- _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __k) const { return __tree_.find (__k); }
1918+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __k) { return __tree_.find (__k); }
1919+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __k) const { return __tree_.find (__k); }
19121920# if _LIBCPP_STD_VER >= 14
19131921 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1914- _LIBCPP_HIDE_FROM_ABI iterator find (const _K2& __k) {
1922+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator find (const _K2& __k) {
19151923 return __tree_.find (__k);
19161924 }
19171925 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1918- _LIBCPP_HIDE_FROM_ABI const_iterator find (const _K2& __k) const {
1926+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator find (const _K2& __k) const {
19191927 return __tree_.find (__k);
19201928 }
19211929# endif
19221930
1923- _LIBCPP_HIDE_FROM_ABI size_type count (const key_type& __k) const { return __tree_.__count_multi (__k); }
1931+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count (const key_type& __k) const {
1932+ return __tree_.__count_multi (__k);
1933+ }
19241934# if _LIBCPP_STD_VER >= 14
19251935 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1926- _LIBCPP_HIDE_FROM_ABI size_type count (const _K2& __k) const {
1936+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_type count (const _K2& __k) const {
19271937 return __tree_.__count_multi (__k);
19281938 }
19291939# endif
19301940
19311941# if _LIBCPP_STD_VER >= 20
1932- _LIBCPP_HIDE_FROM_ABI bool contains (const key_type& __k) const { return find (__k) != end (); }
1942+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains (const key_type& __k) const { return find (__k) != end (); }
19331943 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1934- _LIBCPP_HIDE_FROM_ABI bool contains (const _K2& __k) const {
1944+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool contains (const _K2& __k) const {
19351945 return find (__k) != end ();
19361946 }
19371947# endif // _LIBCPP_STD_VER >= 20
19381948
1939- _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const key_type& __k) { return __tree_.__lower_bound_multi (__k); }
1949+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const key_type& __k) {
1950+ return __tree_.__lower_bound_multi (__k);
1951+ }
19401952
1941- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const key_type& __k) const {
1953+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const key_type& __k) const {
19421954 return __tree_.__lower_bound_multi (__k);
19431955 }
19441956
19451957# if _LIBCPP_STD_VER >= 14
19461958 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1947- _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const _K2& __k) {
1959+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const _K2& __k) {
19481960 return __tree_.__lower_bound_multi (__k);
19491961 }
19501962
19511963 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1952- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const _K2& __k) const {
1964+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const _K2& __k) const {
19531965 return __tree_.__lower_bound_multi (__k);
19541966 }
19551967# endif
19561968
1957- _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const key_type& __k) { return __tree_.__upper_bound_multi (__k); }
1969+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const key_type& __k) {
1970+ return __tree_.__upper_bound_multi (__k);
1971+ }
19581972
1959- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const key_type& __k) const {
1973+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const key_type& __k) const {
19601974 return __tree_.__upper_bound_multi (__k);
19611975 }
19621976
19631977# if _LIBCPP_STD_VER >= 14
19641978 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1965- _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const _K2& __k) {
1979+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const _K2& __k) {
19661980 return __tree_.__upper_bound_multi (__k);
19671981 }
19681982 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1969- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const _K2& __k) const {
1983+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const _K2& __k) const {
19701984 return __tree_.__upper_bound_multi (__k);
19711985 }
19721986# endif
19731987
1974- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __k) {
1988+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __k) {
19751989 return __tree_.__equal_range_multi (__k);
19761990 }
1977- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __k) const {
1991+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __k) const {
19781992 return __tree_.__equal_range_multi (__k);
19791993 }
19801994# if _LIBCPP_STD_VER >= 14
19811995 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1982- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _K2& __k) {
1996+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _K2& __k) {
19831997 return __tree_.__equal_range_multi (__k);
19841998 }
19851999 template <typename _K2, enable_if_t <__is_transparent_v<_Compare, _K2>, int > = 0 >
1986- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _K2& __k) const {
2000+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _K2& __k) const {
19872001 return __tree_.__equal_range_multi (__k);
19882002 }
19892003# endif
0 commit comments