digitalmars.D.learn - Builtin Support for Comparison Function for Primitive Types
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (4/4) May 02 2015 Why doesn't std.algorithm.comparison.cmp support primitive types
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (3/7) May 02 2015 Correction if mean
- "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> (5/9) May 02 2015 I just found some forgotten code of my that solves it through
Why doesn't std.algorithm.comparison.cmp support primitive types such as assert(cmp(0,1) == true); ?
May 02 2015
On Saturday, 2 May 2015 at 08:29:11 UTC, Per Nordlöw wrote:Why doesn't std.algorithm.comparison.cmp support primitive types such as assert(cmp(0,1) == true); ?Correction if mean assert(cmp(0,1) == -1);
May 02 2015
On Saturday, 2 May 2015 at 08:29:11 UTC, Per Nordlöw wrote:Why doesn't std.algorithm.comparison.cmp support primitive types such as assert(cmp(0,1) == true); ?I just found some forgotten code of my that solves it through import std.range: only; assert(cmp(only(0), only(1)) == -1); Why the detour over std.range.only()?
May 02 2015