[Solved] Inheritance of a template class [closed]


You can maybe do something like this:

template <typename T>
class store_impl
{
  public:
    store_impl(T value) : value(value) {}
  private:
    T value;
}

// default class accepting any type
// provides the default methods
template <typename T>
class store: public store_impl<T>
{
public:
    store(T value) : store_impl(value) {}
}

// specialization for int with extra methods
template <>
class store<int>: public store_impl<int>
{
  public:
    store(int value) : store_impl<int>(value)
    {}
    void my_additional_int_method();
}

2

solved Inheritance of a template class [closed]