Fix stdlib interop#31
Conversation
gharveymn
left a comment
There was a problem hiding this comment.
Thanks for the valuable contribution! That was a bad oversight, so thanks for the unit test. Just a couple comments, but it looks pretty much good!
| const std::valarray<int> src_val { 9, 10, 11, 12 }; | ||
| gch::small_vector<int, 2> from_val; | ||
| from_val.assign (std::begin (src_val), std::end (src_val)); | ||
| CHECK (from_val.size () == src_val.size ()); | ||
| CHECK (std::equal (std::begin (src_val), std::end (src_val), from_val.begin ())); |
There was a problem hiding this comment.
I think std::valarray is the reason we can't test under constexpr here, but we should be able to test with std::vector and std::array. Perhaps we split them into files test-interop-array.cpp, test-interop-vector.cpp, test-interop-valarray.cpp, and only disable constexpr for test-interop-valarray.cpp?
There was a problem hiding this comment.
Agreed, I'll give that a shot. Sorry it took so long to get back to this, life caught up with me.
There was a problem hiding this comment.
No worries, life happens! If that doesn't work, could you rename this file to like test-std-interop.cpp or something? I'm not even nitpicking; it's because for some reason CLion has a bug or something and the targets don't show up with this file name (??? it's literally just when I have it as test-interop.cpp haha).
Hi, thanks for writing and publishing this awesome container. It's my preferred implementation of a vector with inline capacity.
I noticed some issues with conditions gated behind
GCH_STDLIB_INTEROPthat prevent compilation when enabled. I decided to fix them and write a test to confirm. I hope this is useful, it was for me lol.I didn't see any contribution guidelines, so I just tried to match the existing style and pointed my changes at
main.Let me know if you need any changes. I did run tests locally, but only for C++23.