Re: enum template shorthand and short circuit evaluation

2014-06-10 Thread Byron Heads via Digitalmars-d-learn
On Tue, 10 Jun 2014 17:06:08 +0200, Artur Skawina via Digitalmars-d-learn wrote: > On 06/10/14 02:28, Byron via Digitalmars-d-learn wrote: >> Should this work? It seems like the short circuit booleans are not >> working: >> >> enum isPrimitive(T) = isBasicType!T || (isArray!T && isBasicType! >>

Re: enum template shorthand and short circuit evaluation

2014-06-10 Thread Artur Skawina via Digitalmars-d-learn
On 06/10/14 02:28, Byron via Digitalmars-d-learn wrote: > Should this work? It seems like the short circuit booleans are not > working: > > enum isPrimitive(T) = isBasicType!T || (isArray!T && isBasicType! > (ForeachType!T)); [...] > But this style works: > > template isPrimitive(T) > { >

enum template shorthand and short circuit evaluation

2014-06-09 Thread Byron via Digitalmars-d-learn
Should this work? It seems like the short circuit booleans are not working: import std.traits; enum isPrimitive(T) = isBasicType!T || (isArray!T && isBasicType! (ForeachType!T)); void main() { assert(isPrimitive!int); assert(isPrimitive!char);