From 0a2694314f8e45c479229aac00ca8996e2cc1ef3 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Wed, 10 Apr 2024 15:13:03 +0000 Subject: [PATCH] Add more equals operators for ConstexprString --- include/utempl/constexpr_string.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/utempl/constexpr_string.hpp b/include/utempl/constexpr_string.hpp index caf0bb8..cfb88d0 100644 --- a/include/utempl/constexpr_string.hpp +++ b/include/utempl/constexpr_string.hpp @@ -51,6 +51,16 @@ struct ConstexprString { inline constexpr bool operator==(std::string_view other) const { return static_cast(*this) == other; }; + inline constexpr bool operator==(const ConstexprString& other) const { + return static_cast(*this) == static_cast(other); + }; + template + inline constexpr bool operator==(const ConstexprString& other) const { + return false; + }; + inline constexpr bool operator==(const std::string& other) const { + return static_cast(*this) == other; + }; template inline constexpr auto operator+(const ConstexprString& other) -> ConstexprString { ConstexprString response;