compile time method check

Weed resume755 at mail.ru
Fri Dec 26 11:15:30 PST 2008


Can I at compile time check whether there is a facility method
(toString(), for example)?

Today I wrote:

                static if ( __traits(isArithmetic, Element) ) {
                    ret ~= toString(this[i,j]) ~ "\t";
                } else {
                    ret ~= this[i,j].toString ~ "\t";
                }

It works but it is wrong


More information about the Digitalmars-d-learn mailing list