Boost logo

Boost :

Subject: Re: [boost] [qvm] deduce_xx traits wouldn't introduce ODR issues.
From: Rainer Deyke (rainerd_at_[hidden])
Date: 2015-12-29 04:19:47


On 28.12.2015 15:54, Rob Stewart wrote:
> Each can provide an extra header that has the interdependencies. That
> doesn't mean the libraries have any other dependencies.

So, don't include that header.

>> On a more philosophical level, neither library should provide
>> specialize any Boost.QVM templates for types from another library
>> unless one of the following is true: - The library in question
>> requires such specializations as part of its internal workings,
>> i.e. there is a strong, one-way dependency from the>> library in
>> question to the other library. - The whole point of the library in
>> question is to provide such specializations. In the former case,
>> there are IMO sufficient protections against ODR violations. In
>> the latter case, there is no point in using more than one such
>> library in any given program.
>
> I disagree with your assertion that those are the only valid reasons.
> Each may specialize the trait to specify their own type as the result
> when the two interact. Any user that combines code that triggers the
> inclusion of both sets of specializations would lead to an ODR
> violation, and there would be no clue that it has occurred. That is
> the danger inherent in such a customization point.

This is not a valid reason, precisely because it can lead to an ODR
violation.

-- 
Rainer Deyke (rainerd_at_[hidden])

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