Hi Jeff,
void resize(size_type _Newsize, _Ty _Val)
{ // determine new length, padding with _Val elements as needed
if (size() < _Newsize)
_Insert_n(end(), _Newsize - size(), _Val);
else if (_Newsize < size())
erase(begin() + _Newsize, end());
I don't see how Class B is abstract??? I'm used to blowing up in ATL
code, not STL code.
If B is an ATL implementation of a COM object, it *is* abstract. ATL adds
the concrete IUnknown implementation in the CComObject family of classes,
which are used for creation of objects.
You don't see CComObject much, but it's a part of the factory
implementation in ATL, and you can use it directly to create instances of
your objects, if you have source access to the implementation class:
CComObject<CMyImplClass>* p = 0;
CComObject<CMyImplClass>::CreateInstance(&p); // refcount = 0
I guess you could make a vector of CB pointers, rather than values, and
then instantiate and manage them as CComObjects, but I guess the easiest
is to save a CAdapt<CComPtr<IB>> in your vector, so resource management is
taken care of.
--
Best Regards,
Kim Gr?sman