[flat.map.modifiers] Remove redundancy in 'insert(sorted_unique, i, j)'#8214
Conversation
We can specify this in terms of the overload without the `sorted_unique` tag. That is consistent with how the equivalent functions in `flat_set` and `flat_multiset` are specified.
|
To give some more context: the wording for However, if the contents of the range [i, j) is already sorted then that step is a no-op. The implementation can elide that step, because it doesn't say the effects are equivalent to actually calling So specifying And [flat.set.modifiers] p8 and [flat.multiset.modifiers] p7 already take exactly this specification approach, just deferring to |
|
And [structure.specifications] p4 says that the Complexity: element here overrules the implied Complexity: that we would otherwise have from using "Effects: Equivalent to ..." |
|
Thanks for the explanations! Yes, it certainly seems technically correct, and a good deduplication. The more restrictive complexity may be a bit subtle, but then again, the Standard is not a tuturial, and implementers will know how to read this. |
We can specify this in terms of the overload without the
sorted_uniquetag. That is consistent with how the equivalent functions inflat_setandflat_multisetare specified.LWG asked for this in the telecon today.