We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92c873e commit 68a21c5Copy full SHA for 68a21c5
1 file changed
include/xtensor/io/xcsv.hpp
@@ -66,7 +66,7 @@ namespace xt
66
}
67
68
size_t last = cell.find_last_not_of(' ');
69
- return cell.substr(first, last == std::string::npos ? cell.size() : last + 1);
+ return cell.substr(first, last == std::string::npos ? cell.size() : last - first + 1);
70
71
72
template <>
@@ -93,6 +93,18 @@ namespace xt
93
return std::stoi(cell);
94
95
96
+ template <>
97
+ inline signed char lexical_cast<signed char>(const std::string& cell)
98
+ {
99
+ return static_cast<signed char>(std::stoi(cell));
100
+ }
101
+
102
103
+ inline unsigned char lexical_cast<unsigned char>(const std::string& cell)
104
105
+ return static_cast<unsigned char>(std::stoul(cell));
106
107
108
109
inline long lexical_cast<long>(const std::string& cell)
110
{
0 commit comments