3 ms·
const std::set<int> s; // This is immutable. const_cast<std::set<int>&>(s).emplace(); // This is UB.
by searealist 9y ago
const std::set<int> s; // This is immutable.
const_cast<std::set<int>&>(s).emplace(); // This is UB.
- humanrebar 9y agoAnd what do the assignment operators of Foo look like?
- searealist 9y agoI'm fixing your incorrect understanding of how const works in C++ and you are choosing to be argumentative.