Changeset 59463 in webkit for trunk/JavaScriptCore/wtf/Vector.h


Ignore:
Timestamp:
May 14, 2010, 4:24:05 AM (15 years ago)
Author:
[email protected]
Message:

Fix a VS2010 assert in std::copy
https://bugs.webkit.org/show_bug.cgi?id=38630

Reviewed by Alexey Proskuryakov.

The assert complains that the output iterator is null.

  • wtf/Vector.h:

(WTF::::operator):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Vector.h

    r58307 r59463  
    687687        }
    688688       
     689// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
     690#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
     691        if (!begin())
     692            return *this;
     693#endif
     694
    689695        std::copy(other.begin(), other.begin() + size(), begin());
    690696        TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
     
    710716        }
    711717       
     718// Works around an assert in VS2010. See https://connect.microsoft.com/VisualStudio/feedback/details/558044/std-copy-should-not-check-dest-when-first-last
     719#if COMPILER(MSVC) && defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL
     720        if (!begin())
     721            return *this;
     722#endif
     723
    712724        std::copy(other.begin(), other.begin() + size(), begin());
    713725        TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
Note: See TracChangeset for help on using the changeset viewer.