bool
is_class_type(decl_base*);
+class_decl*
+is_class_type(type_base*);
+
shared_ptr<class_decl>
is_class_type(const shared_ptr<type_base>);
shared_ptr<class_decl>
is_compatible_with_class_type(const shared_ptr<type_base>);
+pointer_type_def*
+is_pointer_type(type_base*);
+
shared_ptr<pointer_type_def>
is_pointer_type(const shared_ptr<type_base>);
+reference_type_def*
+is_reference_type(type_base*);
+
shared_ptr<reference_type_def>
is_reference_type(const shared_ptr<type_base>);
+qualified_type_def*
+is_qualified_type(type_base*);
+
shared_ptr<qualified_type_def>
is_qualified_type(const shared_ptr<type_base>);
return is_class_type(ty);
}
+/// Test whether a type is a class.
+///
+/// @parm t the type to consider.
+///
+/// @return the class_decl if @p t is a class_decl or null otherwise.
+class_decl*
+is_class_type(type_base* t)
+{return dynamic_cast<class_decl*>(t);}
+
/// Test whether a type is a class.
///
/// @parm t the type to consider.
is_class_type(const decl_base_sptr d)
{return is_class_type(is_type(d));}
+/// Test whether a type is a pointer_type_def.
+///
+/// @param t the type to test.
+///
+/// @return the @ref pointer_type_def_sptr if @p t is a
+/// pointer_type_def, null otherwise.
+pointer_type_def*
+is_pointer_type(type_base* t)
+{return dynamic_cast<pointer_type_def*>(t);}
+
/// Test whether a type is a pointer_type_def.
///
/// @param t the type to test.
is_pointer_type(const type_base_sptr t)
{return dynamic_pointer_cast<pointer_type_def>(t);}
+reference_type_def*
+is_reference_type(type_base* t)
+{return dynamic_cast<reference_type_def*>(t);}
+
/// Test whether a type is a reference_type_def.
///
/// @param t the type to test.
is_reference_type(const type_base_sptr t)
{return dynamic_pointer_cast<reference_type_def>(t);}
+/// Test whether a type is a reference_type_def.
+///
+/// @param t the type to test.
+///
+/// @return the @ref reference_type_def_sptr if @p t is a
+/// reference_type_def, null otherwise.
+qualified_type_def*
+is_qualified_type(type_base* t)
+{return dynamic_cast<qualified_type_def*>(t);}
+
/// Test whether a type is a qualified_type_def.
///
/// @param t the type to test.