|
Boost : |
From: spamjunk_at_[hidden]
Date: 2002-08-27 07:15:12
The element type don't have to be an enum. You can use an integer, so you
wouldn't have to cast.
I'm thinking about adding iterators to the class, but that would be later.
> May be you are right, but I'd like to know size of container, I'd like iterator.
> Also I'd like contain with integer interface. It will make me happy :-). I
explain you
smth.
> I have client\server application. I do a lot of enum serialization between
client and
server.
> So if I want to test whether just unserialized enum value is legal or not I
have to make
casting
> to its enum. It doesn't look good( for my opinion of course).
>
> And also
> enum large {null_large = 0, b1 = 1, b3 = 3, b7 = 7, b32 = 32, b34 = 34,
> b250 = 250, b254 = 254, b255 = 255, num_large};
>
> typedef discrete_set<large, b255, b1, null_large> lset;
>
> It is not intuitive to me. I'd like to see "begin - end" concept.
>
> lset _lset;
> //... fill set
>
> unsigned int _uilarge = num_large;
> Unserialize(&_uilarge);
> assert( _lset.contain( static_cast<large>(_uilarge))); // <== Doesn't looks
good. I have a
lot of code like this
>
> Roman
>
>
>
> > -----Original Message-----
> > From: Victor A. Wagner, Jr. [mailto:vawjr_at_[hidden]]
> > Sent: Tuesday, August 27, 2002 8:39 AM
> > To: boost_at_[hidden]
> > Subject: RE: [boost] discrete_set class
> >
> >
> > the whole point is it's NOT the STL set...it's a useful one.
> > At Monday 2002/08/26 23:47, you wrote:
> > > Hi. I tested your class and I have a few comments. I didn't
> > > looked at your implementation.
> > >It seems to me that if your call your class discrete_set you
> > need the
> > >interface we are used to - STL set interface.
> > >Am I wrong? Second there is an exception in contain
> > function. Third it
> > >lies. I attach test file. Uncomment assert
> > >in order to see wrong contain result. Comment them again to
> > see unhandled
> > >exception.
> > >
> > >Roman
> > >
> > >_______________________________________________
> > >Unsubscribe & other changes:
> > http://lists.boost.org/mailman/listinfo.cgi/boost
> >
> > Victor A. Wagner Jr. http://rudbek.com
> > PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
> > PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4
> > 63BB 9D93
> > The five most dangerous words in the English language:
> > "There oughta be a law"
> >
> > _______________________________________________
> > Unsubscribe & other changes:
> > http://lists.boost.org/mailman/listinfo.cgi/boost
> >
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
pop-server.stny.rr.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk