Skip to content

Conversation

@Novare
Copy link

@Novare Novare commented Jan 15, 2020

Fixes "error C2131: expression did not evaluate to a constant" during compilation.

This error is caused by the lambda function in gather.cpp both in lines 44 to 66 and 105 to 137 using a variable length array "vals[K]". Regular C-Style Arrays need to be initialized with a constant expression that can be evaluated during compilation. Replacing this with a std::vector<scalar_t> initialized with K zeros solves the problem.

@codecov-io
Copy link

codecov-io commented Jan 15, 2020

Codecov Report

Merging #99 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #99   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines         143    143           
=====================================
  Hits          143    143

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b51c22a...1eabf7f. Read the comment docs.

@Novare Novare changed the title fix: use std::vector for dynamically sized array in gather.cpp fix: use std::vector for dynamically sized array in gather.cpp and segment.cpp Jan 15, 2020
@Novare
Copy link
Author

Novare commented Jan 15, 2020

I also fixed this in segment.cpp as the error was identical there.

@rusty1s
Copy link
Owner

rusty1s commented Jan 15, 2020

Great. Thank you!

@rusty1s rusty1s merged commit d88411f into rusty1s:master Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants