static function T min( T x, T y, comparator#(T) cmp = null )
static Returns the smaller item.
| x | An item of type T. |
| y | Another item of type T. |
| cmp | optional A strategy object used to compare the items. If not specified or null, comparator #(T) is used. The default is null. |
assert( choice#(int)::min( 1, 2 ) == 1 );
static function T max( T x, T y, comparator#(T) cmp = null )
static Returns the larger item.
| x | An item of type T. |
| y | Another item of type T. |
| cmp | optional A strategy object used to compare the items. If not specified or null, comparator #(T) is used. The default is null. |
assert( choice#(int)::max( 1, 2 ) == 2 );
virtual Provides functions to choose an item.
virtual class choice #( type T = int )
static Returns the smaller item.
static function T min( T x, T y, comparator#(T) cmp = null )
static Returns the larger item.
static function T max( T x, T y, comparator#(T) cmp = null )
singleton Provides strategies to compare objects.
class comparator#( type T = int )