forked from pezy/CppPrimer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
30 lines (26 loc) · 773 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/***************************************************************************
* @file main.cpp
* @author Alan.W
* @date 12 Feb 2014
* @remark This code is for the exercises from C++ Primer 5th Edition
* @note
***************************************************************************/
//!
//! Exercise 16.51:
//! Determine what sizeof...(Args) and sizeof...(rest) return for each call to foo in this section.
//!
//! Exercise 16.52:
//! Write a program to check your answer to the previous question.
//!
#include <iostream>
template<typename T,typename ...Args>
void foo(T t,Args ...args)
{
std::cout << sizeof...(Args) << std::endl;
std::cout << sizeof...(args) << std::endl;
}
int main()
{
foo(1,2);
foo(1,23,4,5,6);
}