Skip to content
Open
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 tsl/platform/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class RefCountPtr;

// Adds a new reference to a RefCounted pointer.
template <typename T>
ABSL_MUST_USE_RESULT RefCountPtr<T> GetNewRef(T* ptr) {
[[nodiscard]] RefCountPtr<T> GetNewRef(T* ptr) {
static_assert(std::is_base_of<RefCounted, T>::value);

if (ptr == nullptr) return RefCountPtr<T>();
Expand All @@ -103,7 +103,7 @@ class ABSL_NULLABILITY_COMPATIBLE RefCountPtr
: public std::unique_ptr<T, RefCountDeleter> {
public:
using std::unique_ptr<T, RefCountDeleter>::unique_ptr;
ABSL_MUST_USE_RESULT RefCountPtr GetNewRef() const {
[[nodiscard]] RefCountPtr GetNewRef() const {
if (this->get() == nullptr) return RefCountPtr<T>();
this->get()->Ref();
return RefCountPtr<T>(this->get());
Expand Down
Loading