J
Jorgen Grahn
It depends. I've a counter class, which is nothing more than an
int which takes care of initialization and overflow detection
(and doesn't support anything but ++ and --).
Yes, that was the kind of thing I was thinking of -- removing
flexibility and assigning specific meanings to existing types.
I'd probably use a lot more
such classes if they didn't require so much effort to write;
I have done it recently (see the thread "Simple and clear ways of
creating distinct types" from back in January) and I have to say I am
happy with it. The effort wasn't as big as it seemed at first, and the
benefits were sometimes magical -- lots of silly mistakes no longer
could happen, finding good names for things became easier, ...
But I noted that when I have stable, tiny building-blocks, I *am*
tempted to be a bit sloppy with the bigger objects which have
behaviour.
/Jorgen