On Sun, May 26, 2002 at 01:20:04AM +0200, Lars Gullik Bjønnes wrote: > | bool operator==(enum_set<T> const & s) const { > | return val_ == s.val_; > | } > > should not be class function
I'm lost completely on how this is possible. > (and you cheat again by introducing a int... why should that type > really make an apperance?) Same here. How the hell can I support |= without an int ? > should not be class function Maybe if you give some illustrative code I can work out how to do it. > No, do not do this, use static_cast in the functions that need it > instead. hmm ok > (btw. are you sure it is used at all? T is not value_type) I know T != value type, it's not supposed to be. I don't see how to do operator|() without exposing val_ publicly, which makes the whole endeavour pointless, no ? > | if (blah & key_modifier::ctrl) > > > | to work ?? > > What type is blag? enum_set<T> of course > and since LHS is not of type enum_set<> you operator > enum_set<>::operator& does not come into play. But it is ! > As said I do not like this kind of template classes a lot, in cases > like this it is, IMHO, a lot better to use concrete classes. So I have a class hierarchy for such a silly little thing ?? Please demonstrate the code you are talking about. thanks john -- "Time is a great teacher, but unfortunately it kills all its pupils." - Hector Louis Berlioz