Boost logo

Boost :

Subject: Re: [boost] [review] Conversion review ends today
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-08-31 14:55:18


Hi Jeff, Vicente,

On Aug 30, 2011, at 4:50 PM, Vicente J. Botet Escriba wrote:
> Le 30/08/11 20:43, Jeffrey Lee Hellrung, Jr. a écrit :
>> I, too, had an application that required unrelated
>> types to be interconverted, and generic algorithms and data structures that
>> required these conversions.
>
> Maybe you can share theese use cases with us.

+1

>> I initially constructed a generic framework
>> similar to that defined by Boost.Conversion, but ultimately I discarded this
>> framework in favor of the conversions being handled by a function object
>> with signature operator()(const Srce& srce, type_tag< Dest>) -> Dest, since
>> the conversions required additional context than that given by the Srce
>> object.

This is the same signature Conversion uses, only it uses function overloading instead of function objects.

Jeff, what method did you use to glue together the various function objects into one?
 
> This seems similar to the Gordon suggestion. While this approach could work on most of the cases, is not able to manage with different conversion for the same couple of Source/Target types but applied to different leaves.
>
> The single way Boost.Conversion could take care of these specific cases and also concept refinement is to wrap the parameter with a specific class.
> But this could not be enough efficient and quite cumbersome.

Vicente, what do you mean by "different leaves"? I wasn't aware that choosing different conversion behaviors was in the scope of the current library/review.

Cheers,
Gordon


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