Compilation Error:
test.cpp: In the function 'int main (): test.cpp: 15: 19: error: calling overloaded' min (int &, long long int &) is ambiguous sob <
But why is not long long min(long long a, long long b) not displayed automatically?
Does auto casting int a to long long a not degrade quality?
This one will work without error compilation.
#include <iostream>
In the file included in / usr / include / c ++ / 4.8 / algorithm: 62: 0, from test.cpp: 2: / usr / include / c ++ / 4.8 / bits / stl_algo.h: 4226: 5: note: template _Tp std :: min (std :: initializer_list <_Tp> _Compare) min (initializer_list <_Tp> __l, _Compare __comp) ^ / usr / include / c ++ / 4.8 / bits / stl_algo.h: 4226: 5: note: failure template / replacement argument: test.cpp: 8: 29: note:
mismatched types 'std :: initializer_list <_Tp> and' int std :: soy <
c ++ overloading
Kamel
source share