diff --git a/Redcraft.Utility/Source/Public/String/String.h b/Redcraft.Utility/Source/Public/String/String.h index 9fecea9..ac61174 100644 --- a/Redcraft.Utility/Source/Public/String/String.h +++ b/Redcraft.Utility/Source/Public/String/String.h @@ -18,6 +18,9 @@ NAMESPACE_MODULE_BEGIN(Utility) NAMESPACE_PRIVATE_BEGIN +template struct TIsTString : FFalse { }; +template struct TIsTString> : FTrue { }; + template class TCStringFromTString final : FNoncopyable { @@ -58,6 +61,8 @@ private: NAMESPACE_PRIVATE_END +template concept CTString = NAMESPACE_PRIVATE::TIsTString>::Value; + /** The default string allocator that uses SSO and can be placed right into FAny without dynamically allocating memory. */ template using TDefaultStringAllocator = TInlineAllocator<(40 - 3 * sizeof(size_t)) / sizeof(T)>; diff --git a/Redcraft.Utility/Source/Public/String/StringView.h b/Redcraft.Utility/Source/Public/String/StringView.h index c3e2382..3627a6e 100644 --- a/Redcraft.Utility/Source/Public/String/StringView.h +++ b/Redcraft.Utility/Source/Public/String/StringView.h @@ -20,9 +20,21 @@ NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) NAMESPACE_MODULE_BEGIN(Utility) +template +class TStringView; + template Allocator> class TString; +NAMESPACE_PRIVATE_BEGIN + +template struct TIsTStringView : FFalse { }; +template struct TIsTStringView> : FTrue { }; + +NAMESPACE_PRIVATE_END + +template concept CTStringView = NAMESPACE_PRIVATE::TIsTStringView>::Value; + /** * The class template TStringView describes an object that can refer to a constant contiguous sequence of char-like objects * with the first element of the sequence at position zero. Provides a set of convenient string processing functions. @@ -506,8 +518,8 @@ public: /** * Converts a string into a boolean value. * - * - 1, "true", "True", "TRUE" and non-zero integers become true. - * - 0, "false", "False", "FALSE" and unparsable values become false. + * - "True" and non-zero integers become true. + * - "False" and unparsable values become false. * * @return The boolean value. */