Boost logo

Boost :

Subject: Re: [boost] Boost.Convert+Boost.Parameter
From: Vladimir Batov (batov_at_[hidden])
Date: 2009-03-03 04:58:29


> From: "Emil Dotchevski" <emildotchevski_at_[hidden]>
> The point is, you're generalizing the interface without anybody having
> posted even a single use case that requires that generalization.

Yes, I've been playing along that generalization effort as I did not see it
compromising the interface or muddling the intent. For me the clarity was
the goal, the generalization was a bonus. I do not feel

    int i = convert<int>::from(string)

has been generalized at the expense of clarity. Quite the opposite. To me
above does exactly what it says... in the best possible (IMHO) way. I do not
believe that something clearer like "from_string" will better reflect its
purpose as the "string" is open for interpretation and the above converts
from various string-like *containers* (like vector<char>, list<wchar_t>).
Same goes for 'to_string' as I need to convert to char and wchar_t-based
strings and most likely need to convert to u8char strings. Therefore, I do
not feel

    to_string<wstring>(-1)

looks/reads better than

    convert<wstring>::from(-1)

> Such generalization is not needed by anyone, or if it is needed we
> have no idea if that use case will fit this interface. So why is it
> supported? Just in case? We have lexical_cast for that. :)

Yes, I indeed have that feeling that the generalization option will never be
exercised. However, to me the generalization has been accidental, a bonus.
The main goal of the exercise (for me) has been clearing up the interface to
say what it does.

V.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk