Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Only 32768 inserts in a map class
Message
De
17/08/2001 08:55:12
 
 
À
Tous
Information générale
Forum:
Borland C++ Builder
Catégorie:
Langage C++ Builder
Titre:
Only 32768 inserts in a map class
Divers
Thread ID:
00545239
Message ID:
00545239
Vues:
49
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...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform