Uniform Function Call Syntax?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 5 14:12:14 PST 2016


On 3/3/2016 5:56 PM, user001 wrote:
> It may not add as much value but I think it'd be a bit better as now you no
> longer have a global function with a simple name "dot". For mathematical
> purposes it is a lot easier to understand "dot(a, b)" than "a.dot(b)", at least
> in my opinion. Just curious that's all.

If that's how you want to call dot, add the following:

    float dot(Vec3 a, Vec3 b) { return a.dot(b); }


More information about the Digitalmars-d mailing list