static_string icon indicating copy to clipboard operation
static_string copied to clipboard

A tool for representing and concatenating strings without heap memory

Results 6 static_string issues
Sort by recently updated
recently updated
newest added

In the motivating blog post, you present both a C++14 and a C++11 version of some of the code (e.g. construction of an array string from two string literals) -...

enhancement

https://godbolt.org/z/88MK6z ```c++ #define AK_TOOLKIT_CONFIG_USING_STRING_VIEW 4 //#define AK_TOOLKIT_CONFIG_USING_STRING #include namespace sstring = ak_toolkit::static_str; int Foo() { constexpr auto foo = sstring::literal("foo"); std::string str1 = foo; std::string str2; str2 = foo; //

I have this errors: ``` : cannot convert from 'initializer list' to ak_toolkit::static_str::string constexpr function ak_toolkit::static_str::operator + cannot result in a constant expression template parameter TR cannot be used because...

Thanks for thinking about this problem so carefully. It seems crazy that it’s so hard to make some truly compile time constant strings without heap/malloc. I have a use case...

See here: https://github.com/akrzemi1/static_string/blob/cf952d9852083eb608e20bd4ae525fc2822c4304/include/ak_toolkit/static_string.hpp#L132

This adds a public converting constructor that accepts a const char*, and modifies the existing private converting constructor to simply accept any parameter type (as long as it supports constexpr...