forked from boostorg/container
* Improved vector's insertion performance.
* Changed again experimental multiallocation interface for better performance (still experimental). * Added no exception support for those willing to disable exceptions in their compilers. * Fixed GCC -Wshadow warnings. * Replaced deprecated BOOST_NO_XXXX with newer BOOST_NO_CXX11_XXX macros. [SVN r81519]
This commit is contained in:
1 parent
bc5c91bb79
commit
6d4af66add
19 files changed
+355
-256
No files matched your search
+42
-40
@@ -17,7 +17,8 @@
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include "print_container.hpp"
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
#include <boost/move/iterator.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace boost{
|
||||
@@ -119,8 +120,7 @@ int set_test ()
|
||||
delete stdmultiset3;
|
||||
}
|
||||
|
||||
int i, j;
|
||||
for(i = 0; i < max; ++i){
|
||||
for(int i = 0; i < max; ++i){
|
||||
IntType move_me(i);
|
||||
boostset->insert(boost::move(move_me));
|
||||
stdset->insert(i);
|
||||
@@ -301,7 +301,7 @@ int set_test ()
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < max; ++i){
|
||||
for(int i = 0; i < max; ++i){
|
||||
IntType move_me(i);
|
||||
boostset->insert(boost::move(move_me));
|
||||
stdset->insert(i);
|
||||
@@ -319,37 +319,39 @@ int set_test ()
|
||||
return 1;
|
||||
}
|
||||
|
||||
for(i = 0; i < max; ++i){
|
||||
IntType move_me(i);
|
||||
boostset->insert(boostset->begin(), boost::move(move_me));
|
||||
stdset->insert(stdset->begin(), i);
|
||||
//PrintContainers(boostset, stdset);
|
||||
IntType move_me2(i);
|
||||
boostmultiset->insert(boostmultiset->begin(), boost::move(move_me2));
|
||||
stdmultiset->insert(stdmultiset->begin(), i);
|
||||
//PrintContainers(boostmultiset, stdmultiset);
|
||||
if(!CheckEqualContainers(boostset, stdset)){
|
||||
std::cout << "Error in boostset->insert(boostset->begin(), boost::move(move_me))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
if(!CheckEqualContainers(boostmultiset, stdmultiset)){
|
||||
std::cout << "Error in boostmultiset->insert(boostmultiset->begin(), boost::move(move_me2))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
for(int i = 0; i < max; ++i){
|
||||
{
|
||||
IntType move_me(i);
|
||||
boostset->insert(boostset->begin(), boost::move(move_me));
|
||||
stdset->insert(stdset->begin(), i);
|
||||
//PrintContainers(boostset, stdset);
|
||||
IntType move_me2(i);
|
||||
boostmultiset->insert(boostmultiset->begin(), boost::move(move_me2));
|
||||
stdmultiset->insert(stdmultiset->begin(), i);
|
||||
//PrintContainers(boostmultiset, stdmultiset);
|
||||
if(!CheckEqualContainers(boostset, stdset)){
|
||||
std::cout << "Error in boostset->insert(boostset->begin(), boost::move(move_me))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
if(!CheckEqualContainers(boostmultiset, stdmultiset)){
|
||||
std::cout << "Error in boostmultiset->insert(boostmultiset->begin(), boost::move(move_me2))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
IntType move_me3(i);
|
||||
boostset->insert(boostset->end(), boost::move(move_me3));
|
||||
stdset->insert(stdset->end(), i);
|
||||
IntType move_me4(i);
|
||||
boostmultiset->insert(boostmultiset->end(), boost::move(move_me4));
|
||||
stdmultiset->insert(stdmultiset->end(), i);
|
||||
if(!CheckEqualContainers(boostset, stdset)){
|
||||
std::cout << "Error in boostset->insert(boostset->end(), boost::move(move_me3))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
if(!CheckEqualContainers(boostmultiset, stdmultiset)){
|
||||
std::cout << "Error in boostmultiset->insert(boostmultiset->end(), boost::move(move_me4))" << std::endl;
|
||||
return 1;
|
||||
IntType move_me3(i);
|
||||
boostset->insert(boostset->end(), boost::move(move_me3));
|
||||
stdset->insert(stdset->end(), i);
|
||||
IntType move_me4(i);
|
||||
boostmultiset->insert(boostmultiset->end(), boost::move(move_me4));
|
||||
stdmultiset->insert(stdmultiset->end(), i);
|
||||
if(!CheckEqualContainers(boostset, stdset)){
|
||||
std::cout << "Error in boostset->insert(boostset->end(), boost::move(move_me3))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
if(!CheckEqualContainers(boostmultiset, stdmultiset)){
|
||||
std::cout << "Error in boostmultiset->insert(boostmultiset->end(), boost::move(move_me4))" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
IntType move_me(i);
|
||||
@@ -372,10 +374,11 @@ int set_test ()
|
||||
}
|
||||
{
|
||||
IntType move_me(i);
|
||||
IntType move_me2(i);
|
||||
boostset->insert(boostset->lower_bound(move_me), boost::move(move_me2));
|
||||
stdset->insert(stdset->lower_bound(i), i);
|
||||
//PrintContainers(boostset, stdset);
|
||||
IntType move_me2(i);
|
||||
move_me2 = i;
|
||||
boostmultiset->insert(boostmultiset->lower_bound(move_me2), boost::move(move_me2));
|
||||
stdmultiset->insert(stdmultiset->lower_bound(i), i);
|
||||
//PrintContainers(boostmultiset, stdmultiset);
|
||||
@@ -391,7 +394,7 @@ int set_test ()
|
||||
}
|
||||
|
||||
//Compare count with std containers
|
||||
for(i = 0; i < max; ++i){
|
||||
for(int i = 0; i < max; ++i){
|
||||
IntType count_me(i);
|
||||
if(boostset->count(count_me) != stdset->count(i)){
|
||||
return -1;
|
||||
@@ -407,8 +410,8 @@ int set_test ()
|
||||
boostset->clear();
|
||||
boostmultiset->clear();
|
||||
|
||||
for(j = 0; j < 3; ++j)
|
||||
for(i = 0; i < 100; ++i){
|
||||
for(int j = 0; j < 3; ++j)
|
||||
for(int i = 0; i < 100; ++i){
|
||||
IntType move_me(i);
|
||||
boostset->insert(boost::move(move_me));
|
||||
IntType move_me2(i);
|
||||
@@ -448,8 +451,7 @@ int set_test_copyable ()
|
||||
MyBoostMultiSet *boostmultiset = new MyBoostMultiSet;
|
||||
MyStdMultiSet *stdmultiset = new MyStdMultiSet;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < max; ++i){
|
||||
for(int i = 0; i < max; ++i){
|
||||
IntType move_me(i);
|
||||
boostset->insert(boost::move(move_me));
|
||||
stdset->insert(i);
|
||||
|
||||
Reference in new issue
Block a user