Re: [Ctool-develop] using ctool as a library
Brought to you by:
flisakow
|
From: Steven S. <ste...@cs...> - 2003-08-01 17:57:43
|
Stefan Seefeld wrote:
> virtual void traverse_base(BaseType *) = 0;
> virtual void traverse_ptr(PtrType *) = 0;
> virtual void traverse_array(ArrayType *) = 0;
> virtual void traverse_bit_field(BitFieldType *) = 0;
[etc.]
Can I ask why all the functions have different names? Wouldn't it be
more natural to give them all the same name and then overload on the
argument type?
If they all have the same name then instead of calling it traverse,
it could be operator(). Accept code could then look like:
virtual void accept(Traversal &t) { t(this); }
I suspect a reference to a Traversal is more helpful than a pointer
as references can't be NULL and there's no need to rebind t partway
through a function.
- Steven
--
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
|