Boost logo

Boost :

From: johnrpanzer (jpanzer_at_[hidden])
Date: 2002-01-28 13:39:03


All,

Many moons ago, I asked if there would be any interest
in something to do runtime concept checking (at least
for ordering predicates). One or two people expressed
some mild curiosity, so as part of my New Year's resolutions,
I've uploaded a draft implementation of an ordering
predicate checker to:

http://groups.yahoo.com/group/boost/files/test_strict_weak_ordering/

Example:

less_equal<T> is not a Strict Weak Ordering. The code:

    int intdata[] = {3, 5, 8 , 29, 872, 5839};
    assert(test_strict_weak_ordering(less_equal<int>(),
                                     intdata,intdata+6));

will produce output like:

  Predicate fails irreflexivity; a<a not allowed:#0=3
  Predicate fails irreflexivity; a<a not allowed: #1=5
  ...
  Predicate fails antisymmetry; a<b and b<a: #0=3, #0=3
  Predicate fails antisymmetry; a<b and b<a: #1=5, #1=5
  ...
  assertion failed, line 15: ...

Please let me know what you think.

Regards,
John Panzer
jpanzer_at_[hidden]
jpanzer_at_[hidden]


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