Skip to content

Commit

Permalink
more feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Byoungro So <byoungro.so@intel.com>
  • Loading branch information
bso-intel committed Feb 6, 2024
1 parent 8a9aaaf commit 2adf0fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sycl/include/sycl/detail/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class string {
string() noexcept = default;
~string() { delete[] str; }

string(const std::string_view strn) {
string(std::string_view strn) {
size_t len = strn.length();
str = new char[len + 1];
strn.copy(str, len);
Expand All @@ -48,7 +48,7 @@ class string {
return *this;
}
string &operator=(const string &other) {
*this = string{other.str};
*this = string{other};
return *this;
}

Expand Down
3 changes: 1 addition & 2 deletions sycl/include/sycl/detail/string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class string_view {
public:
string_view() noexcept = default;
string_view(const string_view &strn) noexcept = default;
string_view(const std::string_view &strn) noexcept : str(strn.data()) {}
string_view(const std::string_view strn) noexcept : str(strn.data()) {}
string_view(string_view &&strn) noexcept : str(strn.data()) {}

string_view &operator=(string_view &&strn) noexcept {
Expand All @@ -50,7 +50,6 @@ class string_view {
return *this;
}

const char *data() noexcept { return str; }
const char *data() const noexcept { return str; }

friend bool operator==(const string_view &lhs,
Expand Down

0 comments on commit 2adf0fb

Please sign in to comment.