Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-09-01 07:52:14


Hi Angle,

some comment to your code:

    iterator begin(){ return iterator(items.begin(),0); };
    iterator end(){ return iterator(items.end(), items.size()); };
--------------------------
should have const versions too

    size_type size() { return items.size(); }
    size_type max_size() { return items.max_size(); }
    bool empty() { return items.empty(); }
--------------------
should all be const

"AngleWyrm" <anglewyrm_at_[hidden]> wrote in message news:BAY15-DAV12pta7qPsd0001f50d_at_hotmail.com...
|A proposal for inclusion into the boost libraries:
|-----------------------------------------------
|
|The hat container derives it's name from the act of pulling names from a
|hat. It is a container which provides random selection of it's contents,
|where the items can have differing probabilities, and can either be removed
|like cards from a deck, or come up again like rolling dice.

your documentation looks very good, though I would like you to consider one important issue:

It seems to me that the hat class is more a bunch of algorithms than a container; instead of requiring users
to use the hat class, maybe you could see if it is possible to come up with a set of generic algorithms that
work on any container with certain properties.

br

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk