18#ifndef TRINITYCORE_LIST_UTILS_H
19#define TRINITYCORE_LIST_UTILS_H
21#include <forward_list>
26template<
typename T,
typename Alloc = std::allocator<T>>
27inline typename std::list<T, Alloc>::iterator
RemoveUnique(std::list<T, Alloc>& list, T
const& value)
29 auto itr = std::find(list.begin(), list.end(), value);
30 if (itr != list.end())
31 return list.erase(itr);
36template<
typename T,
typename Alloc = std::allocator<T>>
37inline typename std::forward_list<T, Alloc>::iterator
RemoveUnique(std::forward_list<T, Alloc>& list, T
const& value)
39 auto itr = list.before_begin();
40 auto toErase = std::next(itr);
41 while (toErase != list.end())
43 if (*toErase == value)
44 return list.erase_after(itr);
std::list< T, Alloc >::iterator RemoveUnique(std::list< T, Alloc > &list, T const &value)