Skip to content

Commit

Permalink
Avoid array-comparison warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Jul 30, 2022
1 parent 440c527 commit 4693e81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class FixedArray {

private:
void CopyFrom(const FixedArray<T, N, IDX> &other) {
if (data_ != other.data_) memcpy(data_, other.data_, sizeof(data_));
// Unary + to decay array to pointer and avoid array-comparison warning.
if (+data_ != +other.data_) memcpy(data_, other.data_, sizeof(data_));
}

T data_[N];
Expand Down

0 comments on commit 4693e81

Please # to comment.