Legit question because i think I’m misunderstanding. But if its a const, how are you able to swap or replace it?
It’s only a const within a function. You can pass the value to another function and changing it as it’s passed. For example:
const int foo = 1
other_func( foo + 1)
In functional programming, you tend to keep track of state on the stack like this.
Keeping state managed. The data for the function will be very predictable. This is especially important when it comes to multithreading. You can’t have a race condition where two things update the same data when they never update it that way at all.