From 2d7bbe6c4b7bc1f88ed130347a2ce9fadb87c0a2 Mon Sep 17 00:00:00 2001 From: Shin-ichi MORITA Date: Sat, 10 Jun 2023 11:44:42 +0900 Subject: [PATCH] Fixing build errors on Windows. --- include/xemmai/type.h | 4 ++-- include/xemmai/value.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/xemmai/type.h b/include/xemmai/type.h index 39182671..ab68e593 100644 --- a/include/xemmai/type.h +++ b/include/xemmai/type.h @@ -324,8 +324,8 @@ void f_throw_type_error [[noreturn]] (const wchar_t* a_name) f_throw_type_error(typeid(typename t_fundamental::t_type), a_name); } -template -inline void f_check(const t_value& a_object, const wchar_t* a_name) +template +inline void f_check(const t_value& a_object, const wchar_t* a_name) { if (!f_is(a_object)) [[unlikely]] f_throw_type_error(a_name); } diff --git a/include/xemmai/value.h b/include/xemmai/value.h index 160df7be..0fa0e765 100644 --- a/include/xemmai/value.h +++ b/include/xemmai/value.h @@ -249,7 +249,7 @@ class t_value : public T_tag double v_float; }; - void f_copy(const t_value& a_value) + void f_copy(const auto& a_value) { if (sizeof(double) > sizeof(intptr_t)) v_float = a_value.v_float; @@ -273,7 +273,8 @@ class t_value : public T_tag { f_copy(a_value); } - t_value(const t_value& a_value) : T_tag(a_value) + template + t_value(const t_value& a_value) : T_tag(a_value) { f_copy(a_value); } @@ -284,7 +285,8 @@ class t_value : public T_tag f_copy(a_value); return *this; } - t_value& operator=(const t_value& a_value) + template + t_value& operator=(const t_value& a_value) { static_cast(*this) = a_value; f_copy(a_value);