C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
c++20/exercise-2-2.hpp File Reference

Solution to Exercise 2-2 (C++20). More...

#include <assert.h>
#include <memory>
#include <type_traits>

Go to the source code of this file.

Namespaces

namespace  exercise_2_2
 Encapsulate solution for Exercise 2-2.
 
namespace  exercise_2_2::cpp20
 Encapsulate solution for Exercise 2-2 (C++20).
 

Functions

template<typename Target , typename Source >
Target exercise_2_2::cpp20::polymorphic_downcast (Source *const x)
 Check the validity of a downcast.
 
template<typename Target , typename Source >
Target exercise_2_2::cpp20::polymorphic_downcast (Source &x)
 Check the validity of a downcast.
 

Detailed Description

Solution to Exercise 2-2 (C++20).

Author
Matt Bisson

Definition in file c++20/exercise-2-2.hpp.