M
MikeB
Hi,
I've observed some odd behaviour in the std::list supplied with our
development system. In the accompanying code, the list has at most one
string on it, yet the program eventually runs out of heap.
However, if instead of using a std::list I use a std::deque, the program
doesn't run out of heap. Can anyone explain the behaviour of std::list or is
it a bug ?
TIA,
MikeB
#include <string>
#include <list>
int main()
{
std::list< std::string> strings;
for( ;
{
strings.push_back( "Hello, world");
strings.pop_front();
}
}
I've observed some odd behaviour in the std::list supplied with our
development system. In the accompanying code, the list has at most one
string on it, yet the program eventually runs out of heap.
However, if instead of using a std::list I use a std::deque, the program
doesn't run out of heap. Can anyone explain the behaviour of std::list or is
it a bug ?
TIA,
MikeB
#include <string>
#include <list>
int main()
{
std::list< std::string> strings;
for( ;
{
strings.push_back( "Hello, world");
strings.pop_front();
}
}