This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
std::osteram_iterator<value_type> giving error with GCC 3.2
- From: Mohit Kumar <mohit dot kumar at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 19 May 2005 12:07:07 +0530
- Subject: std::osteram_iterator<value_type> giving error with GCC 3.2
- Reply-to: Mohit Kumar <mohit dot kumar at gmail dot com>
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