-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
@ZenoTan
Description
The exercise answer could not handle negative values:
template<typename ... T> auto average(T ... t) { return (t + ... ) / sizeof...(t); } int main() { std::cout << average(1, 2, 3, 4, 5, -6, -7, -8, -9, -10) << std::endl; }
It would return 1844674407370955159 on my side since it deduced the return value to be unsigned int.
Metadata
Metadata
Assignees
Labels
No labels