1
0
forked from boostorg/core

More -Wconversion fixes for GCC 10 and below

This commit is contained in:
Peter Dimov
2023-05-31 19:54:43 +03:00
parent 266fbe6449
commit 7ab05d5de0
6 changed files with 8 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ template<class T> void test_countr( T x )
{
x |= 1;
for( int i = 0; i <= std::numeric_limits<T>::digits; ++i, x <<= 1 )
for( int i = 0; i <= std::numeric_limits<T>::digits; ++i, x = static_cast<T>( x << 1 ) )
{
BOOST_TEST_EQ( boost::core::countr_zero( x ), i );
BOOST_TEST_EQ( boost::core::countr_one( static_cast<T>( ~x ) ), i );