std::find requiring operator!=

From: Old Wolf (oldwolf_at_inspire.net.nz)
Date: 10/31/04


Date: 30 Oct 2004 20:14:20 -0700

In the documentation for std::find, it says:

    find returns the first iterator i in the range [first, last)
    for which the following condition holds:
        *i == value.

However in my compiler's headers the implementation is:

  template <class InputIterator, class T>
  InputIterator find (InputIterator first, InputIterator last, const T& value)
  {
    while (first != last && *first != value)
      ++first;
    return first;
  }

So operator!= is required and operator== isn't. Is this conforming?



Relevant Pages