From cc994b0843bcc351f4a8a05470983a75581ff7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Mon, 13 Nov 2023 14:27:49 +0100 Subject: [PATCH] Fix warning on VS2017 (#176) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #19760. Fix warning on VS2017 Signed-off-by: Ricardo González * Refs #19760. Fix gcc Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Signed-off-by: Ricardo González Moreno --- include/fastcdr/Cdr.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/fastcdr/Cdr.h b/include/fastcdr/Cdr.h index 53029edb..5748cd48 100644 --- a/include/fastcdr/Cdr.h +++ b/include/fastcdr/Cdr.h @@ -2760,7 +2760,13 @@ class Cdr if (!value) { - value = external<_T>{new _T()}; + value = external<_T>{new +#if !defined(_MSC_VER) || _MSC_VER >= 1920 + _T() +#else + external<_T>::type() +#endif // if _MSC_VER >= 1920 + }; } deserialize(*value);