From ad1f4687368ea026a0060969da1edd4dc1abbbfe Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 29 Apr 2019 13:35:24 +0100 Subject: [PATCH] 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 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/bits/stl_bvector.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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(); } -- 2.30.2