Checking if a function exists

Max Samukha samukha at voliacable.com
Wed Feb 21 13:53:27 PST 2007


On Wed, 21 Feb 2007 15:32:52 -0600, Tyler Knott
<tywebmail at mailcity.com> wrote:

>For all types you can use T.init as the dummy value to the function (I just remembered its existence).

This works for module scope functions:

static if (is(typeof(&.toString) == char[] function(T))) // '.' is the
module scope operator or use fully qualified name. Trickier ways might
exist.



More information about the Digitalmars-d mailing list