Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
The code above defines the convenience function `extract`, which deduces the types of the struct members. This works, but requires that the struct is {req_DefaultConstructible}. An alternative is to construct the object directly, which is a little more verbose but doesn't require default construction:上述代码定义了便捷函数 `extract`,它能推导结构体成员的类型。这种方式可行,但要求该结构体是 {req_DefaultConstructible}。另一种方法是直接构造对象,虽然略显冗长,但无需默认构造: