Pregunta

This works fine, Derive automatically gets access to Base's operators

class Base
{
public:
 operator const SomeType &() const {...}
...
};

class Derive : public Base
{
...
};

But I need to add another casting operator to Base, which will hide the superclass operator. However when I try to use using to resolve this, before adding any new methods, the conversion no longer works at compile-time.

class Derive : public Base
{
public:
  using Base::operator const SomeType &;
...
};

What is the problem here?

¿Fue útil?

Solución

As mentioned in comments, what I was trying to do is correct. Problems were elsewhere in the code.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top