Getting a type for a template instantiation?
- by ebo
I have the following situation:
I have a object of type MyClass, which has a method to cast itself to it's base class. The class includes a typedef for it's base class and a method to do the downcast.
template <class T, class B>
class BaseClass;
template <class T>
class NoAccess;
template <class T>
class MyClass : public BaseClass<T, NoAccess<T> >
{
private:
typedef BaseClass<T, NoAccess<T> > base;
public:
base &to_base();
};
I need to pass the result of a base call to a functor Operator:
template <class Y>
class Operator
{
Operator(Y &x);
};
Operator<???> op(myobject.to_base());
Is there a easy way to fill the ??? provided that I do not want to use NoAccess?