dsharlet / array

C++ multidimensional arrays in the spirit of the STL
Apache License 2.0
198 stars 15 forks source link

Add tests that function-accepting functions do not copy the function. #41

Closed dsharlet closed 4 years ago

dsharlet commented 4 years ago

Verified this works by making part of the for_each_index implementation take the function by value, the build broke.

dsharlet commented 4 years ago

It looks like this breaks on the travis compiler (clang 7) but works on mine (clang 11). I'll have to try to make travis use a newer compiler before we can merge this, but I think it's a useful test to have.

dsharlet commented 4 years ago

Never mind that, clang 7 works fine, I just missed an actual copy!

dsharlet commented 4 years ago

FYI the changes in array.h weren't due to a new test failure, just wanted to be consistent that all callbacks are moved rather than captured by reference.

dsharlet commented 4 years ago

And thanks for the review!