From 72c8fad4270a9810e7868892910b8029e8a92b1c Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 15 Nov 2017 05:51:26 +0000 Subject: First part of P0600 - '[[nodiscard] in the standard library'. Mark the 'empty()' methods of all the containers as nodiscard. If you're calling empty() w/o looking at the result, you probably meanto to call 'clear()'. c++2a only llvm-svn: 318269 --- libcxx/include/queue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcxx/include/queue') diff --git a/libcxx/include/queue b/libcxx/include/queue index feaae892046..670fbb722ee 100644 --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -268,7 +268,7 @@ public: #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} _LIBCPP_INLINE_VISIBILITY size_type size() const {return c.size();} @@ -490,7 +490,7 @@ public: _Alloc>::value>::type* = 0); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} _LIBCPP_INLINE_VISIBILITY size_type size() const {return c.size();} -- cgit v1.2.3