Skip to content

Commit

Permalink
add literal ==
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNumbat committed Mar 20, 2024
1 parent ee03159 commit 9d0cd98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rpp/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,15 @@ struct Literal {
}
}

constexpr bool operator==(const Literal& other) const noexcept {
for(u64 i = 0; i < max_len; i++) {
if(c_string[i] != other.c_string[i]) {
return false;
}
}
return true;
}

[[nodiscard]] constexpr operator const char*() const noexcept {
return c_string;
}
Expand Down

0 comments on commit 9d0cd98

Please sign in to comment.