Metaprogramming: check for ref

mist none at none.none
Sun Sep 30 15:10:33 PDT 2012


Thanks!

On Sunday, 30 September 2012 at 21:20:40 UTC, jerro wrote:
> 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