[Issue 9847] ICE on CTFE literal cast(uint) on DMD 2.062

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 31 14:21:19 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9847


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at ubuntu.com


--- Comment #1 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-03-31 14:21:18 PDT ---
Further reduction:

----
import std.array;

template MsgMixin()
{
  mixin annotStructMembers!(MsgHeader.init);
}

template MsgReqMixin(T ...)
{
  mixin MsgMixin!T;
}

template annotStructMembers(T ...)
{
  mixin(mixinMembers!T);
}

struct MsgHeader
{
  alias uint tProcId;
  alias uint tNodeId;
  const PROC_INVALID = 0;
  tProcId m_procId = PROC_INVALID;
  tNodeId NODE_SELF;

  this(procId, tNodeId) {}
}

struct MsgLogFlush
{
  mixin MsgReqMixin;
}

Ret[] iterAnnotStruct(Ret, alias Op, int index, string member, T ...)()
{
  return [Op!(index, member, T).value];
}

string mixinMembers(T ...)()
{
  struct Op(V ...) {
      const value = V[0].stringof ~ V[1] ~ " = " ~ V[2].stringof;
  }
  return join(iterAnnotStruct!(string, Op, 0, "", T));
}
----


Regards
Iain

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list