[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is it a bug?
From: |
hkhauke |
Subject: |
Is it a bug? |
Date: |
Thu, 8 Feb 2001 18:35:02 +0100 (MET) |
Hi everyone!
My question:
I programmed the following:
0 template<class T> bool
1 elementInList(const list<T>& lst, const T& elm)
2 {
3 list< T >::const_iterator elm_ind;
4 for(elm_ind = lst.begin();
5 elm_ind != lst.end(); elm_ind++)
6 {
7 if(*elm_ind == elm)
8 return(true);
9 }
10 return(false);
11 }
Line 3 however produces a parse-error.
Is it a g++-bug?
g++ is 2.96 from Redhat7.0.
Replacing T by for example string does not lead to an error.
I am not experienced in programming templates so this may be my
fault.
Best regards,
Hk
--
Sent through GMX FreeMail - http://www.gmx.net
[Prev in Thread] |
Current Thread |
[Next in Thread] |