gast128 wrote:
Dear all,
Peter Becker's book 'the c++ standard library extensions' describes various tr1::regex constructors. One of them is the following (16.4.2, p.387):
char expr1[] = "abc[d-f]"; regex rgx2(expr1, 3);
From the boost headers I can see that it picks up the wrong costructor, since the constructor with length specification has 3 arguments (and the last has no default specification). Who is wrong?
Well, since I wrote that section of TR1 (as well as Boost.Regex), and also helped proofread Pete's book, I guess you can blame me either way :-) The relevent constructors taken straight out of TR1 are: explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript); basic_regex(const charT* p, size_t len, flag_type f); So the version that takes a length always needs 3 arguments (this is also the case in the current draft for the next std). HTH, John.