Mega Code Archive

 
Categories / Visual C++ .NET / Generics
 

Specify the type parameter for generic function

#include "stdafx.h" using namespace System; generic < typename T> void GenericFunction(T t) {    Console::WriteLine(t); } int main() {    int i;    GenericFunction<int>( 200 );    GenericFunction( 400 ); }