Is there any way I can declare an operator **
such that a**b == pow(a, b)
? Maybe using some preprocessor macro trickery?
Asked
Active
Viewed 51 times
0

andrepd
- 587
- 6
- 20
-
1IIRC: You cannot define new operators. What's wrong with `pow`? – Charles Oct 23 '16 at 17:29
-
What is wrong with typing those couple extra characters so that future readers will know what is going on? – Ed Heal Oct 23 '16 at 17:34
-
If you give it a proper name, [sort of](https://stackoverflow.com/questions/1515399/can-you-make-custom-operators-in-c). With the literal `**`, nope. – Baum mit Augen Oct 23 '16 at 17:36
-
[This](http://www.stroustrup.com/whitespace98.pdf) might be a interesting read for you – 463035818_is_not_an_ai Oct 23 '16 at 17:42
-
Would `a *pow* b` be acceptable? – Yakk - Adam Nevraumont Oct 23 '16 at 19:21