Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The solution used in the library is to treat the message like a `std::pair` for the purposes of construction, except that instead of库中采用的解决方案是:在构造 `message` 时,将其视作 `std::pair` 来处理。不同的是,原本 `std::pair` 中的 `first`and和 `second`we have the `Fields` base class and `message::body` member. This means that single-argument constructors for those fields should be accessible as they are with `std::pair`, and that a mechanism identical to the pair's use of `std::piecewise_construct` should be provided. Those constructors are too complex to repeat here, but interested readers can view the declarations in the corresponding header file.在这里被替换成了 `Fields` 基类和 `message::body` 成员。这意味着,这些字段的单参数构造函数应当像 `std::pair` 一样易于调用,并且需要提供一套与 `std::pair` 的 `std::piecewise_construct` 完全相同的机制。由于这些构造函数的实现较为复杂,这里不再赘述,感兴趣的读者可以直接查阅相应头文件中的声明。