@smallB:
I don't know what you are doing in the debugger, but this code (I had to make changes to get it to compile and link), is debuggable using gdb and CB for me:
#include <string>
template <class Forward_Iterator>
bool is_operator_( Forward_Iterator it ) {
return * it == '+';
}
template<class Forward_Iterator>
std::string get_operator_( Forward_Iterator beg, Forward_Iterator end) {
return "+";
}
template<class Forward_Iterator>
std::string get_term_( Forward_Iterator beg, Forward_Iterator end) {
return "term";
}
template<class Forward_Iterator>
std::string read_next_token_(Forward_Iterator beg,Forward_Iterator end)
{
std::string result;
if (std::isdigit(*beg))
{
return get_term_(beg,end);
}
else if (is_operator_(beg))
{
return get_operator_(beg,end);
}
else {
throw "error";
}
}
int main(int argc, char* argv[])
{
std::string foo = "1234567avavav";
std::string t = read_next_token_( foo.begin(), foo.end() );
}