Re: Template pred is true for pred!(pred!(pred)) but not for value "true"

2015-03-08 Thread anonym...@example.com via Digitalmars-d-learn
On Sunday, 8 March 2015 at 15:41:23 UTC, Meta wrote: template canBeAlias(T...) if (T.length == 1) { static if (is(typeof({alias _ = T[0];}))) { enum canBeAlias = true; } else { enum canBeAlias = false; } } pragma(msg

Re: Strange behavior of the function find() and remove()

2015-03-08 Thread anonym...@example.com via Digitalmars-d-learn
On Sunday, 8 March 2015 at 21:34:25 UTC, Dennis Ritchie wrote: This is normal behavior? import std.stdio; import std.algorithm; void main() { auto a = [3, 5, 8]; writeln(find(remove(a, 1), 5).length != 0); // prints false writeln(a); // prints [3, 8, 8]