Boost logo

Boost :

From: Florian Stegner (FlSt_at_[hidden])
Date: 2005-08-10 08:10:12


Rob Stewart wrote:
> 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

I aggree with it. But each_of is still confusing for me. You
implemented it as the negation of all_of: "( all_of( a ) > x ) != (
each_of( x ) > x )" is true for all a and x. each_of in your
implementation is equivalent to not_all_of in mine. not_all_of in your
implementation is the negation of one_of, what is ok. But each_of( a )
== x means that none or more but not all elements of a are equal to x.
There must be a better name as each_of. I had just a quick look on your
new implementation. I will post my results later.

> This one runs 2016 tests and compiles in just over nine minutes
> on my system (still GCC 3.2.3).
Could you send me the testfiles .cpp or upload them to the sandbox file
vault? Then I could help you to complete them. What is about the tests
for the relations between the multivalues I sent you?

> There are still some things missing:
>
> - tests for some_of, between, and exactly.

I found also relations between expressions with one_of.

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

My implementation (v11) can compare two multivalues (junctions) with
user defined predicates. I wrote swap_operands as a function object
wrapper, if the rhs-parameter is a multivalue. There is still the
problem with lambda-expressions. The only working idea I found to allow
the usage of lambda expressions would be to have a function like this:

compare( all_of( a ), _1 < _2, any_of( b ) )

But what is about the []-operator?

all_of( a ) [ _2 > _1 ] any_of( b )

Then we would have no more problems with operator precendence. :-)

> - documentation

I will help you so good I can.

> 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.

There is a boost-sandbox CVS. Now after we have a common version ( Now
it makes no sense develop my prototype further ) this would be a good
place for our library. Or is the stage to early?

Sincerely
   Florian


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