Boost logo

Boost :

Subject: Re: [boost] [conversion] Motivation for two NEW generic conver_to and assign_to functions
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-10-26 17:50:21


Hi,
----- Original Message -----
From: "Jeffrey Bosboom" <jbosboom_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, October 26, 2009 10:04 PM
Subject: Re: [boost] [conversion] Motivation for two NEW generic conver_to and assign_to functions

>
> Stewart, Robert wrote:
>> I fail to understand why
>>
>> convert_to(b, type_tag<A>())
>>
>> is acceptable and
>>
>> convert_to<A>(b)
>>
>> is not in any circumstance.
>
> For what it's worth, I strongly prefer the syntax of the latter -- it
> works just like the built-in new-style casts and boost::lexical_cast.

Me too. The former is the extended form of the later. They are equivalent. The parameter type_tag<A> is there just to allow ADL.

Both forms are allowed by the current implementation in Boost.Conversion.

Best,
Vicente


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