S
sks_cpp
Consider the following:
list<int> a; // assume a contains some number of integers
list<int>::iterator iter = a.find(10);
for (iter; iter < a.end(); ++iter)
{
std::cout << "found one\n";
}
================
Where are all the memory allocations here?
There is one for the "iter". Does the find allocate any memory in order to
create the iterator?
I suppose the ++iter does?
Thanks.
list<int> a; // assume a contains some number of integers
list<int>::iterator iter = a.find(10);
for (iter; iter < a.end(); ++iter)
{
std::cout << "found one\n";
}
================
Where are all the memory allocations here?
There is one for the "iter". Does the find allocate any memory in order to
create the iterator?
I suppose the ++iter does?
Thanks.