Metaprogramming: check for ref

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Sep 30 14:34:49 PDT 2012


On 9/30/12, jerro <a at a.com> wrote:
> I think this should work:
>
> template returnsRef(alias f)
> {
>      enum bool returnsRef = is(typeof(
>      {
>          ParameterTypeTuple!f param;
>          auto ptr = &f(param);
>      }));
> }

Yep. We should add this to Phobos imo.


More information about the Digitalmars-d-learn mailing list