Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stl/inc/queue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public:
: c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {}
#endif // _HAS_CXX23

_NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
_NODISCARD_EMPTY_MEMBER_NO_CLEAR bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
return c.empty();
}

Expand Down Expand Up @@ -354,7 +354,7 @@ public:
}
#endif // _HAS_CXX23

_NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
_NODISCARD_EMPTY_MEMBER_NO_CLEAR bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
return c.empty();
}

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/stack
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public:
: c(_RANGES to<_Container>(_STD forward<_Rng>(_Range), _Al)) {}
#endif // _HAS_CXX23

_NODISCARD_EMPTY_ADAPTOR_MEMBER bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
_NODISCARD_EMPTY_MEMBER_NO_CLEAR bool empty() const noexcept(noexcept(c.empty())) /* strengthened */ {
return c.empty();
}

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/stacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public:
return _Frames.crend();
}

_NODISCARD_EMPTY_STACKTRACE_MEMBER bool empty() const noexcept {
_NODISCARD_EMPTY_MEMBER_NO_CLEAR bool empty() const noexcept {
return _Frames.empty();
}

Expand Down
39 changes: 16 additions & 23 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,34 +597,27 @@
_NODISCARD_MSG("The 'unique' algorithm returns the iterator past the last element that should be kept. " \
"You need to call container.erase(result, container.end()) afterwards.")

#define _NODISCARD_EMPTY_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the container is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
#define _NODISCARD_EMPTY_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the collection is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
"Use the 'clear()' member function if you want to erase all elements.")

#define _NODISCARD_EMPTY_ARRAY_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the container is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
#define _NODISCARD_EMPTY_ARRAY_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the array is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
"There's no way to clear an array as its size is fixed.")

#define _NODISCARD_EMPTY_STACKTRACE_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the container is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
"'std::stacktrace' can be cleared by assigning an empty value to it.")
#define _NODISCARD_EMPTY_MEMBER_NO_CLEAR \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the collection is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
"This collection can be cleared by assigning an empty value to it.")

#define _NODISCARD_EMPTY_NON_MEMBER \
_NODISCARD_MSG( \
"This function returns a bool indicating whether the container or container-like object is empty and " \
"has no other effects. It is not useful to call this function and discard the return value.")

#define _NODISCARD_EMPTY_ADAPTOR_MEMBER \
_NODISCARD_MSG( \
"This member function returns a bool indicating whether the container is empty and has no other effects. " \
"It is not useful to call this member function and discard the return value. " \
"Container adaptors don't provide 'clear()' member functions, but you can assign an empty object to them.")
#define _NODISCARD_EMPTY_NON_MEMBER \
_NODISCARD_MSG("This function returns a bool indicating whether the collection is empty and " \
"has no other effects. It is not useful to call this function and discard the return value.")

#define _NODISCARD_BARRIER_TOKEN \
_NODISCARD_MSG("The token from 'arrive()' should not be discarded; it should be passed to 'wait()'.")
Expand Down