From: Jonathan Wakely Date: Mon, 29 Apr 2019 12:35:24 +0000 (+0100) Subject: Add nodiscard to std::vector::empty() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad1f4687368ea026a0060969da1edd4dc1abbbfe;p=gcc.git Add nodiscard to std::vector::empty() We already added it to the std::vector primary template. * include/bits/stl_bvector.h (vector::empty()): Add nodiscard attribute. From-SVN: r270648 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5112bc8c60f..a5482bbcdf7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-04-29 Jonathan Wakely + * include/bits/stl_bvector.h (vector::empty()): Add nodiscard + attribute. + * include/bits/stl_iterator_base_types.h (_Iter_base): Remove unused class template and partial specialization. diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 294f1e42897..c60f4f0ef1c 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -878,7 +878,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return size_type(const_iterator(this->_M_impl._M_end_addr(), 0) - begin()); } - bool + _GLIBCXX_NODISCARD bool empty() const _GLIBCXX_NOEXCEPT { return begin() == end(); }