CPP06 1.0
|
This exercise is about using the static_cast.
Scalar conversion
Does the program work as required? Did the student use the static_cast to convert values? We'll accept the use of implicit casts for promotion casts only.
Anyway, please don't be too uncompromising towards the exercise's outputs if the spirit of the exercise is respected.
Even if this exercise is wrong, continue the evaluation process.
日本語訳
This exercise is about using the reinterpret_cast.
Retyping of raw data
Does the program work as required?
The reinterpret_cast<> should be used twice.
First from data* to uintptr_t.
Then, from uintptr_t to data*.
And the final data struct should be usable.
日本語訳
This exercise is about using the dynamic_cast.
Real type identification
Does the program work as required?
Check the code. Did the student use the dynamic_cast to identify the real type?
void identify(Base* p)
: should check if the cast return is NULL.
void identify(Base\& p)
: should use a try and catch block to check if the cast failed.
(In case you're wondering, the header must not appear anywhere.)
日本語訳