- changed status to wontfix
It is possible to construct a static vector with an initializer list of mismatching size
Example:
#include <blaze/Math.h>
#include <iostream>
int main(int, char **)
{
blaze::StaticVector<double, 4> v4 {1., 2., 3.};
std::cout << v4 << std::endl;
return 0;
}
Output:
( 1 )
( 2 )
( 3 )
( 0 )
Expected behavior: an exception is thrown or a compile-time error is generated.
Comments (4)
-
-
reporter Hello Klaus,
thanks for the explanation. I have missed this part in the documentation somehow.
-
reporter @eagle42 I just looked in the Wiki again (https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20Operations#!initializer-list-construction) and could not find the paragraph that you quoted. Can you please point me where it is?
-
Hi Mikhail!
I quoted from the complete documentation that you can download alongside the source code. Alternatively, you can also take a look at the Doxygen documentation in the source code itself. These sources are much more complete than the wiki or the tutorial. However, you make a good point. I will add this piece of information to both the wiki and the tutorial. Thanks a lot for the hint,
Best regards,
Klaus!
- Log in to comment
Hi Mikhail!
I sounds like you feel that you fell into a trap. We are sorry for that. However, the according
StaticVector
constructor works as documented:Thus from our point of view this is not a bug, but the code works as documented and specified. Please note that the semantics of this constructor are identical to the semantics of the constructors that accept arrays.
Since the constructor works as documented and since changing the behavior of the constructor could break existing code, we will not change the existing semantics.
Best regards,
Klaus!