Boost logo

Boost :

Subject: Re: [boost] [review] conversion - Vladimir's comments
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-08-30 13:13:49


Le 30/08/11 17:44, Gordon Woodhull a écrit :
>
> On Aug 1, 2011, at 8:47 PM, Vladimir Batov wrote:
>> Secondly, on the implementation level I raised a few concerns in our conversations with Vicente about his library ... I do not feel Vicente's implementation is sufficiently generic. In particular, I am under strong impression that having Target and Source together as in
>>
>> template< class Target, class Source>
>> Target explicit_convert_to( Source const& u );
>>
>> does not really work on a bigger scale. That does indeed work for *concrete* Target and Source types. However, when one tries to generalize (partially specialize) for a range of similar types, then I feel the framework easily falters. Namely, if I decide to specialize the above for a range of related Target types (say, string-related types) *and* separately specialize for a range of related Source types. Then compilation will fail if these two separate specializations happen to overlap for some Target-Source pair. That is not an academic case but concrete issues I faced with Convert. I'd expect it to be as relevant with Vicente's library.
> I agree that it will take some careful shepherding to define a set of conversions without ambiguous overloads, which might be tricky to avoid if you're working with converters written by other people. Vicente, do you have any solutions for this?
>
>

Hi,

I don't see how you can convert from some source to a conceptual range
of target. Could you give me an example?
The contrary is possible, i.e. we can convert from a conceptual range of
Source to a concrete Target.

I'm not saying that there is no case of overlaping specializations. Just
the Vladimir case seems not a good example.

Best,
Vicente


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