Implement LWG-4301: condition_variable{any}::wait{for, until} should take timeout by value by vmichal · Pull Request #5885 · microsoft/STL (original) (raw)
Notes and questions for review:
The behavior of most overloads stays identical, as they are all implemented in terms of other functions from the wait_{for, until} family, just with relative time converted to absolute or vice versa. In such cases, const & was bound to temporary objects and thus possible modifications by the user were ignored. For this reason, some changes are not testable; however, I have provided the tests for completeness.
I have kept all absolute/relative timeouts as const arguments. It appears that some parts of the STL adhere to the "const everything" guideline, so I hope it is valid.
While preparing the tests, I have found a difference in the behavior of MSVC and clang/GCC. Details are in #5859 (comment)