As Eddy states, those aren't Unary operators. This would indicate that these aren't the ones that are causing you problems. Could you post a sample that shows the code that the compiler is complaining about?
I was brought up to respect my elders. I don't respect many people nowadays.
Unary operators require one parameter, so it's assuming that the operator should be a unary one as you are only supplying one parameter.
The operators you have listed are binary operators, so require two parameters.
Thanks for the snippets DaveyM69 - I've ended up with something similar. For now, to compare I'm using GetIndex(), but my converted code is constantly growing. Didn't know that CS is so much more complicated...
I don't believe C# is much more complicated with this; I think the real difference is that you'd typically let the overloaded operators be member functions in C++ and C# wants them to be static functions. So if you rewrite your C++ code to the static overloading, then you're already having the same code in C# and C++.
As a general rule, the quality of the answer you get is directly proportional to the quality of the question asked. Take your question for example. It's vague, broad in scope, not even a question, demonstrates lack of any research, does not demonstrate any effort on your part and does not make any sense to begin with. As a result you are going to get vague, broad answers that are probably not going to be of much help.
Bottom line: you want better answers then ask better questions.
Last Visit: 31-Dec-99 19:00 Last Update: 5-Feb-23 1:14