qore
qore copied to clipboard
Operators and implicit conversions
Currently it is possible to apply any operator to almost any expression, but many of them do not make sense:
class C {};
C c();
code x = sub(){};
printf("%N\n", 5 + c); #5
printf("%N\n", 5 + x); #5
printf("%N\n", c + x); #class C: (<NO PRIVATE DATA>) <NO MEMBERS>
I'm not sure what the last one actually does. These cases are not documented, see also #284.
The ultimate goal (in qore-llvm) is to have a well-defined set of overloads for each operator + simple overload resolution rules + implicit coercion rules.
See also #25 and #166