mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 18:58:34 -06:00
Merge topic 'cmstrlen'
0c9cdf30ed cmStringAlgorithms: Add cmStrLen()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5201
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user