diff --git a/concepts/string.hpp b/concepts/string.hpp index a7c2da35..f028408d 100644 --- a/concepts/string.hpp +++ b/concepts/string.hpp @@ -13,11 +13,33 @@ #include namespace cruft::concepts { + /// A literal c-string character array. + template + concept c_string = + std::is_array_v> and + std::is_same_v< + std::remove_cvref_t< + std::remove_all_extents_t< + std::remove_cvref_t + > + >, + char + >; + /// A type that behaves like a string. ie, a sequence of characters template concept stringy = std::same_as or std::same_as or std::same_as or - std::same_as; + std::same_as or + c_string; + + + /// A type that behaves like a string _and_ has a null terminator + template + concept null_stringy = + std::same_as or + std::same_as or + std::same_as; }