Instead of writing every character directly into the container by using
a back_insert_iterator the data is buffered in an array. This buffer
is then inserted to the container by calling its insert member function.
Since there's no guarantee every container's insert behaves properly
containers need to opt-in to this behaviour. The appropriate standard
containers opt-in to this behaviour.
This change improves the performance of the format functions that use a
back_insert_iterator.
Depends on D110495
The machinery to __enable_insertable in a container right now is like 16 lines. You could get it down to 1 line, and no helper headers, and C++11-compatible, if you changed this to
Then the containers (vector, deque, string, list, etc.) would just have to say e.g.
without any extra headers or ifdef-guards or anything.