Skip to content

Commit

Permalink
Fix ambiguous operator overload in libc++19
Browse files Browse the repository at this point in the history
Summary:
libc++ 19 flags this statement as ambiguous.
```
error: use of overloaded operator '=' is ambiguous (with operand types 'std::pair<uint8_t *, uint8_t *>' (aka 'pair<unsigned char *, unsigned char *>') and 'void')
   76 |       other.cachedRange = {};
```

Explicitly qualify this with `std::pair<uint8_t *, uint8_t *>` to avoid the ambiguity.

Reviewed By: yozhu

Differential Revision: D64374395

fbshipit-source-id: 2bdb0e55c82b58652be54b2cca8e1dfec8dba07e
  • Loading branch information
thevinster authored and facebook-github-bot committed Oct 15, 2024
1 parent bb7048f commit 285f95c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/io/IOBufQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class IOBufQueue {

WritableRangeCacheData(WritableRangeCacheData&& other) noexcept
: cachedRange(other.cachedRange), attached(other.attached) {
other.cachedRange = {};
other.cachedRange = std::pair<uint8_t*, uint8_t*>{};
other.attached = {};
}
WritableRangeCacheData& operator=(WritableRangeCacheData&& other) noexcept {
Expand Down

0 comments on commit 285f95c

Please sign in to comment.