return const_iterator(getBucketsEnd(), getBucketsEnd(), *this, true);
}
- bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
+ LLVM_NODISCARD bool empty() const {
return getNumEntries() == 0;
}
unsigned size() const { return getNumEntries(); }
} while (!V.empty() && V.back() == T());
}
- T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
+ LLVM_NODISCARD T pop_back_val() {
T Ret = back();
pop_back();
return Ret;
//
// Interface is specified by p0052r2.
template <typename Callable>
-detail::scope_exit<typename std::decay<Callable>::type>
- LLVM_ATTRIBUTE_UNUSED_RESULT make_scope_exit(Callable &&F) {
+LLVM_NODISCARD detail::scope_exit<typename std::decay<Callable>::type>
+make_scope_exit(Callable &&F) {
return detail::scope_exit<typename std::decay<Callable>::type>(
std::forward<Callable>(F));
}
vector_.pop_back();
}
- T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
+ LLVM_NODISCARD T pop_back_val() {
T Ret = back();
pop_back();
return Ret;
public:
typedef unsigned size_type;
- bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return size() == 0; }
+ LLVM_NODISCARD bool empty() const { return size() == 0; }
size_type size() const { return NumNonEmpty - NumTombstones; }
void clear() {
typedef size_t size_type;
SmallSet() {}
- bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
+ LLVM_NODISCARD bool empty() const {
return Vector.empty() && Set.empty();
}
return size_t((char*)CapacityX - (char*)BeginX);
}
- bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return BeginX == EndX; }
+ LLVM_NODISCARD bool empty() const { return BeginX == EndX; }
};
template <typename T, unsigned N> struct SmallVectorStorage;
this->grow(N);
}
- T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
+ LLVM_NODISCARD T pop_back_val() {
T Result = ::std::move(this->back());
this->pop_back();
return Result;
}
/// Check if the list is empty in constant time.
- bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return Sentinel.empty(); }
+ LLVM_NODISCARD bool empty() const { return Sentinel.empty(); }
/// Calculate the size of the list in linear time.
- size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const {
+ LLVM_NODISCARD size_type size() const {
return std::distance(begin(), end());
}