public void addToAA(char[] var_name, KT, ET)(KT key, ET element) { mixin(ET.stringof~`[]* elements = key in `~var_name~`;`); if( elements == null ) { ET[] temp; temp.length = 1; temp[0] = element; mixin(var_name~`[key] = temp;`); } else { (*elements).length = (*elements).length + 1; (*elements)[(*elements).length-1] = element; } }
- Sorry, I just love templates, AAs and mixins :) Saaa
- Re: Sorry, I just love templates, AAs and mixin... Ary Borenszweig
- Re: Sorry, I just love templates, AAs and m... Saaa
- Re: Sorry, I just love templates, AAs a... Chris Nicholson-Sauls
- Re: Sorry, I just love templates, AAs and mixin... grauzone
- Re: Sorry, I just love templates, AAs and m... Ellery Newcomer