diff options
Diffstat (limited to 'libstdc++-v3/include')
65 files changed, 87 insertions, 78 deletions
diff --git a/libstdc++-v3/include/backward/hash_map b/libstdc++-v3/include/backward/hash_map index 9f47970..66a5218 100644 --- a/libstdc++-v3/include/backward/hash_map +++ b/libstdc++-v3/include/backward/hash_map @@ -166,7 +166,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return _M_ht.max_size(); } - bool + _GLIBCXX_NODISCARD bool empty() const { return _M_ht.empty(); } @@ -385,7 +385,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return _M_ht.max_size(); } - bool + _GLIBCXX_NODISCARD bool empty() const { return _M_ht.empty(); } diff --git a/libstdc++-v3/include/backward/hash_set b/libstdc++-v3/include/backward/hash_set index 2515cd1..2dc0ed7 100644 --- a/libstdc++-v3/include/backward/hash_set +++ b/libstdc++-v3/include/backward/hash_set @@ -168,7 +168,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return _M_ht.max_size(); } - bool + _GLIBCXX_NODISCARD bool empty() const { return _M_ht.empty(); } @@ -369,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return _M_ht.max_size(); } - bool + _GLIBCXX_NODISCARD bool empty() const { return _M_ht.empty(); } diff --git a/libstdc++-v3/include/backward/hashtable.h b/libstdc++-v3/include/backward/hashtable.h index a8cf149..28c487a 100644 --- a/libstdc++-v3/include/backward/hashtable.h +++ b/libstdc++-v3/include/backward/hashtable.h @@ -379,7 +379,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return size_type(-1); } - bool + _GLIBCXX_NODISCARD bool empty() const { return size() == 0; } diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index cea28e0..ed61ce8 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -301,7 +301,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Calls @c a.allocate(n) */ - static pointer + _GLIBCXX_NODISCARD static pointer allocate(_Alloc& __a, size_type __n) { return __a.allocate(__n); } @@ -316,7 +316,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Returns <tt> a.allocate(n, hint) </tt> if that expression is * well-formed, otherwise returns @c a.allocate(n) */ - static pointer + _GLIBCXX_NODISCARD static pointer allocate(_Alloc& __a, size_type __n, const_void_pointer __hint) { return _S_allocate(__a, __n, __hint, 0); } @@ -439,7 +439,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Calls @c a.allocate(n) */ - static pointer + _GLIBCXX_NODISCARD static pointer allocate(allocator_type& __a, size_type __n) { return __a.allocate(__n); } @@ -453,7 +453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * * Returns <tt> a.allocate(n, hint) </tt> */ - static pointer + _GLIBCXX_NODISCARD static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) { return __a.allocate(__n, __hint); } diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 28ed337..0a6dd3c 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1027,7 +1027,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * Returns true if the %string is empty. Equivalent to * <code>*this == ""</code>. */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return this->size() == 0; } @@ -4007,7 +4007,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 * Returns true if the %string is empty. Equivalent to * <code>*this == ""</code>. */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return this->size() == 0; } diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 4741c43..4c27784 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -774,7 +774,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * Returns true if the %forward_list is empty. (Thus begin() would * equal end().) */ - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return this->_M_impl._M_head._M_next == nullptr; } diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 34946c7..31794fb 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -533,7 +533,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size() const noexcept { return _M_element_count; } - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return size() == 0; } diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 7964594..7576cd7 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -1705,7 +1705,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * @retval true The %match_results object is empty. * @retval false The %match_results object is not empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return size() == 0; } diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 341682c..1574895 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -1377,7 +1377,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * Returns true if the %deque is empty. (Thus begin() would * equal end().) */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_finish == this->_M_impl._M_start; } diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 14a7881..68bab94 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -1047,7 +1047,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * Returns true if the %list is empty. (Thus begin() would equal * end().) */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; } diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index c2c974a..a61d23c 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -459,7 +459,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** Returns true if the %map is empty. (Thus begin() would equal * end().) */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 98796fd..29a96d8 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -452,7 +452,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // capacity /** Returns true if the %multimap is empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 175e075..7a0fb83 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -406,7 +406,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif /// Returns true if the %set is empty. - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index 575cbf9..aa8dd02 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * Returns true if the %queue is empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const { return c.empty(); } @@ -563,7 +563,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * Returns true if the %queue is empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const { return c.empty(); } diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 7779007..7c903cf 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -410,7 +410,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif /// Returns true if the %set is empty. - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return _M_t.empty(); } diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h index 88650c1..8581dce 100644 --- a/libstdc++-v3/include/bits/stl_stack.h +++ b/libstdc++-v3/include/bits/stl_stack.h @@ -181,7 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * Returns true if the %stack is empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const { return c.empty(); } diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 252ef95..47ae0ae 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -1027,7 +1027,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION rend() const _GLIBCXX_NOEXCEPT { return const_reverse_iterator(begin()); } - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return _M_impl._M_node_count == 0; } diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index ebf105a..54de0e0 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -964,7 +964,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * Returns true if the %vector is empty. (Thus begin() would * equal end().) */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return begin() == end(); } diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index 4b71db5..ecb3ef4 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -300,7 +300,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // size and capacity: /// Returns true if the %unordered_map is empty. - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_h.empty(); } @@ -1441,7 +1441,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // size and capacity: /// Returns true if the %unordered_multimap is empty. - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_h.empty(); } diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index e1ac398..3e1180f 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -294,7 +294,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // size and capacity: /// Returns true if the %unordered_set is empty. - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_h.empty(); } @@ -1102,7 +1102,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // size and capacity: /// Returns true if the %unordered_multiset is empty. - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_h.empty(); } diff --git a/libstdc++-v3/include/debug/array b/libstdc++-v3/include/debug/array index 0ca2fca..9e94e65 100644 --- a/libstdc++-v3/include/debug/array +++ b/libstdc++-v3/include/debug/array @@ -71,7 +71,7 @@ namespace __debug template<std::size_t _Size> struct _Array_check_nonempty { - bool empty() { return _Size == 0; } + _GLIBCXX_NODISCARD bool empty() { return _Size == 0; } _Array_check_nonempty() { __glibcxx_check_nonempty(); } @@ -145,7 +145,7 @@ namespace __debug constexpr size_type max_size() const noexcept { return _Nm; } - constexpr bool + _GLIBCXX_NODISCARD constexpr bool empty() const noexcept { return size() == 0; } // Element access. diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any index f8cd4a7..ed7a115 100644 --- a/libstdc++-v3/include/experimental/any +++ b/libstdc++-v3/include/experimental/any @@ -266,7 +266,7 @@ inline namespace fundamentals_v1 // observers /// Reports whether there is a contained object or not. - bool empty() const noexcept { return _M_manager == nullptr; } + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_manager == nullptr; } #if __cpp_rtti /// The @c typeid of the contained object, or @c typeid(void) if empty. diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index e9d6619..239776d 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -365,7 +365,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 // query - bool empty() const noexcept { return _M_pathname.empty(); } + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_pathname.empty(); } bool has_root_name() const; bool has_root_directory() const; bool has_root_path() const; diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet index 07c62e6..80682ef 100644 --- a/libstdc++-v3/include/experimental/internet +++ b/libstdc++-v3/include/experimental/internet @@ -1049,7 +1049,7 @@ namespace ip iterator begin() const noexcept { return _M_begin; } iterator end() const noexcept { return _M_end; } - bool empty() const noexcept { return _M_begin == _M_end; } + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_begin == _M_end; } size_t size() const noexcept { return _M_end->to_uint() - _M_begin->to_uint(); } @@ -1093,7 +1093,7 @@ namespace ip iterator begin() const noexcept { return _M_begin; } iterator end() const noexcept { return _M_end; } - bool empty() const noexcept { return _M_begin == _M_end; } + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_begin == _M_end; } iterator find(const address_v6& __addr) const noexcept @@ -1721,7 +1721,7 @@ namespace ip // size: size_type size() const noexcept { return _M_size; } size_type max_size() const noexcept { return _M_results.max_size(); } - bool empty() const noexcept { return _M_results.empty(); } + _GLIBCXX_NODISCARD bool empty() const noexcept { return _M_results.empty(); } // element access: const_iterator begin() const { return _M_results.begin(); } diff --git a/libstdc++-v3/include/experimental/memory_resource b/libstdc++-v3/include/experimental/memory_resource index 4d96466..e9fece5 100644 --- a/libstdc++-v3/include/experimental/memory_resource +++ b/libstdc++-v3/include/experimental/memory_resource @@ -88,7 +88,7 @@ namespace pmr { memory_resource& operator=(const memory_resource&) = default; - void* + _GLIBCXX_NODISCARD void* allocate(size_t __bytes, size_t __alignment = _S_max_align) { return do_allocate(__bytes, __alignment); } @@ -145,7 +145,7 @@ namespace pmr { polymorphic_allocator& operator=(const polymorphic_allocator& __rhs) = default; - _Tp* allocate(size_t __n) + _GLIBCXX_NODISCARD _Tp* allocate(size_t __n) { return static_cast<_Tp*>(_M_resource->allocate(__n * sizeof(_Tp), alignof(_Tp))); } diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view index d233ecc..8cc0e90 100644 --- a/libstdc++-v3/include/experimental/string_view +++ b/libstdc++-v3/include/experimental/string_view @@ -169,7 +169,7 @@ inline namespace fundamentals_v1 / sizeof(value_type) / 4; } - constexpr bool + _GLIBCXX_NODISCARD constexpr bool empty() const noexcept { return this->_M_len == 0; } diff --git a/libstdc++-v3/include/ext/alloc_traits.h b/libstdc++-v3/include/ext/alloc_traits.h index 5571d26..65fa3de 100644 --- a/libstdc++-v3/include/ext/alloc_traits.h +++ b/libstdc++-v3/include/ext/alloc_traits.h @@ -128,7 +128,7 @@ template<typename _Alloc, typename = typename _Alloc::value_type> typedef typename _Alloc::size_type size_type; typedef typename _Alloc::difference_type difference_type; - static pointer + _GLIBCXX_NODISCARD static pointer allocate(_Alloc& __a, size_type __n) { return __a.allocate(__n); } diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h index 6dd23cd..c0d4a34 100644 --- a/libstdc++-v3/include/ext/array_allocator.h +++ b/libstdc++-v3/include/ext/array_allocator.h @@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ~array_allocator() _GLIBCXX_USE_NOEXCEPT { } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const void* = 0) { if (_M_array == 0 || _M_used + __n > _M_array->size()) diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h index 400030b..532bad2 100644 --- a/libstdc++-v3/include/ext/bitmap_allocator.h +++ b/libstdc++-v3/include/ext/bitmap_allocator.h @@ -90,7 +90,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_space_left() const throw() { return _M_end_of_storage - _M_finish; } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n) { return static_cast<pointer>(::operator new(__n * sizeof(_Tp))); } @@ -1009,7 +1009,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ~bitmap_allocator() _GLIBCXX_USE_NOEXCEPT { } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n) { if (__n > this->max_size()) @@ -1033,7 +1033,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, typename bitmap_allocator<void>::const_pointer) { return allocate(__n); } diff --git a/libstdc++-v3/include/ext/debug_allocator.h b/libstdc++-v3/include/ext/debug_allocator.h index bf86470..c5fc57e 100644 --- a/libstdc++-v3/include/ext/debug_allocator.h +++ b/libstdc++-v3/include/ext/debug_allocator.h @@ -118,7 +118,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION debug_allocator(const _Alloc& __a) : _M_allocator(__a), _M_extra(_S_extra()) { } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n) { pointer __res = _M_allocator.allocate(__n + _M_extra); @@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __res + _M_extra; } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const void* __hint) { pointer __res = _M_allocator.allocate(__n + _M_extra, __hint); diff --git a/libstdc++-v3/include/ext/extptr_allocator.h b/libstdc++-v3/include/ext/extptr_allocator.h index 388edb2..2ce87b60 100644 --- a/libstdc++-v3/include/ext/extptr_allocator.h +++ b/libstdc++-v3/include/ext/extptr_allocator.h @@ -92,7 +92,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const_pointer address(const_reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } - pointer allocate(size_type __n, void* __hint = 0) + _GLIBCXX_NODISCARD pointer allocate(size_type __n, void* __hint = 0) { return _M_real_alloc.allocate(__n,__hint); } void deallocate(pointer __p, size_type __n) diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h index 7b07533..43e84f4 100644 --- a/libstdc++-v3/include/ext/mt_allocator.h +++ b/libstdc++-v3/include/ext/mt_allocator.h @@ -665,7 +665,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ~__mt_alloc() _GLIBCXX_USE_NOEXCEPT { } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const void* = 0); void @@ -684,7 +684,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; template<typename _Tp, typename _Poolp> - typename __mt_alloc<_Tp, _Poolp>::pointer + _GLIBCXX_NODISCARD typename __mt_alloc<_Tp, _Poolp>::pointer __mt_alloc<_Tp, _Poolp>:: allocate(size_type __n, const void*) { diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h index 04db4bb..e245391 100644 --- a/libstdc++-v3/include/ext/new_allocator.h +++ b/libstdc++-v3/include/ext/new_allocator.h @@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // NB: __n is permitted to be 0. The C++ standard says nothing // about what the return value is when __n == 0. - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const void* = static_cast<const void*>(0)) { if (__n > this->max_size()) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp index 5e73955..4019f86 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp @@ -39,6 +39,7 @@ */ PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp index 40ddeed5..dbfd612 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp @@ -144,7 +144,7 @@ namespace __gnu_pbds ~binary_heap(); - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline size_type diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp index 29612fa..d81d550 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp @@ -39,6 +39,7 @@ */ PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp index 6706c1a..1a6affc 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp @@ -271,7 +271,7 @@ namespace __gnu_pbds max_size() const; /// True if size() == 0. - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; /// Return current hash_fn. diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp index 7b5318b..9d38890 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp @@ -52,6 +52,7 @@ max_size() const { return m_entry_allocator.max_size(); } PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp index 500b92f..bcc1fc4 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp @@ -46,6 +46,7 @@ size() const { return m_num_used_e; } PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp index bcac913..90dfd50 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp @@ -279,7 +279,7 @@ namespace __gnu_pbds max_size() const; /// True if size() == 0. - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; /// Return current hash_fn. diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp index 64fa975..464216e 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp @@ -52,6 +52,7 @@ max_size() const { return s_entry_allocator.max_size(); } PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp index 8d31e5b..d12710a 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp @@ -39,6 +39,7 @@ */ PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp index 746a3d8..32d67eb 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp @@ -144,7 +144,7 @@ namespace __gnu_pbds ~left_child_next_sibling_heap(); - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline size_type diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp index 2c44a51..5d2e81f 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp @@ -51,6 +51,7 @@ max_size() const { return s_entry_allocator.max_size(); } PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp index e3539a5..a3c0fb4 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp @@ -198,7 +198,7 @@ namespace __gnu_pbds inline size_type max_size() const; - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline mapped_reference diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp index 26f33bf..81e7305 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp @@ -54,6 +54,7 @@ max_size() const { return s_value_alloc.max_size(); } PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp index efebc35..0859da1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp @@ -239,7 +239,7 @@ namespace __gnu_pbds inline size_type max_size() const; - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline size_type diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp index 0f6eaf5..33fc3e1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp @@ -39,6 +39,7 @@ */ PB_DS_CLASS_T_DEC +_GLIBCXX_NODISCARD inline bool PB_DS_CLASS_C_DEC:: empty() const diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp index 13da3d4..3f7e054 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp @@ -223,7 +223,7 @@ namespace __gnu_pbds } } - inline bool + _GLIBCXX_NODISCARD inline bool empty() const { return m_bag.empty(); } }; @@ -279,7 +279,7 @@ namespace __gnu_pbds ~PB_DS_PAT_TRIE_NAME(); - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline size_type diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp index 2d1b4e7..5c996d1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp @@ -87,7 +87,7 @@ namespace __gnu_pbds inline void pop(); - inline bool + _GLIBCXX_NODISCARD inline bool empty() const; inline size_type @@ -178,7 +178,7 @@ namespace __gnu_pbds } template<typename _Node, typename _Alloc> - inline bool + _GLIBCXX_NODISCARD inline bool rc<_Node, _Alloc>:: empty() const { diff --git a/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp b/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp index 980ff97..3b349c7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/tree_trace_base.hpp @@ -80,7 +80,7 @@ namespace __gnu_pbds void trace_node(node_const_iterator, size_type) const; - virtual bool + _GLIBCXX_NODISCARD virtual bool empty() const = 0; virtual node_const_iterator diff --git a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp index 0b0683d..9c750aa 100644 --- a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp @@ -315,7 +315,7 @@ namespace __gnu_pbds typedef typename __rebind_ma::reference metadata_reference; /// Returns true if the container is empty. - virtual bool + _GLIBCXX_NODISCARD virtual bool empty() const = 0; /// Returns the iterator associated with the trie's first element. diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h index 460f55d..4b23727 100644 --- a/libstdc++-v3/include/ext/pool_allocator.h +++ b/libstdc++-v3/include/ext/pool_allocator.h @@ -188,7 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION destroy(pointer __p) { __p->~_Tp(); } #endif - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const void* = 0); void @@ -210,7 +210,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __pool_alloc<_Tp>::_S_force_new; template<typename _Tp> - _Tp* + _GLIBCXX_NODISCARD _Tp* __pool_alloc<_Tp>::allocate(size_type __n, const void*) { pointer __ret = 0; diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index 4cc8285..127d113 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -1797,7 +1797,7 @@ protected: static int _S_compare(const _RopeRep* __x, const _RopeRep* __y); public: - bool + _GLIBCXX_NODISCARD bool empty() const { return 0 == this->_M_tree_ptr; } diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist index 532235f..3b49ae2 100644 --- a/libstdc++-v3/include/ext/slist +++ b/libstdc++-v3/include/ext/slist @@ -458,7 +458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const { return size_type(-1); } - bool + _GLIBCXX_NODISCARD bool empty() const { return this->_M_head._M_next == 0; } diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 52d58e6..38e80f7 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -829,7 +829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION address(const_reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } - pointer + _GLIBCXX_NODISCARD pointer allocate(size_type __n, std::allocator<void>::const_pointer hint = 0) { if (__n > this->max_size()) diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index ddffebf..5942218 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -518,7 +518,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Returns true if the %string is empty. Equivalent to * <code>*this == ""</code>. */ - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return this->size() == 0; } diff --git a/libstdc++-v3/include/profile/array b/libstdc++-v3/include/profile/array index dc7b594..8f80e2a 100644 --- a/libstdc++-v3/include/profile/array +++ b/libstdc++-v3/include/profile/array @@ -124,7 +124,7 @@ namespace __profile constexpr size_type max_size() const noexcept { return _Nm; } - constexpr bool + _GLIBCXX_NODISCARD constexpr bool empty() const noexcept { return size() == 0; } // Element access. diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array index ba52e3c2..02c6f4b 100644 --- a/libstdc++-v3/include/std/array +++ b/libstdc++-v3/include/std/array @@ -177,7 +177,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER constexpr size_type max_size() const noexcept { return _Nm; } - constexpr bool + _GLIBCXX_NODISCARD constexpr bool empty() const noexcept { return size() == 0; } // Element access. diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index 6cafde5..10136e5 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -1703,7 +1703,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// async template<typename _Fn, typename... _Args> - future<__async_result_of<_Fn, _Args...>> + _GLIBCXX_NODISCARD future<__async_result_of<_Fn, _Args...>> async(launch __policy, _Fn&& __fn, _Args&&... __args) { std::shared_ptr<__future_base::_State_base> __state; @@ -1736,7 +1736,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// async, potential overload template<typename _Fn, typename... _Args> - inline future<__async_result_of<_Fn, _Args...>> + _GLIBCXX_NODISCARD inline future<__async_result_of<_Fn, _Args...>> async(_Fn&& __fn, _Args&&... __args) { return std::async(launch::async|launch::deferred, diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator index 5a8495d..335df48 100644 --- a/libstdc++-v3/include/std/scoped_allocator +++ b/libstdc++-v3/include/std/scoped_allocator @@ -343,10 +343,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const outer_allocator_type& outer_allocator() const noexcept { return static_cast<const _OuterAlloc&>(*this); } - pointer allocate(size_type __n) + _GLIBCXX_NODISCARD pointer allocate(size_type __n) { return __traits::allocate(outer_allocator(), __n); } - pointer allocate(size_type __n, const_void_pointer __hint) + _GLIBCXX_NODISCARD pointer allocate(size_type __n, const_void_pointer __hint) { return __traits::allocate(outer_allocator(), __n, __hint); } void deallocate(pointer __p, size_type __n) diff --git a/libstdc++-v3/include/tr1/array b/libstdc++-v3/include/tr1/array index e8266d7..5c0857b 100644 --- a/libstdc++-v3/include/tr1/array +++ b/libstdc++-v3/include/tr1/array @@ -119,7 +119,7 @@ namespace tr1 size_type max_size() const { return _Nm; } - bool + _GLIBCXX_NODISCARD bool empty() const { return size() == 0; } // Element access. diff --git a/libstdc++-v3/include/tr1/hashtable.h b/libstdc++-v3/include/tr1/hashtable.h index eed79ef..c1b5c9e 100644 --- a/libstdc++-v3/include/tr1/hashtable.h +++ b/libstdc++-v3/include/tr1/hashtable.h @@ -244,7 +244,7 @@ namespace tr1 size() const { return _M_element_count; } - bool + _GLIBCXX_NODISCARD bool empty() const { return size() == 0; } diff --git a/libstdc++-v3/include/tr1/regex b/libstdc++-v3/include/tr1/regex index f0d0742..73c610d 100644 --- a/libstdc++-v3/include/tr1/regex +++ b/libstdc++-v3/include/tr1/regex @@ -1870,7 +1870,7 @@ namespace regex_constants * @retval true The %match_results object is empty. * @retval false The %match_results object is not empty. */ - bool + _GLIBCXX_NODISCARD bool empty() const { return size() == 0; } diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset index fb022f3..434a4cc 100644 --- a/libstdc++-v3/include/tr2/dynamic_bitset +++ b/libstdc++-v3/include/tr2/dynamic_bitset @@ -1014,7 +1014,7 @@ namespace tr2 { return this->_M_size(); } /// Returns true if the dynamic_bitset is empty. - bool + _GLIBCXX_NODISCARD bool empty() const noexcept { return (this->_M_Nb == 0); } |