function is not function

Ellery Newcomer ellery-newcomer at utulsa.edu
Fri Sep 21 12:59:31 PDT 2012


solution is to use std.traits, but can someone explain this to me?

import std.stdio;

void main() {
     auto a = {
         writeln("hi");
     };
     pragma(msg, typeof(a)); // void function()
     pragma(msg, is(typeof(a) == delegate)); // nope!
     pragma(msg, is(typeof(a) == function)); // nope!
}


More information about the Digitalmars-d-learn mailing list