[Boost-bugs] [Boost C++ Libraries] #3163: Regex use - compile error

Subject: [Boost-bugs] [Boost C++ Libraries] #3163: Regex use - compile error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-09 23:25:45


#3163: Regex use - compile error
---------------------------------+------------------------------------------
 Reporter: scippio_at_[hidden] | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: regex
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: regex,compile |
---------------------------------+------------------------------------------
 Hi, I have problem in my little test program:

 {{{
         std::string decoded = "this is standart string with
 username=\"myusername\" etc. ";

         static const boost::regex regUsername("username=\"(.*)\"");
         boost::cmatch matches;
         std::string::const_iterator begin;
         begin = decoded.begin();

         while(boost::regex_search(begin, decoded.end(), matches,
 regUsername)){
                 std::string text(matches[1].first, matches[1].second);
                 std::cout << "OUTPUT: " << text << std::endl;
                 begin = matches[1].second;
         }
 }}}

 compile error:

 {{{
 ccache g++ -o test.o -c -O2 -Wno-deprecated -Wall -Iinc test.cpp
 test.cpp: In member function ‘void authorization()’:
 test.cpp:211: error: no matching function for call to
 â€˜regex_search(__gnu_cxx::__normal_iterator<const 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::allocator<char> > >, boost::cmatch&, const
 boost::regex&)’
 test.cpp:214: error: no match for ‘operator=’ in ‘begin = ((const
 boost::sub_match<const char*>*)matches.boost::match_results<BidiIterator,
 Allocator>::operator[] [with BidiIterator = const char*, Allocator =
 std::allocator<boost::sub_match<const char*>
>](1))->boost::sub_match<const char*>::<anonymous>.std::pair<const char*,
 const char*>::second’
 /usr/lib/gcc/i686-pc-linux-
 gnu/4.4.0/../../../../include/c++/4.4.0/bits/stl_iterator.h:669: note:
 candidates are: __gnu_cxx::__normal_iterator<const char*,
 std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&
 __gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> > >::operator=(const
 __gnu_cxx::__normal_iterator<const char*, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> > >&)
 scons: *** [test.o] Error 1
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3163>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC