Changeset 164190 in webkit


Ignore:
Timestamp:
Feb 16, 2014, 1:11:44 AM (12 years ago)
Author:
zandobersek@gmail.com
Message:

Reintroduce const qualifiers for return types of (Filter|Transform)Iterator::operator*()
https://bugs.webkit.org/show_bug.cgi?id=126875

The const qualifiers for the return types of FilterIterator::operator*() and TransformIterator::operator*()
were removed in r161797 and r161802 because of compilation failures when using GCC and having an Iterator
type that already had the const qualifier. std::remove_const is now used to appease GCC and enforce the const
qualifier on the return type, regardless of the Iterator type and its qualifiers.

  • wtf/IteratorAdaptors.h:

(WTF::FilterIterator::operator*):
(WTF::TransformIterator::operator*):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r164185 r164190  
     12014-02-16  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Reintroduce const qualifiers for return types of (Filter|Transform)Iterator::operator*()
     4        https://bugs.webkit.org/show_bug.cgi?id=126875
     5
     6        The const qualifiers for the return types of FilterIterator::operator*() and TransformIterator::operator*()
     7        were removed in r161797 and r161802 because of compilation failures when using GCC and having an Iterator
     8        type that already had the const qualifier. std::remove_const is now used to appease GCC and enforce the const
     9        qualifier on the return type, regardless of the Iterator type and its qualifiers.
     10
     11        * wtf/IteratorAdaptors.h:
     12        (WTF::FilterIterator::operator*):
     13        (WTF::TransformIterator::operator*):
     14
    1152014-02-15  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/WTF/wtf/IteratorAdaptors.h

    r161802 r164190  
    2727#define WTF_IteratorAdaptors_h
    2828
     29#include <type_traits>
     30
    2931namespace WTF {
    3032
     
    5153    }
    5254
    53     decltype(*std::declval<Iterator>()) operator*() const
     55    const typename std::remove_const<decltype(*std::declval<Iterator>())>::type operator*() const
    5456    {
    5557        ASSERT(m_iter != m_end);
     
    8890    }
    8991
    90     decltype(std::declval<Transform>()(*std::declval<Iterator>())) operator*() const
     92    const typename std::remove_const<decltype(std::declval<Transform>()(*std::declval<Iterator>()))>::type operator*() const
    9193    {
    9294        return m_transform(*m_iter);
Note: See TracChangeset for help on using the changeset viewer.