Boost.Regex error: match_results error

hi, when I have built the Boost.Regex libarary,and then I tested the samples of the regex. Then I found the credit_card_example correct while the capture_example error. Fistly, the capture_example compiled with the error the .captures(i) is not the member function of the match_results, then I found the source file of match_results.hpp and found this MACRO as below: #ifdef BOOST_REGEX_MATCH_EXTRA typedef typename sub_match<BidiIterator>::capture_sequence_type capture_sequence_type; const capture_sequence_type& captures(int i)const { return (*this)[i].captures(); } #endif so I defined the macro BOOST_REGEX_MATCH_EXTRA, then it compiled successful. but the error occured when I runned the program. the memory leak and system dead. so I wondered what's mean of the BOOST_REGEX_MATCH_EXTRA? many thanks for you. leecky 2005.7.25

so I wondered what's mean of the BOOST_REGEX_MATCH_EXTRA?
Enabling capture information has an impact on performance, so you must define BOOST_REGEX_MATCH_EXTRA *both* in your code, and when you are building the regex library. If you just want to build the example program then the easiest way is to use bjam to do so: cd into libs/regex/example and: bjam captures_example Alternatively add #define BOOST_REGEX_MATCH_EXTRA to boost/regex/user.hpp and rebuild the library. This is all documented here: http://www.boost.org/libs/regex/doc/match_results.html#m17 and towards the end of here: http://www.boost.org/libs/regex/doc/captures.html John.
participants (2)
-
John Maddock
-
reecky