Search code examples
Are a const std::vector<T>'s elements logical or physical const?...


c++vectorconst-cast

Read More
Why does this return statement seem to require a const_cast?...


c++const-cast

Read More
Correct usage(s) of const_cast<>...


c++const-cast

Read More
Does a const-qualified member function promise not to modify the object? How is this legal?...


c++undefined-behaviormutableconst-cast

Read More
Is this const_cast in the context of type-erasure undefined behavior?...


c++undefined-behaviorstd-functiontype-erasureconst-cast

Read More
std::unordered_map data member with const key inside const method not compiling...


c++c++11unordered-mapconst-cast

Read More
Getting a mutable element from a std::set, for operations that won't break the order...


c++setundefined-behaviormutableconst-cast

Read More
Where is the undefined behavior when using const_cast<>?...


c++undefined-behaviorconst-cast

Read More
Does calling non-const mem. fun. on const object via non-const ref obtained via const_cast invoke UB...


c++language-lawyerundefined-behaviorconst-cast

Read More
Why is a cast `int**const` to `const int**const` forbidden...


c++castingconst-cast

Read More
const_cast vs mutable and undefined behavior...


c++undefined-behaviormutableconst-cast

Read More
is `const_cast`ing away const on a reference worth it to preserve the api...


c++const-castsycldpc++

Read More
is it ok to use const_cast in member routines to avoid duplicated code...


c++oopconst-cast

Read More
Is it allowed to cast away const on a const-defined object as long as it is not actually modified?...


c++constantsundefined-behaviorconst-cast

Read More
`const_cast`, top-level const and lvalue-to-rvalue conversions...


c++standardsimplicit-conversionconst-cast

Read More
How to use const_cast?...


c++const-cast

Read More
Can not use dynamic_cast to a const object...


c++constantsdynamic-castconst-cast

Read More
How does std::map::extract() allow changing the key?...


c++templatesstlstdmapconst-cast

Read More
How to use the non-const getter if there's a const one too?...


c++getterconst-cast

Read More
Is it necessarily bad to use const_cast when working with legacy libraries?...


c++legacy-codeconst-castconst-pointer

Read More
How do I assign to a const variable using an out parameter in C++?...


c++constantsconst-cast

Read More
Is it possible to cast a pair<Key, Value> to a pair<const Key, Value>?...


c++stlconstantsconst-caststd-pair

Read More
Why is (int&)0 ill-formed?...


c++castinglanguage-lawyerstatic-castconst-cast

Read More
For unit tests, is there a hackish way to change the value of a const variable?...


c++c++11googletestconst-cast

Read More
Why is only static_cast able to return new object of requested type?...


c++dynamic-castreinterpret-caststatic-castconst-cast

Read More
Remove duplication in equivalent const and non-const members when returning optional reference by va...


c++c++11constantsconst-castboost-optional

Read More
Is it safe to use std::string::c_str() to modify the underlying std::string?...


c++stdstringconst-castc-str

Read More
Why does const_casting a heap.top() of priority_queue have undefined behavior?...


c++c++17priority-queueundefined-behaviorconst-cast

Read More
change the value of const_cast ptr/ref doesn't change the original object value?...


c++const-cast

Read More
static_cast taking away constness...


c++static-castconst-cast

Read More
BackNext