Return type depends on his argument's template

TSalm tsalm at free.fr
Sat Jul 5 01:21:27 PDT 2008


Hello,

Is there a way to do this :

/* ------------------------------------- */
class A(T)
{
  // some methods
}

class B
{
  T getValue( A(T) a )  // <-- Here, the type of the return value 
                        //     is the type T of A(T)
  {  /* some code */  }
}
/* ------------------------------------- */


thanks in advance,
TSalm


More information about the Digitalmars-d-learn mailing list