This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
polymorphism
- From: Tiago Candeias <tcandeia at ualg dot pt>
- To: gcc-help at gcc dot gnu dot org
- Cc: tcandeia at ualg dot pt
- Date: 03 Jun 2003 20:11:00 +0100
- Subject: polymorphism
Hi,
I am implementing a procedure to read objects in a format way, defining
the operator>> to do that.
ifstream is("CObjects.txt");
copy(istream_iterator<CObject>(is),istream_iterator<CObject>(),
inserter(list,list.begin()));
is.close();
If the object is a <int> there is no problem, but with other type like
<CObject>, then it doesn't work.
This is a polymorphic problem as described in (STL and OO Don't Easily
Mix) http://www.oonumerics.org/tmpw00/kuehl.html in 2000.
My question is if this problem is already resolved.
And in afirmative case, how to use it.
Thanks