using user-defined conversions with implicit conversions in comparisons

后端 未结 2 1679
小鲜肉
小鲜肉 2021-02-19 07:09

I am struggling to understand why the following code does not allow an implicit conversion to occur.

#include 
using namespace std;

struct HasConv         


        
2条回答
  •  时光取名叫无心
    2021-02-19 07:25

    http://en.cppreference.com/w/cpp/language/template_argument_deduction#Implicit_conversions

    Type deduction does not consider implicit conversions (other than type adjustments listed above): that's the job for overload resolution, which happens later.

提交回复
热议问题