|
Boost : |
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-08-02 09:43:56
<FlSt_at_[hidden]> wrote:
> I uploaded a new version of the junction comparison of ranges to boost
> sandbox file vault ( flos_junction_v6.zip ).
I wrote down few notes.
/Pavel
________________________________________________________
1. I compiled and tested the library under Intel 7.0
(plugged in VC6 IDE).
BCB 6.4 and VC6.5 failed as lambda doesn't
support these compilers.
________________________________________________________
2. The header may have:
#if (defined_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif
on the top (after guard macros) to help
a little bit with compilation time for
Intel and VC.
________________________________________________________
3. There should be overloads of "xyz_of"
who take pair of iterators,
in the old-fashioned STL way.
________________________________________________________
4. Perhaps the could be rewritten not
to use macros as code generators.
It is not possible to debug it as
it is now, for example.
________________________________________________________
5. The classes like conjuction etc may be likely
moved into sub-namespace like boost::junction_details.
________________________________________________________
6. Would it be possible to have other qualifiers,
e.g.: "more_than_half_of"
if (more_than_half_of(a) >= any_of(b)) ...
or more complex versions like:
more_than(10).items_of(a) >= ...
more_than(30.1).percents_of(a) == ...
less_than(2).items_of(a) >= ...
less_than(95).percents_of(a) == ...
between(1, 5).items_of(a) >= ...
between(10.5, 20.0).percents_of(a) == ....
exactly(10).items_of(a) >= ....
Comparison between two "mores" would be
disabled.
________________________________________________________
7. Will it be possible to use other predicates than
>, <=, etc in following form:
if ( is_true_that(all_of(a), a_binary_functor, one_of(b)) ) ...
where the functor could be lambda:
if (is_true_that(all_of(a), _1 >= _2, one_of(b)) ....
It feels more natural than the asymetric "do_comparison".
________________________________________________________
8. If the "is_true_that" will be implemented than
a filter "where" could be considered, like:
if ( is_true_that(all_of(a), _1 >= _2,
one_of(b) ).where(_1->does_fulfill_condition()) ) ...
and the "where" fould have unary predicate as parameter,
this predicate would filter out undesirable items from
both ranges.
________________________________________________________
EOF
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk