
Simonson, Lucanus J wrote:
People are doing egregious things with casting completely unrelated types back and forth all the time.
Yes, to some still large extent and in spite the effort of the "professional" community to teach otherwise. Is that a blanket-permission to do the same? NO. Our industry sucks, and precisely because of that. There is too many people that should be doing something else... 4 times the last two years I tried to hire a junior developer to absorb part of my workload. Every time I interviewed a candidate I got *so* frustrated that I just gave up for months and just kept working 10 hours a day all by myself. You said it yourself. Boost is supposed to set an example.
I see it in my work and I do try to tell them they're playing with fire (because it's error prone, not because of compiler concerns) but they can make it work with enough trial and error and that is how real applications work, unfortunately.
Yes, but Boost is precisely not limited in the way the industry is. Better take your time and produce something that shows what quality software is about! Anyway, let's not digress. This started becasue you mentioned that you used reinterpret_cast<>, but your are using static_cast<> instead. As long as you don't step over "void*" in the way fom one type to another, static_cast<> is perfectly safe. If you were to screw up the derived class in such a way that it prevents the cast to be 100% safe, the compiler will just reject your code. That's why static_cast<> was invented for. Best Fernando