Fix clang warnings on some utils function. It’s also faster
This commit is contained in:
@@ -6,13 +6,13 @@ bool is_empty(const std::string& val);
|
||||
bool is_empty(const int& val);
|
||||
|
||||
template <typename T>
|
||||
T get_first_non_empty(T&& last)
|
||||
T& get_first_non_empty(T&& last)
|
||||
{
|
||||
return last;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T get_first_non_empty(T&& first, Args&&... args)
|
||||
T& get_first_non_empty(T&& first, Args&&... args)
|
||||
{
|
||||
if (!is_empty(first))
|
||||
return first;
|
||||
|
||||
Reference in New Issue
Block a user