wrote:
> I am trying to create a template class, which would store a vector of
> references to objects of the same class.
Actually it's a vector of pointers.
> Like:
>
> template<class _core_t>
> class Neuron
> {
> ///snipped
>
> private:
> vector<Neuron<_core_t>*> _neighbors;
> }
;
>
> But the compiler (MSVS
says "missing storage class or type
> specifiers" when it tries to compile vector definition line.
>
> Where's the problem? Thanks!
Did you include <vector> ? Did you write "using std::vector"? Does this
code:
#include <vector>
template<class X> class A {
std::vector<A<X>*> v;
public:
A() {}
};
int main() {
A<int> ai;
}
compile for you? If not, the problem is in Redmond, Washington state,
U.S.A. But that's one you cannot fix. If it compiles (as it should),
the problem elsewhere in your code.
Victor