Metaprogramming: check for ref

jerro a at a.com
Sun Sep 30 14:21:02 PDT 2012


On Sunday, 30 September 2012 at 20:51:54 UTC, mist wrote:
> Thanks!
> Unfortunately, return type issue is more important in my case. 
> I'll check if implementation from ParameterStorageClassTuple 
> can be adapted for return types though.

I think this should work:

template returnsRef(alias f)
{
     enum bool returnsRef = is(typeof(
     {
         ParameterTypeTuple!f param;
         auto ptr = &f(param);
     }));
}




More information about the Digitalmars-d-learn mailing list