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!
>>
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)
> {
>
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);