Commit 8ce75feb authored by laurence's avatar laurence
Browse files

BUG: List constructor now uses deref op instead of operator()()- mantis #219

parent 2b320a54
......@@ -37,6 +37,8 @@ Description
#include "vector.H"
#include "ListOps.H"
#include<list>
using namespace Foam;
......@@ -117,6 +119,35 @@ int main(int argc, char *argv[])
<< "-wordList: " << wLst << nl
<< "-stringList: " << sLst << endl;
Info<< nl
<< "Test List Iterator Constuctor" << endl;
List<vector> initialList(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());
Info<< " Initial List: " << initialList << endl;
List<vector> iteratorList(initialList.begin(), initialList.end());
Info<< " Foam::List constructed from Foam::List: "
<< iteratorList << endl;
std::list<vector> stlList(initialList.begin(), initialList.end());
Info<< " std::list constructed from Foam::List: ";
std::list<vector>::iterator it;
for (it=stlList.begin(); it != stlList.end(); it++)
{
Info<< *it << " ";
}
Info<< endl;
List<vector> iteratorSTLList(stlList.begin(), stlList.end());
Info<< " Foam::List constructed from std::list: "
<< iteratorList << endl;
return 0;
}
......
......@@ -200,7 +200,7 @@ Foam::List<T>::List(InputIterator first, InputIterator last)
++iter
)
{
this->operator[](s++) = iter();
this->operator[](s++) = *iter;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment