avoid some const_cast usage#4344
Conversation
|
doesn't |
I don't know. I was surprised that |
|
I do not feel our code is super elegant. An alternative would be to create a common private const function that is called both from the const and non-const method. We don't need to explicitly cast at all then. |
I am looking into this (also as preparation for |
ok I close this PR for now.. but feel free to clean up the code.. |
This would require introducing additional private This PR still gets rid of unnecessary/incorrected |
|
I feel that static_cast is even worse than const_cast though. const_cast is more strict. |
|
|
If the casts would change the type then const_cast would generate a compiler error right? So it seems it just casts away the constness. |
I assumed that |
|
Aren't those instances the canonical use case for |
|
Partially superseded by #5720. Still lacks the |
|
#5720 also includes |
No description provided.