How about
template<template<typename T> class V>
struct base_matrix
{
V<double> data;
...
virtual void add(...) = 0;
};
struct host_matrix : base_matrix<host_vector>
{
host_matrix() { ... }
...
void add(...) { ... }
};
If you can't use a template template, then like this:
template<typename V>
struct base_matrix
{
V data;
...
virtual void add(...) = 0;
};
struct host_matrix : base_matrix<host_vector<double>>
{
host_matrix() { ... }
...
void add(...) { ... }
};