Is Key Type?

2015-08-02 Thread Xinok via Digitalmars-d-learn
is there a trait in D or Phobos which will tell you if a type can be used as a key for an associative array? For example, where T is some type: static assert(isKeyType!T) int[T] hashTable = ...

Re: Is Key Type?

2015-08-02 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 2 August 2015 at 17:55:16 UTC, Xinok wrote: is there a trait in D or Phobos which will tell you if a type can be used as a key for an associative array? For example, where T is some type: static assert(isKeyType!T) int[T] hashTable = ... import std.stdio; enum