list-max_size

////////////////////////////////////////
//      2018/04/26 8:23:11
//      list-max_size

// returns the maximum number of elements the list can hold
#include <iostream>
#include <list>

using namespace std;

int main(){
    list<int> li(10);

    cout << "size of li = " << li.size() << endl;
    cout << "max_size = " << li.max_size() << endl;

    return 0;
}


/*
OUTPUT:
    size of li = 10
    max_size = 357913941
*/
原文地址:https://www.cnblogs.com/laohaozi/p/12537959.html