interface with overloaded operator : Generic Interface « Generics « Visual C++ .NET






interface with overloaded operator

 

#include "stdafx.h"
interface class IAddition
{
      static IAddition^ operator+(IAddition^, IAddition^);
};

generic <typename T> where T : IAddition
ref class G
{
   T add(T t1, T t2) { return t1 + t2; }
};

   
  








Related examples in the same category

1.generic interface demo
2.interface constraint