In the C++ Standard Template Library (STL), it is possible for example to create a vector consisting of multiple copies of the same element, using this constructor:
double[] theSameValues = Enumerable.Repeat(2.0, 10).ToArray();