void
VectorToVariableLengthVector();
void
VariableLengthVectorToVector();
int
main()
{
v.SetSize(2);
v[0] = 1;
v[1] = 2;
std::cout << v << std::endl;
for (unsigned int i = 0; i < v.Size(); ++i)
{
std::cout << v[i] << " ";
}
std::cout << std::endl;
VectorToVariableLengthVector();
VariableLengthVectorToVector();
return EXIT_SUCCESS;
}
void
VectorToVariableLengthVector()
{
std::cout << "VectorToVariableLengthVector()" << std::endl;
FixedVectorType fixedLengthVector;
fixedLengthVector[0] = 1;
fixedLengthVector[1] = 2;
VariableVectorType variableLengthVector;
variableLengthVector.
SetSize(fixedLengthVector.Size());
variableLengthVector.SetData(fixedLengthVector.GetDataPointer());
std::cout << "variableLengthVector: " << variableLengthVector << std::endl;
}
void
VariableLengthVectorToVector()
{
std::cout << "VariableLengthVectorToVector()" << std::endl;
VariableVectorType variableLengthVector;
variableLengthVector[0] = 1;
variableLengthVector[1] = 2;
FixedVectorType fixedLengthVector;
for (unsigned int i = 0; i < FixedVectorType::GetVectorDimension(); ++i)
{
fixedLengthVector[i] = variableLengthVector[i];
}
std::cout << "fixedLengthVector: " << fixedLengthVector << std::endl;
}