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

"L. David Baron" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout
Message-ID <[email protected]>
On Wednesday 2015-11-11 17:53 +1100, Xidorn Quan wrote:
> On Wed, Nov 11, 2015 at 5:40 PM, L. David Baron <[email protected]> wrote:
> > On Wednesday 2015-11-11 17:29 +1100, Xidorn Quan wrote:
> >> On Wed, Nov 11, 2015 at 5:07 PM, L. David Baron <[email protected]> wrote:
> >> > 2. Casts
> >> > ========
> >> >
> >> > Does anybody see a good way to eliminate the casts I needed to use
> >> > in the main patch (described in the patch header)?
> >>
> >> We can probably make them templates?
> >
> > How?
> 
> Ahh, I forgot that KTableValue is a single value which accepts both
> keywords and computed constants.
> 
> We may want to replace KTableValue[2] with a struct template like
> 
> template<typename T>
> struct KTableItem
> {
>   nsCSSKeyword keyword;
>   T value;
> };
> 
> and convert all functions which accept KTables to templates.

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?

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWQuamAAoJEO/hYSUPhPwht8AP/itvlZYkkcPi+UnvAowbBoBX
jlFxL2H+MWtvkT5tgk7ZRbLFENimk+CE3avRpImQxW7GXkqKMWSQX63LvY4MJJjJ
C1Miok08g95q4Ic4TLZOEXDNGHtFl2GELDiLph1FPLONYEQYY1WIOMWjOjjO+B7r
HqIeUyzZBkT3suvYMXVsAIe+nKJDZHHwJiwy/Ij3K3ODUb907p5byQw7v1b2wnr6
kAoi8tyXvHPjY7bdEKv4kSGnnl+x7mCjOtexU8mE9G7UvPAmJ4KMVgEZYzNEcCUG
oQ1b3c6vkxoBZVY9Cs1tGTV3y+lXDJUsdpVAq5y8aKYWcubLmwq+8a3hzQw2DhnU
J3mfXVckvP8eUELzf6r3wmUii6KSfke1wkHwH3LWMCyhZdS3k2JXSS/IeaafO6r7
4kJHZlzLNocMqz4eLu7/qBrTnQjNtztNUNOLNEDaoQlFpZHJYHep9wtb+n+48laB
w3vcrpOYJ1bD+FV1a/qNtTUxmpJFvnAFaK444hQpfFZO4fTRcEB4rUOazE00Wozb
upjKsF3cFdSfFUqiGwilvj8OTKN7pQ5lK1/jB9LS+5PCTcybrQyhUf67RQ31a+O/
xeRuCT8ivT2t9ZfuWotn/CrwDwc+W8D7jcKFtKE71PbA701DJ1RXbBhzOU/+y9U3
2Wxv63xQJxgsj1KmrRBV
=DPCd
-----END PGP SIGNATURE-----
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.