#include <vector>
std::vector<A> row {};
std::vector<std::vector<A>> matrix {};
for ( size_t i = 0; i < rowsAmount; ++i)
{
for( size_t j = 0; j < colsAmount; ++j)
{
row.push_back(objectA);
}
matrix.push_back(row);
row.clear();
}