From 511df5b6605b6dd6d350dac4643cd1255771d869 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 Sep 2011 00:08:55 +0000 Subject: [PATCH] utils: add operator== (const std::unique_ptr&, T*) --- src/utils.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils.hh b/src/utils.hh index 88d95e11..50297f8d 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -1,6 +1,8 @@ #ifndef utils_hh_INCLUDED #define utils_hh_INCLUDED +#include + namespace Kakoune { @@ -29,6 +31,11 @@ ReversedContainer reversed(Container& container) return ReversedContainer(container); } +template +bool operator== (const std::unique_ptr& lhs, T* rhs) +{ + return lhs.get() == rhs; +} }