summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-09-08 00:08:55 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-09-08 00:08:55 +0000
commit511df5b6605b6dd6d350dac4643cd1255771d869 (patch)
tree68022243f5f08b2701e583b0874aab34246802c2 /src
parent03f1520b4312c879225df2113845396a8001c8c3 (diff)
utils: add operator== (const std::unique_ptr<T>&, T*)
Diffstat (limited to 'src')
-rw-r--r--src/utils.hh7
1 files changed, 7 insertions, 0 deletions
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 <memory>
+
namespace Kakoune
{
@@ -29,6 +31,11 @@ ReversedContainer<Container> reversed(Container& container)
return ReversedContainer<Container>(container);
}
+template<typename T>
+bool operator== (const std::unique_ptr<T>& lhs, T* rhs)
+{
+ return lhs.get() == rhs;
+}
}