[ox/std] Make ox_strncmp a template

This commit is contained in:
Gary Talent 2020-06-17 01:52:28 -05:00
parent d4983cf3c6
commit 1c5fed05bf

View File

@ -66,7 +66,8 @@ template<typename T1, typename T2>
return retval; return retval;
} }
[[nodiscard]] constexpr int ox_strncmp(const char *str1, const char *str2, const std::size_t maxLen) noexcept { template<typename T1, typename T2>
[[nodiscard]] constexpr int ox_strncmp(T1 str1, T2 str2, const std::size_t maxLen) noexcept {
auto retval = 0; auto retval = 0;
std::size_t i = 0; std::size_t i = 0;
while (i < maxLen && (str1[i] || str2[i])) { while (i < maxLen && (str1[i] || str2[i])) {