Listing 1: Implementation for the function modifier

template <Code argcount, Code code4, Code code3, Code code2,
  Code code1>
struct FunSwitch; // no definition of primary

template <Code code4, Code code3, Code code2, Code code1>
struct FunSwitch<0,code4,code3,code2,code1> { // R ()
  typedef typename GenType<code4,code3,code2,code1>::GTR RetType;
  typedef RetType FSR(void);
};

template <Code code4, Code code3, Code code2, Code code1>
struct FunSwitch<1,code4,code3,code2,code1> { // R (A)
  enum {
    arglen = code1 & ((1<<ArglenLen)-1),
    argshiftlen = (CodeLen*NumCodes)-(arglen+ArglenLen),
    
    rc1 = ShiftRight<code4,code3,code2,code1,
      arglen+ArglenLen>::code1,
    rc2 = ShiftRight<code4,code3,code2,code1,
      arglen+ArglenLen>::code2,
    rc3 = ShiftRight<code4,code3,code2,code1,
      arglen+ArglenLen>::code3,
    rc4 = ShiftRight<code4,code3,code2,code1,
      arglen+ArglenLen>::code4,
    
    t1 = ShiftLeft<code4,code3,code2,code1,argshiftlen>::code1,
    t2 = ShiftLeft<code4,code3,code2,code1,argshiftlen>::code2,
    t3 = ShiftLeft<code4,code3,code2,code1,argshiftlen>::code3,
    t4 = ShiftLeft<code4,code3,code2,code1,argshiftlen>::code4,
    
    ac1 = ShiftRight<t4,t3,t2,t1,argshiftlen+ArglenLen>::code1,
    ac2 = ShiftRight<t4,t3,t2,t1,argshiftlen+ArglenLen>::code2,
    ac3 = ShiftRight<t4,t3,t2,t1,argshiftlen+ArglenLen>::code3,
    ac4 = ShiftRight<t4,t3,t2,t1,argshiftlen+ArglenLen>::code4
  };
  typedef typename GenType<rc4,rc3,rc2,rc1>::GTR RetType;
  typedef typename GenType<ac4,ac3,ac2,ac1>::GTR ArgType;
  typedef RetType FSR( ArgType );
};
  
template <Code code4, Code code3, Code code2, Code code1>
struct ModSwitch<Fun,code4,code3,code2,code1> { // ()
  enum {
    argcount = code1 & ((1<<ArgcountLen)-1),
    c1 = 
      ShiftRight<code4,code3,code2,code1,ArgcountLen>::code1,
    c2 =  
      ShiftRight<code4,code3,code2,code1,ArgcountLen>::code2,
    c3 = 
      ShiftRight<code4,code3,code2,code1,ArgcountLen>::code3,
    c4 = 
      ShiftRight<code4,code3,code2,code1,ArgcountLen>::code4
  };
  typedef typename FunSwitch<argcount,c4,c3,c2,c1>::FSR MSR;
};
— End of Listing —