Boost logo

Boost :

Subject: Re: [boost] [qvm] deduce_xx traits wouldn't introduce ODR issues.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-12-10 01:36:11


Le 10/12/2015 00:15, Emil Dotchevski a écrit :
> On Wed, Dec 9, 2015 at 2:51 PM, Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]> wrote:
>
>> Hi,
>>
>> I wonder if the deduce_xx traits wouldn't introduce ODR issues. Remember
>> the TBoost.Conversion library where conversion between two types was
>> customizable.
>> The fact that deduce_xx traits have two types would promote ODR as there
>> is no one type that is expected to do the customization.
>>
>> I believe that changing the default to something depending on the first
>> argument will be better than using the specific qvm type as result.
>>
> If I understand your concern correctly, you're saying that if one type
> defines a deduce_m2 specialization, it might clash with specializations
> defined by other types. That isn't possible because deduce_m2 is always
> specialized for *two* (different) types.
>
> For example, two different matrix types (say, Mat44 and float44) would not
> "know" about each other; the programmer who needs to bring the two types
> together into the same program (and wants to be able to multiply a Mat44 by
> a float44) could specialize deduce_m2 to specify what type of matrix he
> wants (by default he'll get a suitable instantiation of the qvm::mat
> template.)
>
>
The problem appear when two such programmers do it (think of 3pp).

Vicente


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