[libcxx][test] Silence narrowing warning

This commit is contained in:
Casey Carter 2022-08-03 09:10:47 -07:00
parent 5b4f6d8b4b
commit 3a45677467
1 changed files with 4 additions and 1 deletions

View File

@ -131,7 +131,10 @@ struct SizedStrideCounter {
SizedStrideCounter operator++(int);
int& operator*() const;
bool operator==(SizedStrideCounter) const;
constexpr int operator-(SizedStrideCounter rhs) const { *minus_ += 1; return it_ - rhs.it_; }
constexpr int operator-(SizedStrideCounter rhs) const {
*minus_ += 1;
return static_cast<int>(it_ - rhs.it_);
}
};
static_assert(std::forward_iterator<SizedStrideCounter>);
static_assert(std::sized_sentinel_for<SizedStrideCounter, SizedStrideCounter>);