I have a type

public class SuperFunction(T)
{
  T t;
  return(T) Do() { return t(); }
}

where T is a delegate or function. First, I would like to be able to specify that this must be the case for SuperFunction so we can't pass non-function/delegates for T. Second, How to specify the return type of Do to match that of T.

e.g., SuperFunction!(bool function())

then return(T) should be bool.

Similarly, I would like to extra the T's parameters and make Do have them also.

This way, SuperFunction!T.Do emulates T in every way.


Reply via email to