I\'d like to write function interfaces that force the user to acknowledge the semantic meaning of built-in constants. For example, I\'d like to take
void rotate(
It is absolutely possible to write OOP code that is as efficient as the procedural code. Even more, sometimes you can gain surprising speedups if you take advantage of the added semantics or class-based code. One of the great examples of such an advantage is std::swap
. Yes, use templates ;).
What makes it possible to write an effective Radian class is inlining. However, use it wisely!
Checklist:
explicit
constructorconst
where applicable