Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tmplt authored Jul 13, 2017
2 parents 0a54853 + acd5095 commit 75b5120
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ string full_process(string str);

size_t min(size_t a, size_t b);

#ifdef CPP17

template <typename First, typename ... T>
decltype(auto) max(const First &f, const T & ... t)
{
const First *retval = &f;
( (retval = &std::max(*retval, t)), ... );
return *retval;
}

#else

/*
* An "extension" of std::max() so that more than two arguments
* can be passed. The first argument decides what everything else
Expand All @@ -39,6 +51,8 @@ auto max(const T &first, const Args&... args)
return *max;
}

} // utils utils
#endif

} // utils utils

} // utils fuzz

0 comments on commit 75b5120

Please sign in to comment.