I've mentioned this quite a few times already, "you can do this once operator overloading is supported."
So I really have to ask, will it be supported sometime?
Not everything C++ will be in Aurora, just as there will be many things in Aurora you can't do in C, or any other language.
It all depends on how difficult it is to code and parse something like that. Since I haven't tried yet I can't give a definate answer..
From my never having written a real parser before, I couldn't say, but I would imagine it would go something like this:
- Recognize the form LITERAL op EXPRESSION
- Instead of acting based on built in types, first look up to see if that LITERAL is a class and if it contains an operator OP definition
- If it does, insert a call to the operator subroutine. Otherwise, act as the compiler normally would.
I realize I probably know nothing about it, but I'm just trying to help...