You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: in order to write functions that take strings as template arguments, as in function<"string">(), one needs to declare the template parameter a static string, because neither char const* nor std::string_view work.
To avoid needless reinvention of static strings, ours should (probably) be useful in this role. But it isn't, for at least the reason above.
The text was updated successfully, but these errors were encountered:
@pdimov This is because of a shortsighted design choice I made to optimize zero size strings, accomplished via a virtual base class. Removing this and making the non-static data members public would allow for it to be used as a NTTP.
constexpr boost::static_strings::basic_static_string s( "name" );
fails to compile (under C++20): https://godbolt.org/z/fvPs3rxa7Background: in order to write functions that take strings as template arguments, as in
function<"string">()
, one needs to declare the template parameter a static string, because neitherchar const*
norstd::string_view
work.To avoid needless reinvention of static strings, ours should (probably) be useful in this role. But it isn't, for at least the reason above.
The text was updated successfully, but these errors were encountered: