Conversation
|
@cmtice |
|
The ValueObject class already contains many member functions for doing type casting -- we should probably be using them as much as possible (and letting them do most of the error checking. In ValueObject.h, I see: I suspect doing this would simplify the code a lot. |
|
Oh my bad! It looks like you did you a lot of those after all. But I'm not quite clear if you are doing extra, unnecessary error checking? Maybe you can rely on those functions for more of the correctness error checking? Also, I think we should eliminate all of the C++-specific types of casts, I.e. Don't do or allow CxxStaticCast, CxxReinterpretCast or CxxDynamicCast. Only do CStyleCast. I think that should also simplify things quite a bit. |
Honestly, I just copied most of the code that was in the Parser and adjusted it to work with interfaces available in Eval, didn't look further into optimizing type checking. With the direction our upstream pull requests are going, it seems like there will be barely any code left similar to our downstream by the time we get to casts, so we can do optimization when we get there. For now I just wanted the type checking contained in the parser regardless of its efficiency. |
Move type checks for C-style, static, reinterpret casts. Remove dynamic cast checks, since it's not implemented anyway.