lindek@alberta.uucp (07/24/89)
Hi, there. I was trying to used genclass to generate a Ent list, where
Ent is defined by "typedef void* Ent;". However, EntList has the two
constructors EntList(Ent head) and EntList(Pix p). Since Pix is also defined
to be (void *), g++ complained the conflict between these two constructors.
Does anyone have any suggestions about what I should do? What's the use of
EntList(Pix p)?
Thanks in advance.
Dekang
-------------------------------------------------------------------------
Dekang Lin PHONE:
OFFICE: 1-403-492-2821
Department of Computing Science HOME: 1-403-425-0219dl@G.OSWEGO.EDU (Doug Lea) (07/29/89)
This is a real problem. A Pix (pseudoindex) is used to index/traverse containers in an array- or list-like fashion. See libg++.texinfo. For efficiency reasons it is currently defined via a typedef (to void*) instead of as a class. It is likely that someday, g++ will provide enough optimization features that defining Pix as a class will incur no such penalty (this will also make them a bit safer to use). Until then I suppose the only workaround is for you to comment out the EntList(Pix) constructor in your version, since you probably can live without it (It is useful only in creating new Lists headed by some traversal pointer Pix). -Doug