-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add escape hatch for _USE_STD_VECTOR_ALGORITHMS #1751
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
Add escape hatch for _USE_STD_VECTOR_ALGORITHMS #1751
Conversation
Unwrap line that fits in 120 columns.
|
It seems like a test with a comment inside describing this specific-to-windows situation would make sense? Is there any reason we can't provide the actual vectorized versions in a static lib for them or similar? |
|
@BillyONeal (oops, approved before reading your comment)
Yes, that would be easy to test (I'm not too concerned about test coverage since we inherently exercise the "off" codepath for ARM/ARM64, but the preprocessor logic may as well be tested). I can push changes.
Supporting an extra lib only used by Windows, in perpetuity, sounds like something we shouldn't sign up to do. I would be more interested in refactoring the intrinsic headers to make this header-only (the only reason we aren't is because the necessary files are enormous). |
|
FYI @CaseyCarter I pushed a test change after you approved. |
Supporting an extra lib seems cheaper than supporting an extra macro to me.
The other reason it is out of line is Header only is always worse for throughput; making all users pay because Windows did an unsupported thing doesn't seem like the right tradeoff to me 🤷♂️. |
|
Thanks for implementing this escape hatch! 🚪 🏃 😹 |
|
Thanks for merging this (in both repos)! |
There are projects in Windows that are using the STL in a header-only capacity, but using vector algorithms requires that the .lib be linked in. This change allows
_USE_STD_VECTOR_ALGORITHMSto be manually set by the project in order to opt-out of requiring this .lib dependency. These projects used to specify/D_HAS_IF_CONSTEXPR=0to avoid this dependency, but that has been removed and using/D_USE_STD_VECTOR_ALGORITHMS=0is more targeted towards their actual desire anyway.