|
C++ Template Metaprogramming
Solutions to the exercises throughout the book
|
Solution to Exercise 2-2. More...
#include <boost/static_assert.hpp>#include <boost/type_traits/add_pointer.hpp>#include <boost/type_traits/is_reference.hpp>#include <boost/type_traits/remove_reference.hpp>#include <assert.h>Go to the source code of this file.
Namespaces | |
| namespace | exercise_2_2 |
| Encapsulate solution for Exercise 2-2. | |
Functions | |
| template<typename Target , typename Source > | |
| Target | exercise_2_2::polymorphic_downcast (Source *const x) |
| Check the validity of a downcast. | |
| template<typename Target , typename Source > | |
| Target | exercise_2_2::polymorphic_downcast (Source &x) |
| Check the validity of a downcast. | |
Solution to Exercise 2-2.
Definition in file exercise-2-2.hpp.