utils: add operator== (const std::unique_ptr<T>&, T*)

This commit is contained in:
Maxime Coste 2011-09-08 00:08:55 +00:00
parent 03f1520b43
commit 511df5b660

View File

@ -1,6 +1,8 @@
#ifndef utils_hh_INCLUDED #ifndef utils_hh_INCLUDED
#define utils_hh_INCLUDED #define utils_hh_INCLUDED
#include <memory>
namespace Kakoune namespace Kakoune
{ {
@ -29,6 +31,11 @@ ReversedContainer<Container> reversed(Container& container)
return ReversedContainer<Container>(container); return ReversedContainer<Container>(container);
} }
template<typename T>
bool operator== (const std::unique_ptr<T>& lhs, T* rhs)
{
return lhs.get() == rhs;
}
} }