[Webkit-unassigned] [Bug 32828] WTF should have an arraysize macro

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 24 08:26:49 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=32828





--- Comment #22 from Patrick R. Gansterer <paroga at paroga.com>  2010-10-24 08:26:48 PST ---
(In reply to comment #21)
> Does the struct consume any space when compiled? Or is it acting like a class here and declaring a scoped enum within itself?  
It only declares the value for the enum, so it shoudn't consume any space, but I'm not 100% sure.

> I tend to prefer type-safe code over macros as long as there aren't any bad side-effects to using it.  :)
Because the macro uses a template function it's typesafe too. It throws a compiler error when used with wrong type (e.g. char*).
IMHO ARRAY_LEGTH(tokens) is easier to read compared to array_info<tokens>::size.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list