You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 3 places in sparse_hash.h where MSVC gives the aforementioned warning (with /W4 level which is my default). All the conditions are indeed purely compile-time and should be replaced with constexpr. Will you accept a pull request if I fix this?
For example: if (sizeof(unsigned int) == sizeof(std::uint32_t))
The text was updated successfully, but these errors were encountered:
Yes, that would be an useful fix. The lib was developed before C++17 if constexpr and I just used a simple if to avoid std::enable_if at the time.
Could you keep the C++11/14 backward compatibility and only enable the change for C++17 and above (I should start to think to remove support for < C++17 though...)?
That's a good point, I didn't consider the need to support older compilers. In that case, I think, either #ifdef is required, or the old trick with bool const_condition(bool cond) { return cond; } - this will not generate the warning in debug, and should still be optimized away in release.
There are 3 places in sparse_hash.h where MSVC gives the aforementioned warning (with /W4 level which is my default). All the conditions are indeed purely compile-time and should be replaced with
constexpr
. Will you accept a pull request if I fix this?For example:
if (sizeof(unsigned int) == sizeof(std::uint32_t))
The text was updated successfully, but these errors were encountered: