function template
<iterator>

std::relational operators (istream_iterator)

(1)
template <class T, class charT, class traits, class Distance>
  bool operator== (const istream_iterator<T,charT,traits,Distance>& lhs,
                   const istream_iterator<T,charT,traits,Distance>& rhs);
(2)
template <class T, class charT, class traits, class Distance>
  bool operator!= (const istream_iterator<T,charT,traits,Distance>& lhs,
                   const istream_iterator<T,charT,traits,Distance>& rhs);
Relational operators for istream_iterator
Compares lhs to rhs:

Two end-of-stream iterators are always equal (no matter the particular stream each is associated).
Two non-end-of-stream iterators are equal when they are constructed from the same stream, or one is a copy of the other.
An end-of-stream iterator is never equal to a non-end-of-stream iterator.

These operators are overloaded in header <iterator>.

Parameters

lhs, rhs
istream_iterator objects (to the left- and right-hand side of the operator, respectively) of the same type.

Return Value

true if the condition holds, and false otherwise.

Data races

Both objects, lhs and rhs, are accessed.

Exception safety

No-throw guarantee: never throws exceptions.

See also