Title
Reformulating NonemptyRange axiom
Status
nad concepts
Section
[rand.concept.urng]
Submitter
Walter Brown

Created on 2009-06-25.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.19:06:53

Proposed resolution:

In [rand.concept.urng], replace the NonemptyRange axiom by:

axiom NonemptyRange(G& g) { 
   G::min() < G::max(); 
}
requires True< G::min() < G::max() >;
Date: 2010-10-21.19:06:53

[ Post-Rapperswil: ]

Moved to Tentatively Ready after 5 positive votes on c++std-lib.

Date: 2009-06-25.00:00:00

In [rand.concept.urng], we have the following:

concept UniformRandomNumberGenerator<typename G> : Callable<G> {
  ...
  axiom NonemptyRange(G& g) {
    G::min() < G::max();
  }
  ...
}

Since the parameter G is in scope throughout the concept, there is no need for the axiom to be further parameterized, and so the axiom can be slightly simplified as:

axiom NonemptyRange()  {
  G::min() < G::max();
}

We can further reformulate so as to avoid any axiom machinery as:

requires True< G::min() < G::max() >;

This is not only a simpler statement of the same requirement, but also forces the requirement to be checked.

History
Date User Action Args
2010-10-21 19:06:53adminsetmessages: + msg4761
2010-10-21 18:28:33adminsetmessages: + msg919
2009-06-25 00:00:00admincreate