summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-06-25 19:41:53 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-06-25 19:45:42 +0100
commitb579f90baedaf6ff5030e5ff9e6eaf6ea2017f1c (patch)
tree15bd217be30a8a4f8360cc256287e1367e3d01db /src
parent3977b7f9a6bffe2b6959693c4a1f037bc27c5660 (diff)
Make sure we do not put a Value in a Value
Diffstat (limited to 'src')
-rw-r--r--src/value.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/value.hh b/src/value.hh
index 1a287b0b..3c6eb7fb 100644
--- a/src/value.hh
+++ b/src/value.hh
@@ -4,6 +4,7 @@
#include "unordered_map.hh"
#include "units.hh"
+#include <type_traits>
#include <memory>
namespace Kakoune
@@ -15,7 +16,8 @@ struct Value
{
Value() = default;
- template<typename T>
+ template<typename T,
+ typename = typename std::enable_if<not std::is_same<Value, T>::value>::type>
Value(T&& val) : m_value{new Model<T>{std::forward<T>(val)}} {}
Value(const Value& val) = delete;