为什么小于运算符接受不同类型的参数而std :: min不是?

Kam*_*mel 8 c++ templates overloading

#include <iostream>

int main(){
    int a = 1;
    long long b = 2;
    std::cout<<(a<b);
    std::cout<<std::min(a, b);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)
> In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
>                  from /usr/include/c++/4.8/ios:40,
>                  from /usr/include/c++/4.8/ostream:38,
>                  from /usr/include/c++/4.8/iostream:39,
>                  from sum_to.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class
> _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
>      min(const _Tp& __a, const _Tp& __b, _Compare __comp)
>      ^ /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed: sum_to.cpp:7:29:
> note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and
> ‘long long int’)
>      std::cout<<std::min(a, b);

---
Run Code Online (Sandbox Code Playgroud)

感谢chris函数重载过后的注释 模板参数推断不会将转换考虑在内.一个模板参数不能匹配两种类型

因此std::min失败.

为什么<会工作?

Que*_*tin 7

因为内置<应用数字促销,而模板参数推销则不适用.