Skip to content

Commit

Permalink
Fixing build errors on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
shin1m committed Jun 10, 2023
1 parent 7ae6e24 commit 2d7bbe6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/xemmai/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ void f_throw_type_error [[noreturn]] (const wchar_t* a_name)
f_throw_type_error(typeid(typename t_fundamental<T>::t_type), a_name);
}

template<typename T>
inline void f_check(const t_value<auto>& a_object, const wchar_t* a_name)
template<typename T, typename T_tag>
inline void f_check(const t_value<T_tag>& a_object, const wchar_t* a_name)
{
if (!f_is<T>(a_object)) [[unlikely]] f_throw_type_error<T>(a_name);
}
Expand Down
8 changes: 5 additions & 3 deletions include/xemmai/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class t_value : public T_tag
double v_float;
};

void f_copy(const t_value<auto>& a_value)
void f_copy(const auto& a_value)
{
if (sizeof(double) > sizeof(intptr_t))
v_float = a_value.v_float;
Expand All @@ -273,7 +273,8 @@ class t_value : public T_tag
{
f_copy(a_value);
}
t_value(const t_value<auto>& a_value) : T_tag(a_value)
template<typename T>
t_value(const t_value<T>& a_value) : T_tag(a_value)
{
f_copy(a_value);
}
Expand All @@ -284,7 +285,8 @@ class t_value : public T_tag
f_copy(a_value);
return *this;
}
t_value& operator=(const t_value<auto>& a_value)
template<typename T>
t_value& operator=(const t_value<T>& a_value)
{
static_cast<T_tag&>(*this) = a_value;
f_copy(a_value);
Expand Down

0 comments on commit 2d7bbe6

Please sign in to comment.