Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-06-14 18:21:21

David Abrahams wrote:
> on Thu Jun 14 2007, Eric Niebler <> wrote:
>> I also seem to recall that there was still some question as to whether
>> the use of the reference violated the ODR, if the reference is not
>> optimized away. I don't think we ever got an answer to that question.
> I don't think there ever was any question about that. At least, I
> never had a question about it. References don't have any identity
> distinct from the object they reference.

Funny you should say that, since you were the one who sent the "Are
references subject to ODR?" question to the std reflector:

> David Abrahams <dave_at_[hidden]>
> 4/1/06
> reply-to c++std-core_at_[hidden]
> to undisclosed-recipients <>
> date Apr 1, 2006 9:02 AM
> subject Are references subject to ODR?
> To: C++ core language mailing list
> Message c++std-core-11390
> Is the following program legal?
> // a.cpp
> int x;
> int& y = x;
> // b.cpp
> extern int x;
> int& y = x;
> My impression is that it is not legal because references are not
> explicitly given an exemption in 3.2/5
> If I am right, should it be so? It's hard to imagine how this could
> be a problem.

The result of ensuing discussion was that a reference is a pointer, and
so they *do* have identity.

Eric Niebler
Boost Consulting
The Astoria Seminar ==>

Boost list run by bdawes at, gregod at, cpdaniel at, john at