1 #pragma once // Source encoding: UTF-8 with BOM (π is a lowercase Greek "pi"). 11 template<
class Derived,
class Type >
15 const auto p_derived =
dynamic_cast<P_<Derived>
>( p );
16 return static_cast<P_<Type>
>( p_derived ) == p? p_derived :
nullptr;
24 class = Enable_if_<is_base_and_derived_<Type, Derived>>
28 {
return impl::downcasted_to_<Derived>( p ); }
34 class = Enable_if_<is_base_and_derived_<Type, Derived>>
38 {
return impl::downcasted_to_<const Derived>( p ); }
Some_type * P_
Creates a raw pointer type.
is_base_and_derived_, is_same_type_, is_a_, is_const_, is_class_, is_fixed_point_,...
Enable_if_ is just more readable than enable_if_t.
Simple type builders Type_, P_, R_, Raw_array_ and Raw_array_of_.
auto downcasted_to_(P_< Type > p) -> P_< Derived >