Why does C # do this but C ++ / CLI can't?

The .NET Framework 3.5 comes with all the benefits of LINQ and also includes the predefined generic delegates Func and Action. They are common for up to 4 arguments. I am writing a C ++ / CLI project that (unfortunately) uses VS 2005 and must only rely on the 2.0 build standard (so no System.Core).

I tried to define my own generic delegates (in my own namespace) to simplify future ports, the compiler clamps this (multiple definitions). Any suggestions?

delegate void Action();

generic <typename Arg1>
delegate void Action(Arg1 arg1);

      

0


source to share


1 answer


I'm guessing here, but I think it's best to only define those delegates in the C # assembly. C ++ / CLI has no problem using such a family of overloaded generics, but can't seem to identify them.



+1


source







All Articles