On Wed, Nov 11, 2015 at 5:59 PM, Cameron McCormack <c...@mcc.id.au> wrote: > L. David Baron: >> I'm in favor of making it a struct -- but if it becomes a template, >> won't the functions that accept it have to become templates, >> generating multiple copies of the code where we currently have only >> a single copy? > > You’d hope that the compiler would fold together all the versions of the > template that took the same sized enum. (You could always have a small > inline function that casts to uint8_t and have a common implementation > that works on the untyped values.)
I hope compilers do that for us, but I have no idea whether it is that case. Having a small inline template function for each of those functions sounds painful to me. If there are not too many such functions, it could probably be fine, though. - Xidorn _______________________________________________ dev-tech-layout mailing list dev-tech-layout@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-layout