diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2017-11-15 05:51:26 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2017-11-15 05:51:26 +0000 |
| commit | 72c8fad4270a9810e7868892910b8029e8a92b1c (patch) | |
| tree | a74afdae3cd83274231149fa36dd5b33194bbda7 /libcxx/include/unordered_map | |
| parent | 260ad71dfee02ba2cc49541de8f70c9b897bb4a5 (diff) | |
| download | bcm5719-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/unordered_map')
| -rw-r--r-- | libcxx/include/unordered_map | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 0546c0e2f9f..725cb6af275 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -885,7 +885,7 @@ public: allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__table_.__node_alloc());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return __table_.size() == 0;} _LIBCPP_INLINE_VISIBILITY size_type size() const _NOEXCEPT {return __table_.size();} @@ -1634,7 +1634,7 @@ public: allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__table_.__node_alloc());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return __table_.size() == 0;} _LIBCPP_INLINE_VISIBILITY size_type size() const _NOEXCEPT {return __table_.size();} |

