
21 Feb
2009
21 Feb
'09
7:24 a.m.
convert<string, int>(str, -1) >> throw_t(); // What does -1 mean here?
That "-1" indeed looks kind of out of place, doesn't it? :-)
Unfortunately, there are classes that do not have default constructors (I have a few). For them we need direction dir = convert<srting, direction>(str, direction_up); Those classes *might* like to have throwing behavior. Therefore, for those we need direction dir = convert<srting, direction>(str, direction_up) >> throw_t();
int i = convert_to<int>(str) // throws on failure int i = convert_from<string, int>(str, -1) // returns -1 on failure int i = convert_from(str, -1) // the same as above
Done as above.
and throw_t scrapped. Any objections?
I seem to have to bring it back for the case I described above. V.