![]() |
.. (לתיקייה המכילה) | |
Can we use C-style cast for the actual conversion?
|
es, 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. |
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" |
There is an incompatibility between the pdf file and the h file:
The pdf file defines the RegisterInheritence function in the following way:
static void RegisterInheritence(const Type* base),
but the h file defines this function in the following way:
void RegisterInheritence(const Type* base).
Which declaration is the correct one?
| The h file declaration: void RegisterInheritence(const Type* base). |

