summaryrefslogtreecommitdiffstats
path: root/libcxx/include/set
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2017-11-15 05:51:26 +0000
committerMarshall Clow <mclow.lists@gmail.com>2017-11-15 05:51:26 +0000
commit72c8fad4270a9810e7868892910b8029e8a92b1c (patch)
treea74afdae3cd83274231149fa36dd5b33194bbda7 /libcxx/include/set
parent260ad71dfee02ba2cc49541de8f70c9b897bb4a5 (diff)
downloadbcm5719-llvm-72c8fad4270a9810e7868892910b8029e8a92b1c.tar.gz
bcm5719-llvm-72c8fad4270a9810e7868892910b8029e8a92b1c.zip
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
Diffstat (limited to 'libcxx/include/set')
-rw-r--r--libcxx/include/set4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/set b/libcxx/include/set
index 30f2fa88f25..b4c6b2ef8c5 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -575,7 +575,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const _NOEXCEPT {return __tree_.size();}
@@ -984,7 +984,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const _NOEXCEPT {return __tree_.size();}
OpenPOWER on IntegriCloud