aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/cplusplus/cxx11/data/foldExpressions.cpp
blob: e8c71d6302ea686116bf034128874a2af6f4ebed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Left
template<typename... Args>
bool all(Args... args) { return (... && args); }

// Right
template<typename... Args>
int sum(Args&&... args)
{
    return (args + ...);
}

// Binary
template<typename... Args>
int mult(Args... args)
{
    return (1 * ... * (args));
}