std::find requiring operator!=
From: Old Wolf (oldwolf_at_inspire.net.nz)
Date: 10/31/04
- Next message: Rahul Jain: "Re: C++ sucks for games"
- Previous message: Karthik Kumar: "Re: how to save to a text file"
- Next in thread: Rob Williscroft: "Re: std::find requiring operator!="
- Reply: Rob Williscroft: "Re: std::find requiring operator!="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Rahul Jain: "Re: C++ sucks for games"
- Previous message: Karthik Kumar: "Re: how to save to a text file"
- Next in thread: Rob Williscroft: "Re: std::find requiring operator!="
- Reply: Rob Williscroft: "Re: std::find requiring operator!="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|