Skip to content

_LEGACY_CODE_ASSUMES_QUEUE_INCLUDES_ALGORITHM macro documentation #5096

Closed Answered by CaseyCarter
bsmadhukannan asked this question in General
Discussion options

You must be logged in to vote

The proper fix is to #include <algorithm> in any affected source files. The macro is a mechanism to allow people to easily build code they don't own and can't easily update. For code you control, it's better to #include <algorithm> to ensure the definition of std::sort is visible at the problem site. If the problem is in a third-party library header, you'll need to put the algorithm include before including that header.

We don't typically go out of our way to document temporary workaround "escape hatch" macros like this. They're not intended to be long-term useful features, but to ease the transition when we make potentially-breaking changes.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bsmadhukannan
Comment options

Answer selected by CaseyCarter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants