[Webkit-unassigned] [Bug 38630] VS2010 asserts a null iterator passed to std::copy in Vector::operator=

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 9 02:58:22 PDT 2010


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





--- Comment #6 from Kent Tamura <tkent at chromium.org>  2010-05-09 02:58:21 PST ---
(In reply to comment #5)
> I do not see any restrictions on input or output iterators in copy() algorithm
> description in C++ standard. Do you have a reference for this requirement?

I checked the C++0x draft, and I think i was wrong.  0 can be a valid iterator in general.

The standard says neither "The OutputIterator parameter must be dereferenceable" nor "It may be not dereferenceable if [first, last) is empty."  So we can't assume the VS2010 behavior is a bug.

> > This is an optimization for all compilers and solve the VS2010 issue.
> 
> That also sounds like an extra branch in common case. Or did I misunderstand your proposal?

Yes, it will make an extra branch.  But it will skip the following 3-lines of the code in a case of empty vectors.
I have no strong preference on it.  I think either of it or "#if COMPILER(MSVC)" are ok.

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