Re: using enum classes for enumerated CSS property values in nsStyleConsts.h

Xidorn Quan <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout
Message-ID <CAMdq69-vO2TdPy5Bt8887WGx8bSxp+i--R5cTF4cKmrhY8YvWA@mail.gmail.com>
On Wed, Nov 11, 2015 at 5:59 PM, Cameron McCormack <[email protected]> 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
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.