const int c_nStep = 10;
int keys[1000];
- for ( key_type i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( key_type i = 0; i < static_cast<key_type>(sizeof(keys) / sizeof(keys[0])); ++i )
keys[i] = i;
std::random_shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
exempt_ptr xp;
// extract_min
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
xp = s.extract_min();
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract_min<Func>
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.insert( keys[i], keys[i] * c_nStep ));
nCount = 1;
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract_min_key
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.insert( keys[i], keys[i] * c_nStep ));
nCount = 1;
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract_max
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
nCount = 1;
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract_max<Func>
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
nCount = 1;
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract_max_key
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
nCount = 1;
CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
// extract
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- for ( int i = 0; i < sizeof( keys ) / sizeof( keys[0] ); ++i ) {
+ for ( int i = 0; i < static_cast<int>(sizeof( keys ) / sizeof( keys[0] )); ++i ) {
xp = s.extract(keys[i]);
CPPUNIT_CHECK_EX( xp->nVal == keys[i] * c_nStep, "Expected value=" << keys[i] * c_nStep << " real=" << xp->nVal );
}
// extract_with
- for ( int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i )
+ for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- for ( int i = 0; i < sizeof( keys ) / sizeof( keys[0] ); ++i ) {
+ for ( int i = 0; i < static_cast<int>(sizeof( keys ) / sizeof( keys[0] )); ++i ) {
xp = s.extract_with( wrapped_int(keys[i]), wrapped_less());
CPPUNIT_CHECK_EX( xp->nVal == keys[i] * c_nStep, "Expected value=" << keys[i] * c_nStep << " real=" << xp->nVal );
}