non type template arguments

Solutions on MaxInterview for non type template arguments by the best coders in the world

showing results for - "non type template arguments"
Carlos
01 Nov 2016
1// template arguments
2#include <iostream>
3using namespace std;
4
5template <class T, int N>
6T fixed_multiply (T val)
7{
8  return val * N;
9}
10
11int main() {
12  std::cout << fixed_multiply<int,2>(10) << '\n';
13  std::cout << fixed_multiply<int,3>(10) << '\n';
14}
similar questions
queries leading to this page
non type template arguments