Search code examples
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
Idiomatic way to create an immutable and efficient class in C++...


c++constantsimmutabilityconst-cast

Read More
Value of const changed in the memory but not on the output...


c++pointersconstantsconst-cast

Read More
Unexpected behavior involving const_cast...


c++constantsstdstringconst-castcopy-on-write

Read More
Const cast to non-pointer non-reference type...


c++language-lawyerconst-cast

Read More
assign non-static const member in class with const_cast...


c++constructorconstantsconst-cast

Read More
How to const_cast a vector of const pointers to a vector of non-const pointers?...


c++pointersvectorconst-cast

Read More
Why type casting of const void* is legal in C not C++ without using static_cast...


c++castingreinterpret-caststatic-castconst-cast

Read More
Lifetime extension of temporary by non-const reference using const-cast...


c++language-lawyerobject-lifetimeconst-cast

Read More
Modifying element of const std::vector<T> via const_cast...


c++stllanguage-lawyerstdvectorconst-cast

Read More
BackNext