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)
signature.asc
Description: Digital signature
_______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

