[Webkit-unassigned] [Bug 36849] Add zero() method to Vector class

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 31 11:45:06 PDT 2010


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





--- Comment #6 from Chris Rogers <crogers at google.com>  2010-03-31 11:45:05 PST ---
Actually, it doesn't silently do nothing.  I made the method private so it
won't even compile in the cases where it doesn't make sense and could be
dangerous.  For many non-POD type objects, simply initializing to zero would
not be a good thing.  For example, OwnPtr would leak.  I suppose it's possible
to specialize the fill() method for 0.0 with float and double (and long double,
short, long long, int, etc.), but it seems more concise and precise to be able
to call object.zero() rather than object.fill(0.0).

-- 
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