mirror of
https://github.com/boostorg/container.git
synced 2026-01-19 04:02:17 +00:00
Remove unneeded scope
This commit is contained in:
@@ -1546,138 +1546,136 @@ bool instantiate_constructors()
|
||||
template<typename IntMapType, typename IntMultimapType>
|
||||
bool test_heterogeneous_lookup()
|
||||
{
|
||||
{
|
||||
typedef IntMapType map_t;
|
||||
typedef IntMultimapType mmap_t;
|
||||
typedef typename map_t::value_type value_type;
|
||||
typedef IntMapType map_t;
|
||||
typedef IntMultimapType mmap_t;
|
||||
typedef typename map_t::value_type value_type;
|
||||
|
||||
map_t map1;
|
||||
const map_t &cmap1 = map1;
|
||||
map_t map1;
|
||||
const map_t &cmap1 = map1;
|
||||
|
||||
if(!map1.insert_or_assign(1, 'a').second)
|
||||
return false;
|
||||
if( map1.insert_or_assign(1, 'b').second)
|
||||
return false;
|
||||
if(!map1.insert_or_assign(2, 'c').second)
|
||||
return false;
|
||||
if( map1.insert_or_assign(2, 'd').second)
|
||||
return false;
|
||||
if(!map1.insert_or_assign(3, 'e').second)
|
||||
return false;
|
||||
if(!map1.insert_or_assign(1, 'a').second)
|
||||
return false;
|
||||
if( map1.insert_or_assign(1, 'b').second)
|
||||
return false;
|
||||
if(!map1.insert_or_assign(2, 'c').second)
|
||||
return false;
|
||||
if( map1.insert_or_assign(2, 'd').second)
|
||||
return false;
|
||||
if(!map1.insert_or_assign(3, 'e').second)
|
||||
return false;
|
||||
|
||||
mmap_t mmap1;
|
||||
const mmap_t &cmmap1 = mmap1;
|
||||
mmap_t mmap1;
|
||||
const mmap_t &cmmap1 = mmap1;
|
||||
|
||||
mmap1.insert(value_type(1, 'a'));
|
||||
mmap1.insert(value_type(1, 'b'));
|
||||
mmap1.insert(value_type(2, 'c'));
|
||||
mmap1.insert(value_type(2, 'd'));
|
||||
mmap1.insert(value_type(3, 'e'));
|
||||
mmap1.insert(value_type(1, 'a'));
|
||||
mmap1.insert(value_type(1, 'b'));
|
||||
mmap1.insert(value_type(2, 'c'));
|
||||
mmap1.insert(value_type(2, 'd'));
|
||||
mmap1.insert(value_type(3, 'e'));
|
||||
|
||||
const test::non_copymovable_int find_me(2);
|
||||
const test::non_copymovable_int not_present(5);
|
||||
const test::non_copymovable_int find_me(2);
|
||||
const test::non_copymovable_int not_present(5);
|
||||
|
||||
//find
|
||||
if(map1.find(find_me)->second != 'd')
|
||||
return false;
|
||||
if(cmap1.find(find_me)->second != 'd')
|
||||
return false;
|
||||
if(mmap1.find(find_me)->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.find(find_me)->second != 'c')
|
||||
return false;
|
||||
if(map1.find(not_present) != map1.end())
|
||||
return false;
|
||||
if(cmap1.find(not_present) != cmap1.end())
|
||||
return false;
|
||||
if(mmap1.find(not_present) != mmap1.end())
|
||||
return false;
|
||||
if(cmmap1.find(not_present) != mmap1.cend())
|
||||
return false;
|
||||
//find
|
||||
if(map1.find(find_me)->second != 'd')
|
||||
return false;
|
||||
if(cmap1.find(find_me)->second != 'd')
|
||||
return false;
|
||||
if(mmap1.find(find_me)->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.find(find_me)->second != 'c')
|
||||
return false;
|
||||
if(map1.find(not_present) != map1.end())
|
||||
return false;
|
||||
if(cmap1.find(not_present) != cmap1.end())
|
||||
return false;
|
||||
if(mmap1.find(not_present) != mmap1.end())
|
||||
return false;
|
||||
if(cmmap1.find(not_present) != mmap1.cend())
|
||||
return false;
|
||||
|
||||
|
||||
//count
|
||||
if(map1.count(find_me) != 1)
|
||||
return false;
|
||||
if(cmap1.count(find_me) != 1)
|
||||
return false;
|
||||
if(mmap1.count(find_me) != 2)
|
||||
return false;
|
||||
if(cmmap1.count(find_me) != 2)
|
||||
return false;
|
||||
if(map1.count(not_present) != 0)
|
||||
return false;
|
||||
if(cmap1.count(not_present) != 0)
|
||||
return false;
|
||||
if(mmap1.count(not_present) != 0)
|
||||
return false;
|
||||
if(cmmap1.count(not_present) != 0)
|
||||
return false;
|
||||
//count
|
||||
if(map1.count(find_me) != 1)
|
||||
return false;
|
||||
if(cmap1.count(find_me) != 1)
|
||||
return false;
|
||||
if(mmap1.count(find_me) != 2)
|
||||
return false;
|
||||
if(cmmap1.count(find_me) != 2)
|
||||
return false;
|
||||
if(map1.count(not_present) != 0)
|
||||
return false;
|
||||
if(cmap1.count(not_present) != 0)
|
||||
return false;
|
||||
if(mmap1.count(not_present) != 0)
|
||||
return false;
|
||||
if(cmmap1.count(not_present) != 0)
|
||||
return false;
|
||||
|
||||
//contains
|
||||
if(!map1.contains(find_me))
|
||||
return false;
|
||||
if(!cmap1.contains(find_me))
|
||||
return false;
|
||||
if(!mmap1.contains(find_me))
|
||||
return false;
|
||||
if(!cmmap1.contains(find_me))
|
||||
return false;
|
||||
if(map1.contains(not_present))
|
||||
return false;
|
||||
if(cmap1.contains(not_present))
|
||||
return false;
|
||||
if(mmap1.contains(not_present))
|
||||
return false;
|
||||
if(cmmap1.contains(not_present))
|
||||
return false;
|
||||
//contains
|
||||
if(!map1.contains(find_me))
|
||||
return false;
|
||||
if(!cmap1.contains(find_me))
|
||||
return false;
|
||||
if(!mmap1.contains(find_me))
|
||||
return false;
|
||||
if(!cmmap1.contains(find_me))
|
||||
return false;
|
||||
if(map1.contains(not_present))
|
||||
return false;
|
||||
if(cmap1.contains(not_present))
|
||||
return false;
|
||||
if(mmap1.contains(not_present))
|
||||
return false;
|
||||
if(cmmap1.contains(not_present))
|
||||
return false;
|
||||
|
||||
//at
|
||||
if(map1.at(find_me) != 'd')
|
||||
return false;
|
||||
if(cmap1.at(find_me) != 'd')
|
||||
return false;
|
||||
//at
|
||||
if(map1.at(find_me) != 'd')
|
||||
return false;
|
||||
if(cmap1.at(find_me) != 'd')
|
||||
return false;
|
||||
|
||||
//lower_bound
|
||||
if(map1.lower_bound(find_me)->second != 'd')
|
||||
return false;
|
||||
if(cmap1.lower_bound(find_me)->second != 'd')
|
||||
return false;
|
||||
if(mmap1.lower_bound(find_me)->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.lower_bound(find_me)->second != 'c')
|
||||
return false;
|
||||
//lower_bound
|
||||
if(map1.lower_bound(find_me)->second != 'd')
|
||||
return false;
|
||||
if(cmap1.lower_bound(find_me)->second != 'd')
|
||||
return false;
|
||||
if(mmap1.lower_bound(find_me)->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.lower_bound(find_me)->second != 'c')
|
||||
return false;
|
||||
|
||||
//upper_bound
|
||||
if(map1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(cmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(mmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(cmmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
//upper_bound
|
||||
if(map1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(cmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(mmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
if(cmmap1.upper_bound(find_me)->second != 'e')
|
||||
return false;
|
||||
|
||||
//equal_range
|
||||
if(map1.equal_range(find_me).first->second != 'd')
|
||||
return false;
|
||||
if(cmap1.equal_range(find_me).second->second != 'e')
|
||||
return false;
|
||||
if(mmap1.equal_range(find_me).first->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.equal_range(find_me).second->second != 'e')
|
||||
return false;
|
||||
//equal_range
|
||||
if(map1.equal_range(find_me).first->second != 'd')
|
||||
return false;
|
||||
if(cmap1.equal_range(find_me).second->second != 'e')
|
||||
return false;
|
||||
if(mmap1.equal_range(find_me).first->second != 'c')
|
||||
return false;
|
||||
if(cmmap1.equal_range(find_me).second->second != 'e')
|
||||
return false;
|
||||
|
||||
//erase
|
||||
if (map1.erase(find_me) != 1)
|
||||
return false;
|
||||
if (map1.erase(find_me) != 0)
|
||||
return false;
|
||||
if (mmap1.erase(find_me) != 2)
|
||||
return false;
|
||||
if (mmap1.erase(find_me) != 0)
|
||||
return false;
|
||||
}
|
||||
//erase
|
||||
if (map1.erase(find_me) != 1)
|
||||
return false;
|
||||
if (map1.erase(find_me) != 0)
|
||||
return false;
|
||||
if (mmap1.erase(find_me) != 2)
|
||||
return false;
|
||||
if (mmap1.erase(find_me) != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user