below is the snippet of code:
same is compiling over AIX and windows, but I need to compile the same on linux and deliver it today but getting errors.
I highlighted the error statement
error:Code:#ifndef _POLY_ITERATOR_ #define _POLY_ITERATOR_ #include <iterator> #ifndef HPUX11 using namespace std; #endif //HPUX11 #include <iterator> #ifndef LIN using namespace std; #endif //HPUX11 template<class C, typename T> class poly_iterator #if _MSC_VER>=1300 // VC7 : public iterator_traits<typename C::iterator> #endif { private: // typedef poly_iterator<C,T> _Self; protected: typedef typename C::iterator I; //!< regular iterator of the underlying container I i; //! mimic inheritage from the regular iterator //! because we cannot simply derive from it since // some iterators are regular pointers public: operator I&() { return (I&)i; } //!<needed to use poly_iterator in algorithms transparently public: poly_iterator<C,T>() {}; poly_iterator<C,T>(const I& p):i(p) {}; //!< construction form const_poly_iterator T& operator*() {return (T&)*i;} T* operator->() {return (T*)&*i;} public: // compatibility with I iterator poly_iterator<C,T>& operator++() {++i; return *this;} poly_iterator<C,T>& operator--() {--i; return *this;} poly_iterator<C,T> operator+(const Int count) { I temp = i; temp += count; return poly_iterator<C,T>(temp); } poly_iterator<C,T> operator-(const Int count) { I temp = i; temp -= count; return poly_iterator<C,T>(temp); } poly_iterator<C,T>& operator++(Int) { i++; return *this; } poly_iterator<C,T>& operator--(Int) { i--; return *this; } bool operator<(const poly_iterator<C,T>& other) const { return i < other.i; } bool operator<(const I& other) const { return i < other; } bool operator<=(const poly_iterator<C,T>& other) const { return i <= other.i; } bool operator<=(const I& other) const { return i <= other; } bool operator>(const poly_iterator<C,T>& other) const { return i > other.i; } bool operator>(const I& other) const { return i > other; } bool operator>=(const poly_iterator<C,T>& other) const { return i >= other.i; } bool operator>=(const I& other) const { return i >= other; } bool operator==(const I& other) const { return i==other; } bool operator!=(const I& other) const { return i!=other; } bool operator==(const poly_iterator<C,T>& other) const { return i==other.i; } bool operator!=(const poly_iterator<C,T>& other) const { return i!=other.i; } }; #endif // _POLY_ITERATOR_ #endif
LiteRouteStop*>, _Tp = AbstractRouteStop*]â
/apps/lcom/Engines/2009Env/Consolidator/include/LiteRoute.hpp:688: instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:204: error: no match for âoperator-â in â__last - __firstâ
/apps/lcom/Engines/2009Env/Consolidator/include/Utility.hpp:259: note: candidates are: poly_iterator<C, T> poly_iterator<C, T>:perator-(Int) [with C = std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, T = LiteRouteStop*]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_bvector.h:182: note: ptrdiff_t std:perator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:225: error: no match for âoperator-â in â__last - __firstâ
/apps/lcom/Engines/2009Env/Consolidator/include/Utility.hpp:259: note: candidates are: poly_iterator<C, T> poly_iterator<C, T>:perator-(Int) [with C = std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, T = LiteRouteStop*]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_bvector.h:182: note: ptrdiff_t std:perator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h: In function â_RandomAccessIterator std::__find(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, std::random_access_iterator_tag) [with _RandomAccessIterator = poly_iterator<std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, LiteRouteStop*>, _Tp = LiteRouteStop*]â:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:316: instantiated from â_InputIterator std::find(_InputIterator, _InputIterator, const _Tp&) [with _InputIterator = poly_iterator<std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, LiteRouteStop*>, _Tp = LiteRouteStop*]â
/apps/lcom/Engines/2009Env/Consolidator/include/LiteRoute.hpp:692: instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:204: error: no match for âoperator-â in â__last - __firstâ
/apps/lcom/Engines/2009Env/Consolidator/include/Utility.hpp:259: note: candidates are: poly_iterator<C, T> poly_iterator<C, T>:perator-(Int) [with C = std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, T = LiteRouteStop*]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_bvector.h:182: note: ptrdiff_t std:perator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:225: error: no match for âoperator-â in â__last - __firstâ
/apps/lcom/Engines/2009Env/Consolidator/include/Utility.hpp:259: note: candidates are: poly_iterator<C, T> poly_iterator<C, T>:perator-(Int) [with C = std::vector<AbstractRouteStop*, std::allocator<AbstractRouteStop*> >, T = LiteRouteStop*]
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_bvector.h:182: note: ptrdiff_t std:perator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
/apps/lcom/Engines/2009Env/Consolidator/include/Order.hpp: At global scope:
/apps/lcom/Engines/2009Env/Consolidator/include/Order.hpp:761: warning: inline function âvirtual Lfloat Order::_GetSizeValueForConsCode(std::string)â used but never defined
make[2]: *** [libConsCore.a(LiteEngine.o)] Error 1
Thanks in Advance.
Please help!!
Vaibhav