Den 26-10-2017 kl. 19:59 skrev Joaquin M López Muñoz via Boost:
El 26/10/2017 a las 17:08, Thorsten Ottosen escribió:
But the policy does not know size() unless we pass it that too.
Yes, it need access the size and front and back capacity. If the policy is used via CRTP (which is what I have in mind but admittedly didn't make clear) then this info can be retrived by the policy through devector's public interface. Other designs would require that the info be passed as additional arguments to the member functions.
Regardless, We also need to see what to test. I have tried to improve the test measurements, see attached code. It tests insertion without buffer expansion. Do we want one that doesn't reserve memory too, inserting at a random position? And? kind regards Thorsten