C++: Exemple d’une fonction générique de type ‘class’

Author:


{filelink=15775}


#include 
using namespace std;

template 
void fonction_Gen(T1 x, T2 y)
{
  cout << x << ' ' << y <<endl;
}

int main()
{
  fonction_Gen(3, 3.14);

  fonction_Gen('a', "A bana");

  return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *