template struct mrpt::ptr_cast

Overview

Converts a polymorphic smart pointer Base::Ptr to Derived::Ptr, in a way compatible with MRPT >=1.5.4 and MRPT 2.x series.

#include <mrpt/rtti/CObject.h>

template <typename CAST_TO>
struct ptr_cast
{
    // methods

    template <typename CAST_FROM_PTR>
    static CAST_TO::Ptr from(const CAST_FROM_PTR& ptr);
};