Can't pass std::min to function, copy of std::min works
问题 Passing std::min to a function does not compile. I copied the libcpp declaration of std::min into my source file and it works. What's wrong with the std version? Same happens with clang and gcc. Tested on godbolt: https://godbolt.org/g/zwRqUA #include <thread> #include <algorithm> namespace mystd { // declaration copied verbatim from std::min (libcpp 4.0) template <class _Tp> inline constexpr const _Tp& mymin(const _Tp& __a, const _Tp& __b) { return std::min(__a, __b); } } int main() { std: