Add more equals operators for ConstexprString
This commit is contained in:
parent
79893554d3
commit
0a2694314f
1 changed files with 10 additions and 0 deletions
|
@ -51,6 +51,16 @@ struct ConstexprString {
|
||||||
inline constexpr bool operator==(std::string_view other) const {
|
inline constexpr bool operator==(std::string_view other) const {
|
||||||
return static_cast<std::string_view>(*this) == other;
|
return static_cast<std::string_view>(*this) == other;
|
||||||
};
|
};
|
||||||
|
inline constexpr bool operator==(const ConstexprString<Size>& other) const {
|
||||||
|
return static_cast<std::string_view>(*this) == static_cast<std::string_view>(other);
|
||||||
|
};
|
||||||
|
template <std::size_t SSize>
|
||||||
|
inline constexpr bool operator==(const ConstexprString<SSize>& other) const {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
inline constexpr bool operator==(const std::string& other) const {
|
||||||
|
return static_cast<std::string_view>(*this) == other;
|
||||||
|
};
|
||||||
template <std::size_t SSize>
|
template <std::size_t SSize>
|
||||||
inline constexpr auto operator+(const ConstexprString<SSize>& other) -> ConstexprString<Size + SSize - 1> {
|
inline constexpr auto operator+(const ConstexprString<SSize>& other) -> ConstexprString<Size + SSize - 1> {
|
||||||
ConstexprString<Size + SSize - 1> response;
|
ConstexprString<Size + SSize - 1> response;
|
||||||
|
|
Loading…
Reference in a new issue