eolian-cxx: Added eo_base extension_inheritance

Added eo::base as a partial specialization for extension inheritance,
since eo::base is not generated.
This commit is contained in:
Felipe Magno de Almeida 2014-07-16 20:13:46 -03:00
parent 637a97a0f5
commit bde4b6e9df
1 changed files with 21 additions and 0 deletions

View File

@ -230,6 +230,27 @@ inline bool operator!=(base const& lhs, base const& rhs)
return !(lhs == rhs);
}
namespace detail {
template <typename T>
struct extension_inheritance;
template<>
struct extension_inheritance<base>
{
template <typename T>
struct type
{
operator base() const
{
return base(eo_ref(static_cast<T const*>(this)->_eo_ptr()));
}
};
};
}
/// @brief Downcast @p U to @p T.
///
/// @param T An <em>EO C++ Class</em>.