diff options
Diffstat (limited to 'Source/cmStringAlgorithms.h')
-rw-r--r-- | Source/cmStringAlgorithms.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h index f3c262b..01e3d94 100644 --- a/Source/cmStringAlgorithms.h +++ b/Source/cmStringAlgorithms.h @@ -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 { |