
on Sat Feb 28 2009, "vicente.botet" <vicente.botet-AT-wanadoo.fr> wrote:
int i = str | radix(10) | locale(...) | converted_to<int>;
Could this approach work for the Boost.Convert library?
I don't much like this syntax, because str | radix(10) isn't meaningful by itself. Also, for what it's worth, when this discussion moved from simple to_string/to_int type functionality into the realm of a "generalized conversion framework," I mostly lost interest. I haven't been watching closely, so I could be wrong, it seems like a classic premature generalization... the same one, in fact, that makes lexical_cast unsuitable for many people's purposes. Generic components can only properly arise from a survey of many specific, non-generic components. Have we done that for this "generalized conversion utility" or is the interface being designed speculatively to allow for something that maybe nobody wants or needs? We have to_string and to_int as non-generic exemplars. What else has been looked at? -- Dave Abrahams BoostPro Computing http://www.boostpro.com