You need to elaborate more about the const not doing the trick. Introspection is on its track and all stakeholders are hoping for 23.
Not using globals doesn't mean the compiler *knows* I'm not. That's kind of my point. Just because I *could* have another pointer the compiler needs to generate slower code. I.e. I don't want less UB, instead I want to add a way to make it UB for pointed to objects to change.
-
-
(In realistic examples compute_something() would affect code flow and probably take parameters, i.e. wouldn't only be meaningful if it did something with globals. Was too quick to type out the example to think of that.)
-
Oh, this is part of a very actual discussion in the committee about contracts and assumptions. You will be able to write an assumption that the object is not changed. And compiler will be able to use it for making an optimization.
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.