Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
Code which accesses the fields has to laboriously mention the `fields` member, so we'll not only make `header` a base class but we'll make a quality of life improvement and derive the header from the fields for notational convenience. In order to properly support all forms of construction of [*Fields] there will need to be a set of suitable constructor overloads (not shown):访问字段的代码不得不反复显式引用 `fields` 成员,这显得十分繁琐。因此,我们不仅将 `header` 作为基类,还会为了书写便利进行一项优化:让 `header` 直接从 `fields` 派生。为了能够正确支持对 [*Fields] 的所有构造形式,还需要提供一组合适的构造函数重载(此处未展示):``` /// An HTTP request header template<class Fields> struct header<true, Fields> : Fields {