From: Jag on
I don't understand. Can some one explain the issue here. Thanks
------------
template <typename T>
static typename list<int>::iterator find_an_element(list<T>& a, const
T& b) {
typename list<T>::iterator itt = a.begin() ;
while (itt != a.end()) {
if (*itt == b) {
break ;
}
itt++ ;
}
return itt ;
}

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: marcin.sfider on
On Jun 29, 10:27 pm, Jag <jag...(a)gmail.com> wrote:
> I don't understand. Can some one explain the issue here. Thanks
> ------------
> template <typename T>
> static typename list<int>::iterator find_an_element(list<T>& a, const
^^^ should be T

> T& b) {
> typename list<T>::iterator itt = a.begin() ;
> while (itt != a.end()) {
> if (*itt == b) {
> break ;
> }
> itt++ ;
>
> }
> return itt ;
> }
>

Cheers
Sfider


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]