Rella
Rella

Reputation: 66965

How do you inherit from template class when you need to inherit not from template?

Sounds bad.. but having

template < int ArrayLength, typename SomeValueType > class SomeClass{
    SomeValueType SomeValue;
    SomeValueType SomeArray[ ArrayLength ];
    ...
};

how do you for example ceae a class that expands SomeClass that is SomeClass < 20, int >

is something like

class MyClass : SomeClass < 20, int > {...}; correct way?

Upvotes: 1

Views: 888

Answers (1)

Sarfaraz Nawaz
Sarfaraz Nawaz

Reputation: 361612

If you want private inheritance:

class MyClass : SomeClass < 20, int > //private by default!
{ 
    //...
};

If you want public inheritance:

class MyClass : public SomeClass < 20, int > 
{ 
    //...
};

Upvotes: 3

Related Questions