3 ms·
So does C++ really guarantee that every valid pointer in a program will always point to the start of an object with an attached RTTI structure, and not for exam
by fhars 17y ago
So does C++ really guarantee that every valid pointer in a program will always point to the start of an object with an attached RTTI structure, and not for example somewhere into the middle of an array of integers that just happen to mimic the signature of an object with RTTI?
- dryicerx 17y agoYou decide where the pointer points, and how the compiler should start treating the data. That's the point of the pointer, you are given total control.
- timr 17y agoWhat does that have to do with the question of whether it's possible to infer types in C++ at runtime? What does it have to do with the question of whether it's possible to have garbage collection in C++? This debate is becoming inane. I challenge you to name another language that allows for arbitrary references to blocks of memory, while still guaranteeing that the data type of said references can always be correctly inferred. You're just nit-picking.
- calambrac 17y agoI challenge you to name another language that allows for arbitrary references to blocks of memory, while still guaranteeing that the data type of said references can always be correctly inferred That's exactly the point! Allowing arbitrary references to blocks of memory means inferring types is hard! That's exactly what the FQA entry is saying! ... I'm stunned at how adamant you're being about this. Do you really think the author doesn't know about RTTI? Seriously, dude, you're wrong.