Re: Lahman, how ya doing?



Gregory L. Hansen wrote:
In article <0%Qde.43511$4v.31435@trndny03>,
H. S. Lahman <hsl@xxxxxxxxxxxxxxxxx> wrote:

Responding to Hansen...


class EventElement
{
private:
   Object* recipient;
   int event_id;
   int tick_count;
public:
   EventElement (Object* r, int e, int t)
      {recipient = r; event_id = e; tick_count = t;};
   int getTickCount() {return tick_count;};
}


Let me ask you, why is this a class? I usually think of classes as something with member functions that do things with the data. I would have used a struct as a passive holder of data.



For one thing, it allows us to create instances which are immutable objects.

For another, we can use polymorphic calls with a class over a struct ('c' struct I take it you mean - as C++ structs are the same as Classes but with different default access rights).



.



Relevant Pages