考虑一个类:
struct mystruct { constexpr operator char() {return x;} signed char x; };
和一个像这样的操作:
mystruct m; m.x = /* something at runtime */ int i = 3 * m + 45ULL * m;
编译器是否能够跳过临时转换char并直接转换为表达式中m所需的类型3 * m + 45ULL * m?
char
m
3 * m + 45ULL * m