Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-11 12:23:36


AMDG

David Abrahams wrote:
> I don't think that accurately characterizes the issue. I think few
> compilers do anything to detect ODR violations. However, link-time
> stripping of common template instantiations (or link-time instantiation)
> seems likely to cause only a single behavior in both TUs where two
> behaviors may have been intended.
>

I'm sorry I wasn't clear. What I meant was that it's quite difficult
to implement a test to see whether a given overload is present, so
it isn't used very often. The real danger of course, is that when multiple
functions depend on the presence of absence of an overload, the
linker can select definitions of two functions which are incompatible.

>> but I'm very concerned because C++0x concepts
>> are supposed to make such overloading easy.
>>
>
> I'm not sure I see the relationship to C++0x concepts. Care to say
> more?
>

I think that templates which are vulnerable to this kind of nastiness
are likely to be much more common with C++0x concepts. That's all.

I'm thinking that the most reliable way to deal with this is to
/always/ provide forward declarations of functions that
should be found by ADL, even if they are defined in a separate
header.

In Christ,
Steven Watanabe


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