diff --git a/sycl/include/sycl/detail/string.hpp b/sycl/include/sycl/detail/string.hpp index 9844e2cb25c81..4c9bf72e025ec 100644 --- a/sycl/include/sycl/detail/string.hpp +++ b/sycl/include/sycl/detail/string.hpp @@ -25,7 +25,7 @@ class string { string() noexcept = default; ~string() { delete[] str; } - string(const std::string_view &strn) { + string(const std::string_view strn) { size_t len = strn.length(); str = new char[len + 1]; strn.copy(str, len); @@ -52,7 +52,7 @@ class string { return *this; } - string &operator=(const std::string_view &strn) { + string &operator=(const std::string_view strn) { *this = string{strn}; return *this; } @@ -60,10 +60,10 @@ class string { const char *c_str() const noexcept { return str; } friend bool operator==(const string &lhs, - const std::string_view &rhs) noexcept { + const std::string_view rhs) noexcept { return rhs == lhs.c_str(); } - friend bool operator==(const std::string_view &lhs, + friend bool operator==(const std::string_view lhs, const string &rhs) noexcept { return lhs == rhs.c_str(); }