Boost logo

Boost Users :

Subject: [Boost-users] string algo - documentation bug?
From: mafeusek_at_[hidden]
Date: 2010-08-29 13:27:45


Hallo Group Members.

in
http://www.boost.org/doc/libs/1_44_0/doc/html/string_algo/concept.html
I can read:

  * Function Finder. Finder can be any function object. That is, any ordinary function with the
    required signature can be used as well. However, such a function can be used only for a specific
    iterator type.
   
    boost::iterator_range<std::string> simple_finder(
        std::string::const_iterator Begin,
        std::string::const_iterator End )
    {
        return boost::make_range( Begin, End );
    }

but following code does not compile:

#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/range.hpp>

int main(int argc, char *argv[])
{
  boost::iterator_range<std::string> dd;
  return 0;
}

As I understand, I need to put iterator as template parameter to
iterator_range, thus:

#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/range.hpp>

/*
boost::iterator_range<std::string>
simple_finder(
              std::string::const_iterator Begin,
              std::string::const_iterator End )
{
  return boost::make_range( Begin, End );
}
*/

int main(int argc, char *argv[])
{
  boost::iterator_range<std::string::iterator> dd;
  return 0;
}

compiles ok.

Is it documentation bug?

best regards,
Pawel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net