[libcxx] Fix use of operator comma where the types can be user defined
Summary: An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected. Modify all the test iterators to define operator comma. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5929 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -38,6 +38,9 @@ public:
|
||||
output_iterator& operator++() {++it_; return *this;}
|
||||
output_iterator operator++(int)
|
||||
{output_iterator tmp(*this); ++(*this); return tmp;}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &);
|
||||
};
|
||||
|
||||
template <class It>
|
||||
@@ -71,6 +74,9 @@ public:
|
||||
{return x.it_ == y.it_;}
|
||||
friend bool operator!=(const input_iterator& x, const input_iterator& y)
|
||||
{return !(x == y);}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &);
|
||||
};
|
||||
|
||||
template <class T, class U>
|
||||
@@ -120,6 +126,9 @@ public:
|
||||
{return x.it_ == y.it_;}
|
||||
friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
|
||||
{return !(x == y);}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &);
|
||||
};
|
||||
|
||||
template <class T, class U>
|
||||
@@ -168,6 +177,9 @@ public:
|
||||
bidirectional_iterator& operator--() {--it_; return *this;}
|
||||
bidirectional_iterator operator--(int)
|
||||
{bidirectional_iterator tmp(*this); --(*this); return tmp;}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &);
|
||||
};
|
||||
|
||||
template <class T, class U>
|
||||
@@ -227,6 +239,9 @@ public:
|
||||
{random_access_iterator tmp(*this); tmp -= n; return tmp;}
|
||||
|
||||
reference operator[](difference_type n) const {return it_[n];}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &);
|
||||
};
|
||||
|
||||
template <class T, class U>
|
||||
|
Reference in New Issue
Block a user