Skip to content

Commit

Permalink
remove refs
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 537491d commit 8fc92b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions sycl/include/sycl/detail/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,17 @@ class string {
return *this;
}

string &operator=(const std::string_view strn) {
string &operator=(std::string_view strn) {
*this = string{strn};
return *this;
}

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

friend bool operator==(const string &lhs,
const std::string_view rhs) noexcept {
friend bool operator==(const string &lhs, std::string_view rhs) noexcept {
return rhs == lhs.c_str();
}
friend bool operator==(const std::string_view lhs,
const string &rhs) noexcept {
friend bool operator==(std::string_view lhs, const string &rhs) noexcept {
return lhs == rhs.c_str();
}
};
Expand Down
8 changes: 4 additions & 4 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(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 @@ -45,18 +45,18 @@ class string_view {
return *this;
}

string_view &operator=(const std::string_view strn) noexcept {
string_view &operator=(std::string_view strn) noexcept {
str = strn.data();
return *this;
}

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

friend bool operator==(const string_view &lhs,
const std::string_view rhs) noexcept {
std::string_view rhs) noexcept {
return rhs == lhs.data();
}
friend bool operator==(const std::string_view lhs,
friend bool operator==(std::string_view lhs,
const string_view &rhs) noexcept {
return lhs == rhs.data();
}
Expand Down

0 comments on commit 8fc92b8

Please sign in to comment.