From 9d71185a55558c80c85a65e13427dd491a2f4451 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 18 Dec 2022 12:59:32 +0200 Subject: [PATCH] Disable the templated constructor of Value if the source type is Value Microsoft's std::vector uses a T & (without const) for copying, which resolves to the templated constructor instead of the copy constructor unless the former is disabled for that signature. --- source/value.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/value.h b/source/value.h index bcddd6e..ba61181 100644 --- a/source/value.h +++ b/source/value.h @@ -2,6 +2,7 @@ #define MSP_DATAFILE_VALUE_H_ #include +#include #include #include #include @@ -18,7 +19,7 @@ private: public: template - Value(T &&d): + Value(T &&d, typename std::enable_if::type, Value>::value, int>::type = 0): sig(TypeInfo::signature), data(static_cast::Store>(std::forward(d))) { } -- 2.43.0