Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void bar(int t) {
- printf("%d\n", t);
- }
- void bar(double t) {
- printf("%f\n", t);
- }
- template<typename... Args>
- void foo(Args &&... args){
- int dummy[] = {0, ((void)bar(args), 0) ...};
- }
- int main(){
- foo(1, 2.0, 3.0, 4);
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment