Re: reading a declaration
From: Gary Labowitz (glabowitz_at_comcast.net)
Date: 12/15/04
- Next message: Ivan Vecerina: "Re: C++ Question about its possibilites to XP.."
- Previous message: Lawrence Kirby: "Re: small numerical differences in floating point result between wintel and Sun/SPARC"
- In reply to: Dave O'Hearn: "Re: reading a declaration"
- Next in thread: Karl Heinz Buchegger: "Re: reading a declaration"
- Reply: Karl Heinz Buchegger: "Re: reading a declaration"
- Reply: msalters: "Re: reading a declaration"
- Reply: Dave O'Hearn: "Re: reading a declaration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Dec 2004 08:59:22 -0500
"Dave O'Hearn" <daveoh77@pobox.com> wrote in message
news:1103114552.392005.149950@z14g2000cwz.googlegroups.com...
> Mike Wahler wrote:
> > "Dave O'Hearn" <daveoh77@pobox.com> wrote:
<<huge snip>>
> I think this view is most helpful when deciding whether to pass an
> argument by pointer with its address, or by reference.
You got me thinking; isn't a reference more like a #define that has scope?
What I mean is: #define ref x
would do what int &ref = x;
does EXCEPT with define there is no scope or type checking. In other words,
whenever the compiler sees ref, it uses x.
If so, couldn't a compiler implement the references by precompiling them
with the substitution, adding #defines to set and unset the variable and
then
compile as normally? This would be a lot of overhead, of course, but would
it give the same result?
-- Gary
- Next message: Ivan Vecerina: "Re: C++ Question about its possibilites to XP.."
- Previous message: Lawrence Kirby: "Re: small numerical differences in floating point result between wintel and Sun/SPARC"
- In reply to: Dave O'Hearn: "Re: reading a declaration"
- Next in thread: Karl Heinz Buchegger: "Re: reading a declaration"
- Reply: Karl Heinz Buchegger: "Re: reading a declaration"
- Reply: msalters: "Re: reading a declaration"
- Reply: Dave O'Hearn: "Re: reading a declaration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|