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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux