Boost logo

Boost :

From: Reid Sweatman (borderland_at_[hidden])
Date: 2000-01-15 19:08:54


Okay, point clear. At first I was thinking that a variable-size
Random-access Container would do the trick, but the only ones defined in the
STL both imply order, and Container alone won't do it. Your concept is
closer to the mark.

> -----Original Message-----
> From: jsiek_at_[hidden] [mailto:jsiek_at_[hidden]]
> Sent: Thursday, January 13, 2000 11:00 AM
> To: boost_at_[hidden]
> Subject: [boost] Re: Bag concept
>
>
> Hi Reid,
>
> Just to clarify a bit, what I'm proposing here is a *concept* (in the
> SGI STL sense of the word), not an actual class. It's an abstract set
> of requirements that a number of classes could potentially fulfill.
>
> In addition, the concept I was aiming at, as Kevlin pointed out,
> should not be called a Bag because it does not have the set operations
> (its closer to the idea of a stack or queue).
>
> However, you make a great point in that there is also need for the true
> Bag concept and some good classes that fulfill the requirements.
> Here's a stab at the true Bag concept:
>
> concept Bag
> refines Collection
>
> pair<bool,iterator> insert(const T& val);
> size_type erase(const T& val);
> iterator find(const T& val);
>
> With the requirement for Collection, all the STL set operations can
> be performed on a Bag.
>
> Then, as you suggested, there are several interesting ways to
> implement a Bag... (std::set is one of them)
>
>
> Cheers,
>
> Jeremy
>
> ----------------------------------------------------------------------
> Jeremy Siek
> Ph.D. Candidate email: jsiek_at_[hidden]
> Univ. of Notre Dame work phone: (650) 933-8724
> and cell phone: (415) 377-5814
> C++ Library & Compiler Group fax: (650) 932-0127
> SGI www: http://www.lsc.nd.edu/~jsiek/
> ----------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
> Toys, Books, Software. Save $10 on any order of $25 or more at
> SmarterKids.com. Hurry, offer expires 1/15/00.
> http://click.egroups.com/1/646/1/_/9351/_/947789337/
>
> -- Check out your group's private Chat room
> -- http://www.egroups.com/ChatPage?listName=boost&m=1
>
>
>
>


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