mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
29 lines
543 B
C++
29 lines
543 B
C++
// semmle-extractor-options: --edg --c++17
|
|
|
|
template<typename ...Args>
|
|
int sum(Args&&... args) {
|
|
return (args + ...);
|
|
}
|
|
|
|
template<typename ...Args>
|
|
int product(Args&&... args) {
|
|
return (... * args);
|
|
}
|
|
|
|
template<typename ...Args>
|
|
bool all(Args&&... args) {
|
|
return (args && ... && true);
|
|
}
|
|
|
|
template<typename ...Args>
|
|
bool any(Args&&... args) {
|
|
return (false || ... || args);
|
|
}
|
|
|
|
void f() {
|
|
int x = sum(1, 2, 3, 4, 5);
|
|
int y = product(2, 4, 6, 8);
|
|
bool a = all(true, true, false, true);
|
|
bool b = any(false, true, false, false);
|
|
}
|