In "Vector<Number>::add(..)", a pointer to the first element of the
std::vectors was gotten, for instance, by &indices[0], which implies
that the first element of the vector exists. Therefore, if an empty
vector was used, while this works on gcc, this would result in a crash
when using Visual Studio. In this case, the pointer should be gotten by
std::vector::data(). This fix changes de former by the latter access form.
{
Assert (indices.size() == values.size(),
ExcDimensionMismatch(indices.size(), values.size()));
- add (indices.size(), &indices[0], &values[0]);
+ add (indices.size(), indices.data(), values.data());
}
{
Assert (indices.size() == values.size(),
ExcDimensionMismatch(indices.size(), values.size()));
- add (indices.size(), &indices[0], values.val);
+ add (indices.size(), indices.data(), values.val);
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams