Boost logo

Boost :

Subject: Re: [boost] [Review] Boost.Convert library, last day
From: Vladimir Batov (vbatov_at_[hidden])
Date: 2011-05-03 18:04:24


> Thomas Heller <thom.heller <at> googlemail.com> writes:
> ...
> Sorry, this statement is wrong.
> At the very least convert<T>::from returns exactly one thing which is
> this converter thingy,
> which is implicitly converted to either convert<T>::result or T. And
> yes, this means that
> the result is different based on the LHS of from, which is out of your
> control and doomed to fail.
> I wonder how much codes breaks by having this.
> Consider the following example:
>
> #include <boost/convert.hpp>
> #include <string>
>
> template <typename Char, typename Allocator>
> void f(std::basic_string<Char, Allocator> string)
> {}
>
> int main()
> {
> f(boost::convert<std::string>::from(123));
> }
>
> Which is not working because of this design flaw I constantly keep
> mocking about.

It'd be considerably more constructive if you stopped "mocking", showed some
manners and started respecting other-peoples effort.

As for your not-working example

> f(boost::convert<std::string>::from(123));

then 'yes' it does not work the way *you* intentionally deploy 'convert'. For it
to work it needs to be

f(boost::convert<std::string>::from(123).value());

But from your posts I conclude you do not want to know that. If my post makes
you fee I am somewhat irritated by your insistently rude tone, then you are
right, I am.

V.


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