Improved some stuff

This commit is contained in:
WolverinDEV 2020-01-26 16:15:36 +01:00
parent 3d3ddd274e
commit 00e8aca68e
2 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@ bool command_parser::parse(bool command) {
if(findex == std::string::npos)
findex = this->_command.size();
auto& bulk = this->_bulks.emplace_back(this->_bulks.size() - 1, this->data.substr(index, findex - index));
this->_bulks.emplace_back(this->_bulks.size() - 1, this->data.substr(index, findex - index));
index = findex + 1;
}
return true;

View File

@ -198,6 +198,10 @@ namespace ts {
this->impl_put_unchecked(this->bulks[index], index, key, value);
}
inline void put_unchecked(size_t index, const std::string_view& key, const std::string& value) {
this->put_unchecked(index, key, std::string_view{value});
}
template <typename T, std::enable_if_t<!(std::is_same<T, std::string_view>::value || std::is_same<T, std::string>::value), int> = 1>
inline void put_unchecked(size_t index, const std::string_view& key, const T& value) {
static_assert(converter<T>::supported, "Target type isn't supported!");