diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-12 15:30:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-12 15:30:12 +0000 |
commit | 7ee8aee5add8d0c5b1a9e912a7043b2da4bb7453 (patch) | |
tree | f6e43da9e61c507bb774c488714d4a2bf1d58a9a /lib/strings.hpp | |
parent | glm::value_ptr is neater (diff) | |
download | ilt-7ee8aee5add8d0c5b1a9e912a7043b2da4bb7453.tar.bz2 ilt-7ee8aee5add8d0c5b1a9e912a7043b2da4bb7453.tar.xz ilt-7ee8aee5add8d0c5b1a9e912a7043b2da4bb7453.zip |
Move generic constexpr_strlen to lib
Diffstat (limited to 'lib/strings.hpp')
-rw-r--r-- | lib/strings.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/strings.hpp b/lib/strings.hpp new file mode 100644 index 0000000..ee0db95 --- /dev/null +++ b/lib/strings.hpp @@ -0,0 +1,14 @@ +#ifndef STRINGS_HPP +#define STRINGS_HPP + +constexpr auto +constexpr_strlen(const GLchar * const s) +{ + std::size_t ch {}; + while (s[ch]) { + ch++; + } + return ch; +} + +#endif |