Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operators aren't exposed for deepter-than-1-stage inheritance #31

Open
muffgaga opened this issue Aug 4, 2020 · 1 comment
Open

Operators aren't exposed for deepter-than-1-stage inheritance #31

muffgaga opened this issue Aug 4, 2020 · 1 comment

Comments

@muffgaga
Copy link
Contributor

muffgaga commented Aug 4, 2020

namespace detail {
template<typename Derived, typename T>
struct BaseType
{
    // comparison operator here
};
} // namespace detail

namespace X {
struct GENPYBIND(inline_base("*")) Value : public Y::Value
{
    constexpr explicit Value(uintmax_t value = 0) GENPYBIND(implicit_conversion) : base_t(value) {}
};
} // namespace X

namespace Y {
struct GENPYBIND(inline_base("*")) Value : public detail::BaseType<Value, uint32_t>
{
    constexpr explicit Value(uintmax_t value = 0) GENPYBIND(implicit_conversion) : base_t(value) {}
};
} // namespace Y

yields

// FIXME: expose [Operator CursorKind.FUNCTION_DECL detail::operator==]
//        ('operator==', 2) -> (('eq', 'eq'), 'l == r')
//        ['const ::Y::Value', 'const ::Y::Timer::Value']
@muffgaga
Copy link
Contributor Author

muffgaga commented Aug 4, 2020

@kljohann suggested explicit using declarations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant