Can inserter/extractor operator overrides be made run-time polymorphic?

N

Neil Cerutti

Bullshit. What do you think a reference is?

If you were implementing a reference, would it inherit from
pointer or contain an instance of pointer? Which relationship
implies is-a?
 
V

Victor Bazarov

Randy said:
I reserve the right to investigate and understand "what's under the
hood" of any code-generating tool I use. If that is a problem for
the tool maker, I'll start looking for another tool, because
the day this becomes unknowable is the day we start
losing touch with reality. The implementation matters,
the hardware matters, the assembly code generated
matters.

It sounds to me like you all know damn well that a reference
is a pointer with some help from the compiler, but would
prefer to dance around the fact. If you really think it's
not, then find a compiler writer around here who can
explain how they actually implemented it.

Dear Randy,

Don't crawl into a bottle here. Whatever the implementation of references
in any particular compiler is, does NOT matter. The syntax that would
declare a "constant reference" is _not_allowed_, your attempt to treat is
as if it were legal notwithstanding.

int * const p;

and

int const * p;

are different, yes, and both are legal declarations. However,

int const & r;

is legal (and declares a reference to a constant integer) and

int & const r;

is NOT legal. Conjuring some implementation detail to try to make this
legal is pointless. The Standard explicitly prohibits 'const' and
'volatile' to be applied to _a_reference_.

We're not "dancing around" anything. If you want to achieve a higher
level of understanding what we're talking about, chuck the Schildt's books
you got and get yourself a copy of the Standard and a couple of _decent_
editions, like Stroustrup's "TC++PL", and Josuttis' "TC++SL:T&R", and
Alexandrescu's "MC++D", etc.

V
 
J

JustBoo

See some of my other posts for what this attitude - ignorance actually
- is. It's baahahahahahaad. Void.com is certainly correct.
How references are treated during execution of compiled code
is of no concern.

(8-O) You've never worked on anything "important" have you. And if you
have, I hope never to work with you. In my world, people like you get
sane people hurt or worse.

Totally Bogus?

Keep on raging - to stop the aging.
-Dale Carnegie. Of the brain, I append.
 
T

TB

JustBoo sade:
See some of my other posts for what this attitude - ignorance actually
- is. It's baahahahahahaad. Void.com is certainly correct.


(8-O) You've never worked on anything "important" have you. And if you
have, I hope never to work with you. In my world, people like you get
sane people hurt or worse.

If you can't separate language from implementation, then
right back at you. Take it to alt.flame or somewhere
else if you wish to continue down this path.

TB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top