In continuation to my question here:
I know that after a forward deceleration such as
class Foo;
I can declare a variable as Foo*
or Foo&
, but not Foo
, and if I have a templated class Bar<T>
that only has T*
and T&
inside it then the same rule would apply to Bar<Foo>
(i.e. I would only need a forward deceleration in order to write Bar<Foo>
).
My question is whether the STL class guarantee such a thing, that they only contain references and pointers to the template type. I tested this:
class A;
std::vector<A> b;
with the VS2010 implementation of the STL and it compiled, but I don't know if this is true for all STL containers, nor if this is just the way the MS implementation of the STL is or if it is part of the standard.