Results 1 to 3 of 3

Thread: STL Container Size Limit Report

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    STL Container Size Limit Report

    I wrote this little test program to find the size limits of some of the Standard Template Library Containers. I would like to see what differences, if any, and which situations machine to machine, OS to OS or both.
    It is a console app. You might need to scroll up to see the whole output. It will give your results first and then print my results for reference.

    The code listing is just for reference. The attachment has the executable console app.

    #include <iostream>
    #include <stdlib.h>
    #include <vector>
    #include <list>
    #include <map>
    
    using namespace std;
    
    int kvs = 1073741823;
    int kvi = 1073741823;
    int kls = 357913941;
    int kli = 357913941;
    int km  = 178956970;
    
    int main()
    {
        vector<string>  vs;
        vector<int>     vi;
    
        list<string>    ls;
        list<int>       li;
    
        map<int,string> m;
    
        cout << endl << "              Container Limits" << endl << endl ;
    
        cout << "           Your Results: "<< endl  << endl;
        cout << "      Vector of strings: "<< vs.max_size() << endl;
        cout << "     Vector of integers: "<< vi.max_size() << endl  << endl;
    
        cout << "        List of strings: "<< ls.max_size() << endl;
        cout << "       List of integers: "<< li.max_size() << endl  << endl;
    
        cout << "Map of ints and strings: "<< m.max_size()  << endl  << endl;
        cout << "==================================================" << endl;
        cout << "         Kent's Results: "<< endl << endl;
        cout << "      Vector of strings: "<< kvs  << endl;
        cout << "     Vector of integers: "<< kvi  << endl  << endl;
    
        cout << "        List of strings: "<< kls  << endl;
        cout << "       List of integers: "<< kli  << endl  << endl;
    
        cout << "Map of ints and strings: "<< km  << endl   << endl;
        system("pause");
        return 0;
    }
    
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by kryton9; 24-12-2011 at 01:37.

Similar Threads

  1. The limit as t --> 0, of, sin(t)/t
    By danbaron in forum Math: all about
    Replies: 1
    Last Post: 28-07-2011, 01:05
  2. The Limit of Randomize()
    By danbaron in forum General purpose scripts
    Replies: 0
    Last Post: 18-02-2010, 09:34
  3. TBDI - Progress report
    By Michael Hartlef in forum TBDI module. thinBasic Direct Input integration by MikeHart
    Replies: 30
    Last Post: 14-03-2007, 10:04
  4. Textbox Limit?
    By catventure in forum thinBasic General
    Replies: 8
    Last Post: 18-11-2006, 19:15

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •