Do you have any C++ question? I will try to answer it.
-
-
you are describing undefined behavior, const value in a scope can't be changed by a current thread, compile with -fstrict-aliasing
-
But the target of a pointer to a const value can. And while sometimes that's good enough, often it's not really an option. Sometimes escape analysis is sufficient for the compiler to realize an external call won't affect content of a dynamic allocation, but not that often.
- 13 more replies
New conversation -
-
-
Often one can (and I do) manually optimize such things by copying to local variables, but often that requires breaking abstraction layers etc. Whereas a way to tell the compiler that variable contents won't change would be a lot easier.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.