Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only 32768 inserts in a map class
Message
From
17/08/2001 08:55:12
 
 
To
All
General information
Forum:
Borland C++ Builder
Category:
C++ Builder Language
Title:
Only 32768 inserts in a map class
Miscellaneous
Thread ID:
00545239
Message ID:
00545239
Views:
41
using this code I can do only 32768 inserts, am I doing something wrong or can this template class only handle that few records ?

I hope this code looks better:

#include < stdlib >
#include < string >
#include < map >
#include < time >
using namespace std;

typedef map < long, long > mm;
typedef mm::value_type vt;
int main() {
mm s;
printf("%d\n",s.size());
clock_t c1,c2;
c1 = clock();
for ( long i = 0; i < 100000;i++) {
double val = rand() * 100000.0;
s.insert(vt(val,9));
}
printf("%d\n",s.size());
c2 = clock();
printf("%d %d\n",c1,c2);
}
============================================================
'C' is shorthand for Confusion, 'C++' much more confusion...
Next
Reply
Map
View

Click here to load this message in the networking platform