Always optimize StringView::strlen (recursive due to constexpr)

This commit is contained in:
Maxime Coste 2015-04-07 23:21:14 +01:00
parent fbcc979117
commit b5ab318a2d

View File

@ -164,6 +164,7 @@ public:
ZeroTerminatedString zstr() const { return {begin(), end()}; } ZeroTerminatedString zstr() const { return {begin(), end()}; }
private: private:
[[gnu::optimize(3)]] // this is recursive for constexpr reason
static constexpr ByteCount strlen(const char* s) static constexpr ByteCount strlen(const char* s)
{ {
return *s == 0 ? 0 : strlen(s+1) + 1; return *s == 0 ? 0 : strlen(s+1) + 1;