You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/xrGame/ini_table_loader.h
+15-20Lines changed: 15 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -43,24 +43,18 @@ class CIni_Table
43
43
int table_width;
44
44
45
45
//перобразование из LPCSTR в T_ITEM
46
-
47
-
template <typename T_CONVERT_ITEM>
48
-
T_ITEM convert(LPCSTR)
49
-
{
50
-
static_assert(!std::is_same_v<T_CONVERT_ITEM, T_CONVERT_ITEM>, "Specialization for convert in CIni_Table not found."); // Xottab_DUTY: Is this correct?
51
-
NODEFAULT;
52
-
}
53
-
54
-
template <>
55
-
T_ITEM convert<int>(LPCSTR str)
46
+
T_ITEM convert(LPCSTR str)
56
47
{
57
-
returnatoi(str);
58
-
}
59
-
60
-
template <>
61
-
T_ITEM convert<float>(LPCSTR str)
62
-
{
63
-
return (float)atof(str);
48
+
ifconstexpr(std::is_same<T_ITEM, int>::value)
49
+
{
50
+
returnatoi(str);
51
+
}
52
+
else
53
+
{
54
+
static_assert(std::is_same_v<T_ITEM, float>,
55
+
"Specialization for convert in CIni_Table not found.");
0 commit comments