[Webkit-unassigned] [Bug 36849] Add zero() method to Vector class
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 31 23:48:26 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=36849
--- Comment #17 from Maciej Stachowiak <mjs at apple.com> 2010-03-31 23:48:25 PST ---
(In reply to comment #14)
> (In reply to comment #13)
> > > Sam, thanks that looks pretty good. Which file do you think this code belongs
> > > in?
> >
> > I think StdLibExtras.h would be good.
>
> Sounds good - if nobody objects I'd like to take Sam's suggestion and just to
> round things out also add the following function:
>
> template<typename T>
> void zeroFill(Vector<T> v)
> {
> zeroFill(v.begin(). v.end());
> }
Not sure that small bit of abstraction is much of a win. It also depends on the
fact that the Vector iterator is a raw pointer, which isn't guaranteed.
v.data() and v.data() + v.size() would be more robust ways to get the endpoints
as pointers.
--
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