util/path.h: Fixed narrowing warning from older versions of clang.

This commit is contained in:
Vas Crabb 2022-11-27 14:44:34 +11:00
parent b7f9c64e6b
commit 7b88d53b61

View File

@ -54,7 +54,7 @@ inline std::string &path_append(std::string &path, T &&next, U &&... more)
if (!path.empty() && !is_directory_separator(path.back())) if (!path.empty() && !is_directory_separator(path.back()))
path.append(PATH_SEPARATOR); path.append(PATH_SEPARATOR);
path.append(std::forward<T>(next)); path.append(std::forward<T>(next));
if constexpr (sizeof...(U)) if constexpr (sizeof...(U) > 0U)
return path_append(path, std::forward<U>(more)...); return path_append(path, std::forward<U>(more)...);
else else
return path; return path;
@ -72,7 +72,7 @@ template <typename T, typename... U>
inline std::string path_concat(T &&first, U &&... more) inline std::string path_concat(T &&first, U &&... more)
{ {
std::string result(std::forward<T>(first)); std::string result(std::forward<T>(first));
if constexpr (sizeof...(U)) if constexpr (sizeof...(U) > 0U)
path_append(result, std::forward<U>(more)...); path_append(result, std::forward<U>(more)...);
return result; return result;
} }