I
imutate
Hi,
I am migrating some std::vectors to use a template instead, but I get
an incomplete type error in a struct declaration.
#include <vector>
template < typename T >
class Vec : public std::vector< T > {
public:
Vec():Vec<T>() { }
Vec( int s ) : std::vector<T>(s) { }
T& operator[](int i) { return at(i); }
const T& operator[](int i ) const { return at(i); }
};
typedef Vec<double> vecdbl;
typedef Vec<vecdbl> matdbl;
#include "matvec.h"
// that is it above
typedef vecdbl memvec;
struct felt
{
...
memvec m; // <- incomplete type error
I am migrating some std::vectors to use a template instead, but I get
an incomplete type error in a struct declaration.
#include <vector>
template < typename T >
class Vec : public std::vector< T > {
public:
Vec():Vec<T>() { }
Vec( int s ) : std::vector<T>(s) { }
T& operator[](int i) { return at(i); }
const T& operator[](int i ) const { return at(i); }
};
typedef Vec<double> vecdbl;
typedef Vec<vecdbl> matdbl;
#include "matvec.h"
// that is it above
typedef vecdbl memvec;
struct felt
{
...
memvec m; // <- incomplete type error