i am using a class in the program which is defined like this
 
#include<iterator>
 
namespace utf8
{
   template <typename octet_iterator>
    class iterator : public std::iterator 
<std::bidirectional_iterator_tag, uint32_t> { 
      octet_iterator it;
      octet_iterator range_start;
      octet_iterator range_end;
      public:
      iterator () {};
      explicit iterator (const octet_iterator& octet_it, 
                         const octet_iterator& range_start,
                         const octet_iterator& range_end) :
               it(octet_it), range_start(range_start), range_end
(range_end)
      {
          if (it < range_start || it > range_end)
              throw std::out_of_range("Invalid utf-8 iterator 
position");
      }
      // the default "big three" are OK
      octet_iterator base () const { return it; }
      uint32_t operator * () const
      {
          octet_iterator temp = it;
          return next(temp, range_end);
      }
      bool operator == (const iterator& rhs) const 
      { 
          if (range_start != rhs.range_start || range_end != 
rhs.range_end)
              throw std::logic_error("Comparing utf-8 iterators 
defined with different ranges");
          return (it == rhs.it);
      }
      bool operator != (const iterator& rhs) const
      {
          return !(operator == (rhs));
      }
      iterator& operator ++ () 
      {
          next(it, range_end);
          return *this;
      }
      iterator operator ++ (int)
      {
          iterator temp = *this;
          next(it, range_end);
          return temp;
      }  
      iterator& operator -- ()
      {
          prior(it, range_start);
          return *this;
      }
      iterator operator -- (int)
      {
          iterator temp = *this;
          prior(it, range_start);
          return temp;
      }
    }; // class iterator
};///namespace utf8
 
I am declaring an object of this class in the main program
 
utf8::iterator<char*> it(line.begin(), line.begin(), line.end());
 
the program compiles perfectly well on windows but is not compiling 
on linux with the following problems.
 
utf8_ex.cpp:60: error: no matching function for call to 
`utf8::iterator(__gnu_cxx::__normal_iterator<char*, 
std::basic_string<char, std::char_t
raits<char>, std::allocator<char> > >, 
__gnu_cxx::__normal_iterator<char*, std::
basic_string<char, std::char_traits<char>, std::allocator<char> > >, 
__gnu_cxx::
__normal_iterator<char*, std::basic_string<char, 
std::char_traits<char>, std::al
locator<char> > >)'
 
the namespace  __gnu_cxx is defined in libstdc++ which i have 
installed from this site.
 
http://www.pxh.de/fs/gsmlib/download/content.html     (pl. look for 
libstdc++ on this page)
 
pl. help.
 
regards
 
deb


Reply via email to