
30 Sep
2011
30 Sep
'11
4:42 a.m.
thanks, I know the reason now.
it is because I have declared const on the member function where I iterate the sregex object. after I removed the const declaration, the compile passed. but I am still curious, I am not changing anything when I iterate the sregex object, why I cannot use the const declareation. To make it clear, I give a more complete formulation of the problem I encountered.
You have to use std::listboost::xpressive::sregex::const_iterator if you want to iterate over a const list. This is because the non-const iterator allows doing things like *it = some_new_value; which would violate const-correctness. Regards, Nate