I\'m implementing variadic min/max functions. A goal is to take advantage of the compile time known number of arguments and perform an unrolled evaluation (
I appreciate the thought Yakk put into return types so I wouldn't have to, but it gets a lot simpler:
template
T&& vmin(T&& val)
{
return std::forward(val);
}
template
auto vmin(T0&& val1, T1&& val2, Ts&&... vs)
{
return (val1 < val2) ?
vmin(val1, std::forward(vs)...) :
vmin(val2, std::forward(vs)...);
}
Return type deduction is pretty awesome (may require C++14).