"

8 __UNKNOWN__

#include <iostream>

 

using namespace std;

template <typename T>

 

void fun(const T& x)

{

static int count = 0;

cout << “x = ” << x << ” count = ” << count << endl;

++count;

return;

}

 

 

int main()

{

fun<int>(1);

cout << endl;

fun<int>(1);

cout << endl;

fun<double>(1.1);

 

cout << endl;

 

return 0;

 

}

License

Icon for the Creative Commons Attribution 4.0 International License

Boot Camp Sandbox Book Copyright © by Fort Hays State University is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.