Using structs of derived class y base template

2019-08-01 04:49发布

问题:

I have a base template:

template <typename T>
class Base
{
    public:
        void method(T);
};

And a derived class:

class Derived: public Base<Derived::status_t>
{
    public:
     typedef struct
     {
        uint8_t value;
     } status_t; 
} 

I'm have more derived classes, each one with it status_t specific struct. I want to use these structs in the base class, but the compiler give me an error:

Error[Pe070]: incomplete type is not allowed.

I suppose that the problem is that the struct is not defined in the moment that the base constructor is called. Is there any way to maintain the struct in the derived class and use it un the base template?

Thanks,