Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-08-09 22:19:29


From: Matthew Vogt <mattvogt_at_[hidden]>
> Matthew Vogt wrote:
>
> > How about 'subrange_of'?
>
> Actually, scratch that; it doesn't sound right. It *is* a subset you're
> finding, albeit with extra constraints. Maybe 'bounded_subset_of'?
>
> I like the 'between' formulation in your other post.

I've uploaded yet another revision of multivalues.zip. I decided
to go with "some" for n_m/subrange/subset/i_j/a_z/x_y/etc.

New features:

 - some_values/some_of:

   if (some_of(3, 5, r) > 3) ... // at least 3 and less than 6 > 3

   (I selected the argument order shown because "some" precedes
   "of" and "values" and so it rather suggests that the minimum
   and maximum should precede the range.

 - implementing n_of/n_values and one_of/one_value in terms of
   some* which should reduce template instantiations

 - some_of/some_values (formerly n_m_of/n_m_values) and
   n_of/n_values are now implemented using data members for the
   minimum and maximum count to reduce template instantiations
   and to support between and exactly
 - adds between

   if (between(3, 5).items_of(r) > 3) ...

 - adds exactly

   if (exactly(3).items_of(r) > 3) ...

 - all of the above work with pairs of iterators, too (no need to
   use boost::make_iterator_range())

 - separated code into distinct headers plus one multivalues.hpp
   to suck in everything

 - added detail subdirectory

This one runs 2016 tests and compiles in just over nine minutes
on my system (still GCC 3.2.3).

There are still some things missing:

 - tests for some_of, between, and exactly.

 - support for user-defined predicates that only know how to
   compare to values and not multivalues

 - documentation

If there is reasonable consensus for what we have thus far, among
those interested in this library, I think we should start to work
on some documentation so more people will take a look at the
library.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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