Re: Can Class be Inter-refferenced?
- From: "Duane Hebert" <spoo@xxxxxxxxxx>
- Date: Sat, 11 Nov 2006 11:39:17 -0500
"Mark Randall" <markyr@xxxxxxxxxxxxxx> wrote in message
news:%23DjSyoYBHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
"David Wilkinson" <no-reply@xxxxxxxxxxxx> wrote in message news:%
Gotta say, when I saw Will's code I thought it was wrong also, but when I
checked it I found that it worked! I'm so used to using forward
declaration with pointers or references, I guess.
I took another look at the issue.
Someone who knows the C++ standard would have to check, but I figured this
is because when the function is called the size of ClassB must be known
anyway (ClassB included in the cpp file) or else compilation would fail
with an incomplete type.
I think passing an incomplete type would only be a problem
with std templates. I'm not sure what the standard
says about this. It doesn't usually come up for
me as passing the object as a const & is generally preferred.
.
- References:
- Can Class be Inter-refferenced?
- From: Lazytiger
- Re: Can Class be Inter-refferenced?
- From: William DePalo [MVP VC++]
- Re: Can Class be Inter-refferenced?
- From: Mark Randall
- Re: Can Class be Inter-refferenced?
- From: John Carson
- Re: Can Class be Inter-refferenced?
- From: David Wilkinson
- Re: Can Class be Inter-refferenced?
- From: Mark Randall
- Can Class be Inter-refferenced?
- Prev by Date: Re: ostream question, help please!!!
- Next by Date: Re: Can Class be Inter-refferenced?
- Previous by thread: Re: Can Class be Inter-refferenced?
- Next by thread: Re: Can Class be Inter-refferenced?
- Index(es):
Relevant Pages
|