diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-10 07:59:51 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 7c24c5d0de4d3584d6d2f9f3c26b4d757b0a0df2 (patch) | |
tree | 81585a1be9126c4bc1be946e74b4b6e1d706279b /include/StringView.hpp | |
parent | 6b238d4bc3c142f6337a73d858e069cae778dc54 (diff) |
Fix sibs test not including parent library correctly
Refactor config parsing to reduce number of changes when introducing a
new platform to support
Diffstat (limited to 'include/StringView.hpp')
-rw-r--r-- | include/StringView.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/StringView.hpp b/include/StringView.hpp index adfa237..4d87d8a 100644 --- a/include/StringView.hpp +++ b/include/StringView.hpp @@ -7,6 +7,7 @@ #include "env.hpp" #include <cstring> #include <unordered_map> +#include <cassert> namespace sibs { @@ -47,6 +48,12 @@ namespace sibs return XXH32(data, size, 0xdec05eba); #endif } + + char operator [] (size_t index) const + { + assert(index < size); + return data[index]; + } const char *data; usize size; |