Vladimir Batov
Andrzej Krzemienski
writes: I personally do not like this trick to force me to type this "from" in "convert<int>::from".
It's been a while and OTOH I do not remember what/how it was exactly but the main purpose of "from" is to separate TypeIn from TypeOut. Not
template
optional<TypeOut> convert(TypeIn, Converter) but
template<class TypeOut> struct convert { static optional<TypeOut> from(TypeIn, Converter); }
That way (at least I felt so back then) it was the only way to provide the ability to *reliably* specialize separately on TypeIn and/or TypeOut. Again, maybe that original decision/design is not valid or important and needs to be revisited.
I just had another look and there seems no value anymore in potential
specializations on TypeIn, TypeOut. It's because all the "smartness" and
type-handling has been moved to converters. So, *there seems*, the "from"
can be dropped. That is,
int v = boost::convert<int>(str, cnv).value();
instead
int v = boost::convert<int>::from(str, cnv).value();
and
std::transform(
strings.begin(),
strings.end(),
std::back_inserter(integers),
convert