-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Shape1 #480
Comments
I always hated these cases where the compiler misinterprets an "obvious" syntax for some other syntax; C++ is simply too complex… I would probably work around that by instantiating a PS: Tip of the day for getting English messages for bug reports etc.: Prefix your command (here |
Instantiating a int length = 43;
Shape1 shapedr(length);
MultiArray<1, float> shape1dr(shapedr);
cout << "shape1dr.shape() = " << shape1dr.shape() << "." << endl; I've edited my post to include the comment you proposed.
Well, I am using Visual Studio here ... Friedrich |
While acquainting myself with Vigra, I stumbled upon some problem with 1-dimensional MultiArrays.
I am trying to initialise
MulitArray<1, float>
withShape1(<length>)
.<length>
is either a plain number, or the name of an integer variable.The initialisation works fine when using a literal number, but fails in the end when using a variable.
I am providing below a small code to reproduce the behaviour.
The compiler in use is VS 2019, using the VS 2015 (v140) toolset, with target platform 10.0.18362.0.
In the code below, the second paragraph in
int main()
is the most relevant. Both initialisation ofMultiArray<1, float>
compile fine, also the one referencing a non-existing variable namedxyz
. However, the commented-out code path in the middle of the paragraph does not compile. Notice also that the two initialisation lines yield warnings (these are in German):Telling (approx.): Function with prototype has not been called (was meant a variable definition?)
Things are working as expected with two-dimensional MulitArrays, as demonstrated in the last two paragraphs of the
main
function. Also the first paragraph using a verbatim number as argument forShape1
yields no surprises.This is with Vigra-1.11.1; I tried also with a github version from 2020-08-12, ending up with the same results.
The test code is:
The text was updated successfully, but these errors were encountered: