generic multiple constraints : Generic Function « Generics « Visual C++ .NET






generic multiple constraints

 


#include "stdafx.h"
using namespace System;

interface class I;
ref class C;

generic <class T> where T : gcnew(), C, I
void F(T t)
{
}

interface class IKey;

generic <typename Key, typename Value>
where Key : IKey
where Value : value class
ref class Dictionary
{
};

   
  








Related examples in the same category

1.Generic function demo
2.Generic function allows the type parameter to be deduced
3.Generic function and generic array
4.generic return value
5.Specify the type parameter for generic function