Boost logo

Boost Users :

From: John Grabner (grabnerj_at_[hidden])
Date: 2006-03-21 05:00:32


I used the regex library from version 1.28.0 with BCB6. I was able to
have a single function
CommentsStrings::MatchFound(boost::match_result<std::string::const_iterator>
what);

to process both a std::string and a boost::mapfile.

The calling functions are:

//---------------------------------------------------------------------------
void CommentsStrings::Analyse(const std::string& Buffer)
{
     Buffer_ = Buffer;
     AllCommentsStrings_.clear();

     // find comments and strings
     std::string::const_iterator start, end;
     start = Buffer_.begin();
     end = Buffer_.end();
     boost::regex_grep(
        std::bind1st(std::mem_fun(&CommentsStrings::MatchFound), this),
         start,
         end,
         CommentStringExpression);
}

//---------------------------------------------------------------------------
void CommentsStrings::Analyse(const char *file)
{
     currentFile = file;
     AllCommentsStrings_.clear();

     // find comments and strings
     boost::mapfile f(currentFile.c_str());
     boost::mapfile::iterator start, end;
     start = f.begin();
     end = f.end();
     boost::regex_grep(
        std::bind1st(std::mem_fun(&CommentsStrings::MatchFound), this),
         start,
         end,
         CommentStringExpression);
}

Now I am using BDS2006 and boost 1_33_1 I am getting an error

Could not find a match for
'std::bind1st<std::mem_fun_t<bool,CommentsStrings,smatch> >::operator
()(cmatch)'.

I know that the iterator for std::string is a class and not a char
pointer. I am at a loss as how to proceed.

John.


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