Deduce the return type of queue::emplace and stack::emplace by StephanTLavavej · Pull Request #4980 · microsoft/STL (original) (raw)

Followup to #4963. Fixes VSO-2261359 / AB#2261359 "[VCPKG] rocksdb installation failed with error C2440":

stack(125): error C2440: 'return': cannot convert from 'void' to 'rocksdb::TransactionBaseImpl::SavePoint &'

As the container adaptors are required to use decltype(auto) in C++17, the "warning C5046: Symbol involving type with internal linkage not defined" in the convertible_to_any scenario and the ODR violation when mixing C++14 and C++17 TUs are unavoidable.

In <xmemory>, I'm lexicographically sorting _ADAPTOR_EMPLACE_RETURN before _CONTAINER_EMPLACE_RETURN, which will avoid an adjacent-add conflict with #4975 adding _LIST_REMOVE_RETURN (also in lex order).