Subject: Re: [boost] [qvm] deduce_xx traits wouldn't introduce ODR issues.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-12-29 05:11:26
Le 23/12/2015 21:09, Emil Dotchevski a Ã©crit :
> On Wed, Dec 23, 2015 at 6:24 AM, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>
>> Vicente J. Botet Escriba wrote:
>>> Le 10/12/2015 08:30, Emil Dotchevski a Ã©crit :
>>>> On Wed, Dec 9, 2015 at 10:36 PM, Vicente J. Botet Escriba <
>>>> vicente.botet_at_[hidden]> wrote:
>>>> 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:
>>>>>> The problem appear when two such programmers do it (think of 3pp).
>>>>> If within one program two programmers introduce two different
>>>> under the same name, yes you have ODR but that is hardly a library
>>>> Hmm. This is a library issue, because the library provides an interface
>>> that allows to configure types that don't know each other by two different
>>> TBoost.Conversion was rejected exactly by this reason.
>> This indeed is an important point, unfortunately I cannot take it into
>> account because it wasn't mentioned in any review.
>> Vincente, do you plan to write one?
> If the problem is that QVM allows you to specialize a type template, and
> that it is possible for two programmers to introduce two different
> definitions for the same specialization, how is that a library issue? If
> that's a problem then we can't allow any templates in any library
> interface, which seems odd.
I believe there is a difference between traits and the way your library
is providing the customization. IMHO, trait<T> specializations should be
provided by the library that defines the type T. Your library is
promoting that some 3pp libraries do the trait<T> specialization and so
it is promoting ODR violation.
Note that I'm not saying that your library is not useful in certain
contexts (as it was TBoost.Conversion), just that the user of the
library must be aware of this problem.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk