The type inference picks a type that works for all outcomes of the if expression.
类型推断选择了一个满足if表达式所有结果的类型。
When this macro executes, it will match the my-if expression up to the template like this (in other words, matching a macro invocation to a macro definition pattern).
在这个宏执行时,它按照以下形式将my - if表达式与模板进行匹配(换句话说,将宏调用与宏定义模式进行匹配)。
This case only succeeds if the accompanying guard expression (the if expression that follows it) succeeds, which will only happen for the first Person but not the second.
这个case只有在同时提供的起保护作用的表达式(跟在它后边的if表达式)成功时才会成功,但只有第一个Person会这样,第二个就不会了。
This case only succeeds if the accompanying guard expression (the if expression that follows it) succeeds, which will only happen for the first Person but not the second.
这个case只有在同时提供的起保护作用的表达式(跟在它后边的if表达式)成功时才会成功,但只有第一个Person会这样,第二个就不会了。
应用推荐