Fix compilation of stream position checks with MSVC

CHECK(pubseekoff(...) == int) failed to compile because of an ambiguity
due to multiple overloaded operator==()s in MSVC CRT.

Add a global operator==() overload matching the actual types to help
this compiler to do the right thing.

This should be reverted when support for MSVS 2015 is dropped.
This commit is contained in:
Vadim Zeitlin
2026-08-24 19:56:07 +02:00
parent 39ac888eff
commit f1810bb960
+10
View File
@@ -51,6 +51,16 @@ protected:
} // anonymous namespace
// MSVS 2015 can't compile CHECK()s in this file without this disambiguation.
#ifdef __VISUALC__
#if __VISUALC__ < 1910
inline bool operator==(const std::fpos<_Mbstatet> lhs, const int rhs)
{
return static_cast<int>(lhs) == rhs;
}
#endif // MSVS 2015
#endif // __VISUALC__
// ==========================================================================
// Tests
// ==========================================================================