hi, The & operator returns the address of the variable. What I want to do is change & operator to something like _ or é or $ (You got the point). How can I do that?
default:
Operator overloading is a per-class thing, and you can only overload existing operators, not make new ones. the symbols you want are not existing operators.
~ or ! can be used but why bother, its already &. & is universally understood, does not need a class wrapper, and is the same amount of ugly,typing, and so on. Nothing to be gained, just confusion and clunk if you do this. Also, overloaded operators sometimes get their order messed up, the defaults have a known and well understood ordering.
that said, you can make a function with those names, or some of them. I hate macros but the loss of the type info in a macro might make this a good candidate. Though it still suffers the issue of confusing the reader and bloat.
What I want to do is change & operator to something like _ or é or $ (You got the point).
Why?
If you are concerned about being able to freely change the meaning of operator&, use std::addressof consistently where the address of an object is actually required. https://en.cppreference.com/w/cpp/memory/addressof
P.S.: I've noticed that you don't usually respond to questions, but you should, because the answers are important for understanding and fixing your problem.
My impression is that this poster isn't really looking to learn and understand things. Their MO here seems to be to ask vague questions in the hope of getting someone else to write their code for them. They've certainly never engaged with any of the questions I've tried to ask them, or with any of the discussions I've tried to have with them.