_LEGACY_CODE_ASSUMES_QUEUE_INCLUDES_ALGORITHM macro documentation #5096
-
When I compiled my code against 14.42.34433, i got compilation error "error c3861: 'sort': identifier not found" along with other errors saying sort is not part of standard or something... found that the commit for had the macro (in title) added and it seems it is not properly documented... now i need to update code vcxproj file to include this macro. is anyone else facing this issue? any idea how to resolve this in any other manner. I saw the was changed for this in June earlier this year.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The proper fix is to 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. |
Beta Was this translation helpful? Give feedback.
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 ofstd::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.