cmStringAlgorithms: Add cmStrLen()

This commit is contained in:
Kyle Edwards
2020-09-03 11:50:25 -04:00
parent 412cc37d35
commit 0c9cdf30ed
2 changed files with 17 additions and 0 deletions
+7
View File
@@ -33,6 +33,13 @@ inline bool cmNonempty(std::string const* str)
return str && !str->empty();
}
/** Returns length of a literal string. */
template <size_t N>
constexpr size_t cmStrLen(const char (&/*str*/)[N])
{
return N - 1;
}
/** Callable string comparison struct. */
struct cmStrCmp
{