Why would const change the type? Wouldn't that make any const_cast UB?
I guess I'll throw in my (unverified) observation. vector<int*> and vector<int const*> are two unrelated types, regardless of the relationship of the types they contain, and as such the cast is UB.
-
-
-
It seems to me that the two vector types are unrelated. So they may as well be struct A{}; and struct B{}; It seems that you may as well be doing: A a; B& b = (b&)a; which I believe is UB.
- Näytä vastaukset
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.