Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
#define c_dynamic_cast(__struct,__field,__ptr) ((__struct*)&(((char*)__ptr)[(char*)0 - (char*)&((__struct*)0)->__field]))
class ChatViewControllerclass ChatStyleOutput : public QWebPage, public ChatViewController
/// This template functions should be used when we perform cast from one pointer type to another
/// It's safer than using reiterpret_cast
///
/// It doesn't allow to do such things like:
/// int i = 10;
/// A *a = pointer_cast<A*>(i);
/// Only pointer could be used in this function.
template<typename result, typename source>
result pointer_cast(source *v)
{
return static_cast<result>(static_cast<void*>(v));
}
template<typename result, typename source>
result pointer_cast(const source *v)
{
return static_cast<result>(static_cast<const void*>(v));
}
Приведение типов