www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Bad error message for opCall / function objects - C++ heads beware! :)

It's not a biggie, but was quite distracting for a few minutes

class IsOdd
{
public:
    int opCall()(int i)            // <== Not here
    {
        return 0 != (i % 2);    // <== Here!!
    }
};


This gives "test1.d(51): undefined identifier i", but the line indicated is the
one inside the function, not the signature.

Weird. :)
Jul 15 2004