mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 17:18:11 -04:00
Merge pull request #212 from TsudaKageyu/list
Interface change of List::find() and contains()
This commit is contained in:
commit
409bba5936
@ -204,17 +204,20 @@ namespace TagLib {
|
||||
/*!
|
||||
* Find the first occurrence of \a value.
|
||||
*/
|
||||
Iterator find(const T &value);
|
||||
template <class U>
|
||||
Iterator find(const U &value);
|
||||
|
||||
/*!
|
||||
* Find the first occurrence of \a value.
|
||||
*/
|
||||
ConstIterator find(const T &value) const;
|
||||
template <class U>
|
||||
ConstIterator find(const U &value) const;
|
||||
|
||||
/*!
|
||||
* Returns true if the list contains \a value.
|
||||
*/
|
||||
bool contains(const T &value) const;
|
||||
template <class U>
|
||||
bool contains(const U &value) const;
|
||||
|
||||
/*!
|
||||
* Erase the item at \a it from the list.
|
||||
|
@ -281,19 +281,22 @@ bool List<T>::isEmpty() const
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename List<T>::Iterator List<T>::find(const T &value)
|
||||
template <class U>
|
||||
typename List<T>::Iterator List<T>::find(const U &value)
|
||||
{
|
||||
return std::find(d->list.begin(), d->list.end(), value);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename List<T>::ConstIterator List<T>::find(const T &value) const
|
||||
template <class U>
|
||||
typename List<T>::ConstIterator List<T>::find(const U &value) const
|
||||
{
|
||||
return std::find(d->list.begin(), d->list.end(), value);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool List<T>::contains(const T &value) const
|
||||
template <class U>
|
||||
bool List<T>::contains(const U &value) const
|
||||
{
|
||||
return std::find(d->list.begin(), d->list.end(), value) != d->list.end();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user