This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
question about anonymous union usage
- From: Jeffrey Holle <jeff dot holle at verizon dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 09 Aug 2004 15:04:37 -0700
- Subject: question about anonymous union usage
- Reply-to: jeff dot holle at verizon dot net
I'm using g++ v3.4.1.
I'm considering using an anonymous union in the following fashion:
class SomeClass
{
....
private:
bool isPseudo_;
union {
LayoutVertex *layoutVertex_;
PseudoVertex *pseudoVertex_;
};
}
Both LayoutVertex and PseudoVertex have the same methods.
Only in the constructors of SomeClass will I have to code in a way that
differenciates between layoutVertex_ and psuedoVertex_.
My question is can I safely use layoutVertex_ elsewhere even if its
initialized with a PsuedoVertex object?