www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - isSafe and overloaded functions

I'm sure there's an easy solution for this problem, but I can't seem to find 
the correct syntax to do this. What I want to do is checking whether a 
specific function overload is safe.

import std.traits;
import std.stdio;

 system void abc(){}
 safe void abc(int a){}

void main() {
    writeln(isSafe!(abc)); // returns false
    writeln(isSafe!(abc(int))); //not working
    writeln(isSafe!(&abc(int))); //not working
    writeln(isSafe!(abc(int.init))); //not working
    writeln(isSafe!(&abc(int.init))); //not working

Johannes Pfau
Nov 04 2010