[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
std::osteram_iterator<value_type> giving error with GCC 3.2
From: |
Mohit Kumar |
Subject: |
std::osteram_iterator<value_type> giving error with GCC 3.2 |
Date: |
Thu, 19 May 2005 12:07:07 +0530 |
I am getting a certain error while compiling the code below under GCC3.2:
template <class Cont>
struct IterRange
{
typedef typename Cont::iterator iterator;
IterRange(iterator fst, iterator lst) : first(fst), last(lst) {}
~IterRange() {}
typename Cont::iterator first;
typename Cont::iterator last;
};
template <class Cont>
std::ostream& operator<<(std::ostream& s, const IterRange<Cont>& range)
{
typedef typename Cont::value_type value_type;
std::copy(range.first, range.last,
std::ostream_iterator<value_type>(s, ", ")); <<<<<<<<<<<<<<< Error
Line
return s;
}
The error on the line indicated says : parse error before token '>'
I had checked through various codes on net, and they showed the same
syntax. Moreover, the same piece of code executes perfectly on VC++.
What should I do?
Am I missing something?
Thanks,
Mohit
I don't know the key to sucess, but the key to faliure is to try to
please everyone.
-- Bill Cosby
- std::osteram_iterator<value_type> giving error with GCC 3.2,
Mohit Kumar <=