I have the following scenario:
header.h:
class A
{
public:
class B; // incomplete type
private:
// is never used outside of source file for A
std::vector<B> vector_of_bs; // template
}
source1.cpp:
class A::B {}; // defined here
All is good until here. Now if I want to use class A
elsewhere it doesn't work:
source2.cpp
: uses class A and doesn't compile with
vector(721): error C2036: 'A::B *' : unknown size
while compiling class template member function 'std::vector<_Ty> &std::vector<_Ty>::operator =(const std::vector<_Ty> &)'
in VS2010. How can I link against the template specialisation of std::vector in source1.o?
I also need to use this with declspec(_dllimport)
...