1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <algorithm> #include <cstddef> namespace kstd::libc { extern "C" { auto strlen(const char * string) -> std::size_t { return std::distance(string, std::ranges::find(string, nullptr, '\0')); } } } // namespace kstd::libc