Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Nov 25, 2024
1 parent f6c59df commit 3c0cf53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ports-of-call/portability.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ PORTABLE_INLINE_FUNCTION void printf(char const *const format, Ts... ts) {
// Variadic strlen
template <typename Head, typename... Tail>
inline std::size_t strlen(Head h, Tail... tail) {
constexpr size_t MAX_I = 4096;
constexpr std::size_t MAX_I = 4096;
std::size_t i = 0;
if constexpr (std::is_convertible_v<Head, std::string_view>) {
// don't want a non-terminating loop if there's now null
// character.
for (i = 0; i < MAX_I; ++i) {
if (h[i] == '\0') {
break;
Expand Down

0 comments on commit 3c0cf53

Please sign in to comment.