Opened 21 years ago
Closed 21 years ago
#63 closed Bugs (Fixed)
regex/tokenizer can't be in same file
Reported by: | kiliman | Owned by: | John Maddock |
---|---|---|---|
Milestone: | Component: | regex | |
Version: | None | Severity: | |
Keywords: | Cc: |
Description
I'm trying to use regex and tokenizer in the same file. I'm using MSVC 6.0SP5, boost lib 1.27. When I try to compile, I get the following error: d:\libs\boost\boost\token_functions.hpp(396) : error C2668: 'ispunct' : ambiguous call to overloaded function d:\libs\boost\boost\token_functions.hpp (389) : while compiling class-template member function 'bool __thiscall boost::char_delimiters_separator<char,struct std::char_traits<char> >::is_ret(char) const' Error executing cl.exe. Here is the code: #include <iostream> #include <string> #include <boost/tokenizer.hpp> #include <boost/regex.hpp> using namespace std; using namespace boost; int main(int argc, char* argv[]) { regex re; string s = "This is, a test"; tokenizer<> tok(s); for(tokenizer<>::iterator beg = tok.begin(); beg != tok.end(); ++beg) { cout << *beg << "\n"; } return 0; }
Change History (2)
comment:2 by , 21 years ago
Status: | assigned → closed |
---|
Logged In: YES user_id=14804 Fixed in cvs - I've modified tokenizer so that it uses the same workaround for BOOST_NO_STDC_NAMESPACE that other boost libs use. The workaround suggested is more or less correct (there are a few corner cases it doesn't deal with - but see the cvs version history for details).
Note:
See TracTickets
for help on using tickets.