This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

std::osteram_iterator<value_type> giving error with GCC 3.2


 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]