-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Nice library. Here are the issues:
-
example.cpp needs a
#include <cstdint>forstd::uint32_tsupport -
Here is the other compile errors:
[ 25%] Building CXX object example/CMakeFiles/examples.dir/main.cpp.o
cd /home/twigger/faststring/FastString/example && /usr/bin/c++ -I/home/twigger/faststring/FastString/include -O3 -O3 -DNDEBUG -std=c++20 -Wall -Wextra -pedantic -Werror -MD -MT example/CMakeFiles/examples.dir/main.cpp.o -MF CMakeFiles/examples.dir/main.cpp.o.d -o CMakeFiles/examples.dir/main.cpp.o -c /home/twigger/faststring/FastString/example/main.cpp
/home/twigger/faststring/FastString/example/main.cpp: In function ‘int main()’:
/home/twigger/faststring/FastString/example/main.cpp:39:51: error: ‘std::basic_string_view<char>{2, ((const char*)(& e.fss::basic_str<char, 7, std::char_traits<char> >::buffer_))}’ is not a constant expression
39 | constexpr auto e_sub_str = e.str().substr(0, 2); // e_sub_str is "ab"
| ^
/home/twigger/faststring/FastString/example/main.cpp:96:40: error: ‘std::basic_string_view<char>{4, ((const char*)(& t.main()::test_struct::c_.fss::basic_str<char, 7, std::char_traits<char> >::buffer_))}’ is not a constant expression
96 | constexpr const auto t_a = t.get_c();
| ^
make[2]: *** [example/CMakeFiles/examples.dir/build.make:79: example/CMakeFiles/examples.dir/main.cpp.o] Error 1
- Finally you use
std::size_tfor your size type. This needlessly makes, eg, string64 take up 8 more bytes than necessary. Why not use something likeuint8_tand have astatic_assertthat the size is suitable for the capacity. Or even better, have a template argument for the size type, egusing string64 = fss::fixed_size_str<62, std::uint8_t>;
Metadata
Metadata
Assignees
Labels
No labels