+ 3
Can we somehow create new operators?
In C++, Operator Overloading helps use existing operators for other class-specific purposes... But, is there a way to create new operators? Eg - $A to get the Transpose of a Matrix Class's Object...
16 ответов
+ 5
Sure...
I will also try to complete mine by then...
+ 4
All I want to know is that if that predefined operator list can be extended to new ones...like $ or ASCII characters from 128-255...
+ 4
Thanks a Lot Again!
+ 4
@Keshave Jat
https://code.sololearn.com/cq24J951TxgI/?ref=app
The Beta Version - Its finally ready!
+ 3
@Keshave Jat
So You're saying !a in C++ is meaningless?
+ 3
And what about ++a, -a?
+ 3
Thats not good.. :(
+ 3
Or maybe use a different predefined operator, right...
+ 3
Thats an awesome library...
+ 1
yes there are rules of identifies so we can not create function with name $ as we have in jQuery and we can overload limited operators, so we can't do this in c++
+ 1
c++ is object oriented programming language. so if you want transpose function then just create a new class and implement method name transport or whatever you want to use
+ 1
https://www.tutorialspoint.com/cplusplus/cpp_overloading.htm
there you will find the complete list of overloadable operators
+ 1
ok I'll work on it and I'll post my matrix class. I think it will solve your problems.
I will notify you here when code was completed
+ 1
ok i got linear algebra library
http://arma.sourceforge.net/
this library have all you need or you can change or get inspiration from it coz it is open source library
0
there are the complete list of operators that can be overload.
you are missing something that the identifiers can only be started with alphanumeric and underscore only
so there is no chance of using $ as first letter of identifier
0
yes we can overload ++ both post and pre operators in c++