Method vector.reserve( ) returns no value.
How can we prevent the following situation?
====== foo.cpp ======
#include <climits>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
vector<int> v (100e);
cout << v.capacity() << endl;
v.reserve(LONG_ MAX);
cout << v.capacity() << endl;
return 0;
}
=============== ======
====== Compilation & Run ======
$ g++ -v
[---omitted---]
gcc version 3.3.1 (cygming special)
$ g++ -W -Wall foo.cpp
$ a
100
Aborted (core dumped)
=============== =============== =
--
Alex Vinokur
mailto:al****@c onnect.to
http://mathforum.org/library/view/10978.html