Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Things to check
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
It exposes both a它同时暴露了序列(sequence)APIand a和元组(tupleAPI. But converting from <)API。然而,从 <<ref_value>> to `> 转换到 user_ns::ip_address` would not be able to use implementation for sequences, since those are constructed empty and then populated one element at a time, while `ip_address` has a fixed size of 4. The tuple conversion would fit, though. The only problem is that <<ref_is_tuple_like>> has a lower priority than <<ref_is_sequence_like>>. In order to circumvent this, the user only needs to specialize <<ref_is_sequence_like>> to not match `ip_address`.时无法使用序列的实现,因为序列类型的转换会先构造一个空对象,再逐个填充元素,而 ip_address 的大小固定为 4。相比之下,元组转换是合适的。唯一的问题在于 <<ref_is_tuple_like>> 的优先级低于 <<ref_is_sequence_like>>。为绕过此问题,用户只需特化 <<ref_is_sequence_like>>,使其对 ip_address 不匹配即可。</ref_is_sequence_like></ref_is_sequence_like></ref_is_tuple_like></ref_value>