variadic templates
main.cpp File Reference
#include <cstdarg>
#include <iostream>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int sum1 (int count,...)
 
template<typename T >
constexpr auto sum2 (T arg)
 
template<typename T , typename... Args>
constexpr auto sum2 (T first, Args... args)
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 40 of file main.cpp.

Here is the call graph for this function:

◆ sum1()

int sum1 ( int  count,
  ... 
)

Definition at line 9 of file main.cpp.

Here is the caller graph for this function:

◆ sum2() [1/2]

template<typename T >
constexpr auto sum2 ( arg)
constexpr

Definition at line 27 of file main.cpp.

Here is the caller graph for this function:

◆ sum2() [2/2]

template<typename T , typename... Args>
constexpr auto sum2 ( first,
Args...  args 
)
constexpr

Definition at line 34 of file main.cpp.

Here is the call graph for this function: