diff --git a/example/main.cpp b/example/main.cpp index ba068a0..62c941f 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include int main() { @@ -97,4 +98,4 @@ int main() /* swap */ l.swap(k); // l is "xyz" and k is "34" swap(l, k); // l is "34" and k is "xyz" -} \ No newline at end of file +} diff --git a/include/FastString.h b/include/FastString.h index 6ae7c39..2812904 100644 --- a/include/FastString.h +++ b/include/FastString.h @@ -4,12 +4,16 @@ #include #include #include +#include namespace fss { - template > + template > class basic_str { + + static_assert(SizeType(-1) >= max_length); + public: constexpr basic_str() noexcept = default; @@ -124,7 +128,7 @@ namespace fss buffer_[active_length_] = '\0'; } - std::size_t active_length_{0}; + SizeType active_length_{0}; CharT buffer_[max_length + 1]{}; };