|
|
|
|
|
by cixin
3446 days ago
|
|
Wow awesome! It's partly these little optimizations that keeps C/C++ going. I've never considered that const might have a performance benefit (and mostly just use it as a compile time check). But will consider it in the future. Would be interesting to see performance benchmarks for the changes made here, as well as applying const in general. |
|
Usually you don't. You just tag your const globals as such and then get on with your day. Once you develop the habit the cost is zero so measuring the benefits isn't necessary.