diff --git a/distrho/extra/String.hpp b/distrho/extra/String.hpp index 0255bcd1..f302bfaf 100644 --- a/distrho/extra/String.hpp +++ b/distrho/extra/String.hpp @@ -22,6 +22,10 @@ #include +#if __cplusplus >= 201703L +# include +#endif + START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- @@ -87,6 +91,16 @@ class String _dup(strBuf); } + #if __cplusplus >= 201703L + /* + * std::string_view, not requiring a null terminator + */ + explicit String(const std::string_view& strView) noexcept + : fBuffer(const_cast(strView.data())), + fBufferLen(strView.size()), + fBufferAlloc(false) {} + #endif + /* * Integer. */