Merge pull request #106 from cmazakas/missing-nodiscard

Add missing `[[nodiscard]]` qualifiers as outlined by C++20
This commit is contained in:
Peter Dimov
2022-02-24 18:00:00 +02:00
committed by GitHub
6 changed files with 32 additions and 14 deletions

View File

@ -87,7 +87,7 @@ namespace boost {
const_iterator xref:#unordered_map_cend[cend]() const noexcept;
// capacity
bool xref:#unordered_map_empty[empty]() const noexcept;
++[[nodiscard]]++ bool xref:#unordered_map_empty[empty]() const noexcept;
size_type xref:#unordered_map_size[size]() const noexcept;
size_type xref:#unordered_map_max_size[max_size]() const noexcept;
@ -633,7 +633,7 @@ Returns:;; A `const_iterator` which refers to the past-the-end value for the con
==== empty
```c++
bool empty() const noexcept;
[[nodiscard]] bool empty() const noexcept;
```
[horizontal]

View File

@ -88,7 +88,7 @@ namespace boost {
const_iterator xref:#unordered_multimap_cend[cend]() const noexcept;
// capacity
bool xref:#unordered_multimap_empty[empty]() const noexcept;
++[[nodiscard]]++ bool xref:#unordered_multimap_empty[empty]() const noexcept;
size_type xref:#unordered_multimap_size[size]() const noexcept;
size_type xref:#unordered_multimap_max_size[max_size]() const noexcept;
@ -617,7 +617,7 @@ Returns:;; A `const_iterator` which refers to the past-the-end value for the con
==== empty
```c++
bool empty() const noexcept;
[[nodiscard]] bool empty() const noexcept;
```
[horizontal]

View File

@ -84,7 +84,7 @@ namespace boost {
const_iterator xref:#unordered_multiset_cend[cend]() const noexcept;
// capacity
bool xref:#unordered_multiset_empty[empty]() const noexcept;
++[[nodiscard]]++ bool xref:#unordered_multiset_empty[empty]() const noexcept;
size_type xref:#unordered_multiset_size[size]() const noexcept;
size_type xref:#unordered_multiset_max_size[max_size]() const noexcept;
@ -611,7 +611,7 @@ Returns:;; A `const_iterator` which refers to the past-the-end value for the con
==== empty
```c++
bool empty() const noexcept;
[[nodiscard]] bool empty() const noexcept;
```
[horizontal]

View File

@ -85,7 +85,7 @@ namespace boost {
const_iterator xref:#unordered_set_cend[cend]() const noexcept;
// capacity
bool xref:#unordered_set_empty[empty]() const noexcept;
++[[nodiscard]]++ bool xref:#unordered_set_empty[empty]() const noexcept;
size_type xref:#unordered_set_size[size]() const noexcept;
size_type xref:#unordered_set_max_size[max_size]() const noexcept;
@ -622,7 +622,7 @@ Returns:;; A `const_iterator` which refers to the past-the-end value for the con
==== empty
```c++
bool empty() const noexcept;
[[nodiscard]] bool empty() const noexcept;
```
[horizontal]

View File

@ -210,7 +210,10 @@ namespace boost {
// size and capacity
bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return table_.size_ == 0;
}
size_type size() const BOOST_NOEXCEPT { return table_.size_; }
@ -1177,7 +1180,10 @@ namespace boost {
// size and capacity
bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return table_.size_ == 0;
}
size_type size() const BOOST_NOEXCEPT { return table_.size_; }
@ -2719,7 +2725,10 @@ namespace boost {
bool operator!() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
bool empty() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return ptr_ ? 0 : 1;
}
void swap(node_handle_map& n) BOOST_NOEXCEPT_IF(
value_allocator_traits::propagate_on_container_swap::value ||

View File

@ -208,7 +208,10 @@ namespace boost {
// size and capacity
bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return table_.size_ == 0;
}
size_type size() const BOOST_NOEXCEPT { return table_.size_; }
@ -835,7 +838,10 @@ namespace boost {
// size and capacity
bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return table_.size_ == 0;
}
size_type size() const BOOST_NOEXCEPT { return table_.size_; }
@ -2183,7 +2189,10 @@ namespace boost {
bool operator!() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
bool empty() const BOOST_NOEXCEPT { return ptr_ ? 0 : 1; }
BOOST_ATTRIBUTE_NODISCARD bool empty() const BOOST_NOEXCEPT
{
return ptr_ ? 0 : 1;
}
void swap(node_handle_set& n) BOOST_NOEXCEPT_IF(
value_allocator_traits::propagate_on_container_swap::value ||