On 05/07/2015 05:19 PM, Justin Whear wrote:
On Thu, 07 May 2015 16:55:42 -0400, Nick Sabalausky wrote:

      // There's gotta be a better way to convert EnumMembers!T // to a
      range, right? But std.range.only() didn't work, // due to a
      template instantiation error.
      T[] members;
      foreach(m; EnumMembers!(T))
          members ~= m;

T[] members = [ EnumMembers!T ];


Doh! Yup, that works.

Still, I would think there should be a way to do it without allocating an array. But it's not a huge deal right now though.

Reply via email to