.. (לתיקייה המכילה) | ||
Can we use C-style cast for the actual conversion? | |
Yes, recall that C-style cast is a compile-time mechanism |
Eclipse gives error on the example code, what's wrong? | |
Eclipse might be a bit buggy. Note that if you have the required compiler (g++ 4.8+) the code will compile in eclipse despite the shown errors. |
Shouldn't the dynamic cast example classes implement MyType()? | |
This is true. The sample code isn't updated, both classes should implement MyType() by calling the correct GetType(). |
Why must the inheritance data structure be a member of the OOP5 class? | |
This is for your convenience. If you are more comfortable with implementing it in some class - you can, as long as everything compiles properly and the requested functions work as expected. |
Can we use c++11 type traits that aren't is_base_of? | |
Yes |
I'm having trouble with detecting references 'types', what can I do? | |
You can assume that if a reference type is being checked, the full function signature will be written. I.e - my_static_cast<A&,B&>(whatever) instead of my_static_cast<A&>(whatever) And of course, this is the same for my_dynamic_cast. |
Should we check for virtual inheritance in any part and fail if we detect it? | |
No, as stated in the exercise , you may assume no virtual inheritance will be involved anywhere. |
How should we compile our code? | |
You should compile your implementation using the "-c" flag. A common compilation command will be: g++ -c -std=c++11 OOP5.cpp You can check your makefile and code with the cpp test file that was added under the assignment: - compile your code, probably as above. - run "ar rvs my_imp.a OOP5.o" - run "g++ test.cpp my_imp.a -std=c++11" Note that you should include in your makefile the cpp file even if you don't use it (in that case the file should only contain the '#include "OOP5.h"' line) |