Getting a type for a template instantiation?

Posted by ebo on Stack Overflow See other posts from Stack Overflow or by ebo
Published on 2010-05-21T20:20:55Z Indexed on 2010/05/21 20:30 UTC
Read the original article Hit count: 172

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates