George2
February 20th, 2003, 09:34 PM
Hi, everyone!
Such are the source codes of STL,
--------
template<class RandomAccessIterator, class T>
RandomAccessIterator binary_search (RandomAccessIterator first,
RandomAccessIterator last,
const T& value,
random_access_iterator_tag) {
// more efficient, but less generic algorithm
}
--------
I found there is a type "random_access_iterator_tag" in the definition
of the function. But there is not related parameter names. I think the
reason is the that fourth parameter is not used in the function, hidden the
parameter name can avoid warning in some compilers.
Am I correct?
Thanks in advance,
Geroge
Such are the source codes of STL,
--------
template<class RandomAccessIterator, class T>
RandomAccessIterator binary_search (RandomAccessIterator first,
RandomAccessIterator last,
const T& value,
random_access_iterator_tag) {
// more efficient, but less generic algorithm
}
--------
I found there is a type "random_access_iterator_tag" in the definition
of the function. But there is not related parameter names. I think the
reason is the that fourth parameter is not used in the function, hidden the
parameter name can avoid warning in some compilers.
Am I correct?
Thanks in advance,
Geroge