File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
include/behaviortree_cpp_v3 Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ unsigned convertFromString<unsigned>(StringView str);
84
84
template <>
85
85
long convertFromString<long >(StringView str);
86
86
87
+ template <>
88
+ unsigned long convertFromString<unsigned long >(StringView str);
89
+
90
+ template <>
91
+ float convertFromString<float >(StringView str);
92
+
87
93
template <>
88
94
double convertFromString<double >(StringView str);
89
95
Original file line number Diff line number Diff line change @@ -119,6 +119,12 @@ unsigned convertFromString<unsigned>(StringView str)
119
119
return unsigned (std::stoul (str.data ()));
120
120
}
121
121
122
+ template <>
123
+ unsigned long convertFromString<unsigned long >(StringView str)
124
+ {
125
+ return std::stoul (str.data ());
126
+ }
127
+
122
128
template <>
123
129
double convertFromString<double >(StringView str)
124
130
{
@@ -132,6 +138,16 @@ double convertFromString<double>(StringView str)
132
138
return val;
133
139
}
134
140
141
+ template <>
142
+ float convertFromString<float >(StringView str)
143
+ {
144
+ std::string old_locale = setlocale (LC_NUMERIC,nullptr );
145
+ setlocale (LC_NUMERIC," C" );
146
+ float val = std::stof (str.data ());
147
+ setlocale (LC_NUMERIC, old_locale.c_str ());
148
+ return val;
149
+ }
150
+
135
151
template <>
136
152
std::vector<int > convertFromString<std::vector<int >>(StringView str)
137
153
{
You can’t perform that action at this time.
0 commit comments