Boost logo

Boost :

Subject: Re: [boost] Provisional Boost.Generic and Boost.Auto_Function (concepts without concepts)
From: Dave Abrahams (dave_at_[hidden])
Date: 2010-12-14 05:14:04


At Tue, 14 Dec 2010 15:35:04 +0800,
Dean Michael Berris wrote:
>
> I don't see an obvious problem here in terms of ODR here because you
> are using a template -- which by definition still gets instantiated
> anyway across multiple translation units,

No, not by definition. EDG still has a link-time instantiation
option.

> and is not required to have a single definition anyway.

That would be news to me! Do you have a reference?

That said, if all the type difference occurs *within* the decltype
*and* within the decltype there are no ODR violations, I *think* there
is technically no ODR violation. But I suggest asking a real
hard-core core-language expert on this one if you care about technical
correctness.

> The only worrying thing is that if the nested function invocation
> referred to has a static but non-extern linkage, and thus will be
> defined in multiple translation units -- some compilers issue a
> diagnostic on this occurrence although I forget if the standard
> requires that a diagnostic be emitted in cases where you have nested
> static functions in templates. Maybe those who actually know enough
> about the relevant sections of the standard can chime in.

If someone prepares a _minimal_ representative example of the question, I'll
be happy to run it by someone who knows for you.

> On Sun, Nov 14, 2010 at 6:15 AM, Matt Calabrese <rivorus_at_[hidden]> wrote:
> > The next question is much more devious and I have a feeling implies a
> > blatant violation of ODR.

Ditto.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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