|
Boost : |
Subject: Re: [boost] [devector] optimum growing/insertion policy
From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2017-11-02 18:10:27
Den 18-10-2017 kl. 16:37 skrev Joaquin M López Muñoz via Boost:
> Writing this has led me to realize that a generic growing/insertion
> policy also
> needs a member function to indicate what to do on erasure:
>
> Â struct free_space{std::size_t back,front;};
> Â free_space query_for_insertion(std::size_t pos,std::size_t n);
> Â free_space query_for_erasure(std::size_t pos,std::size_t n);
I don't get how we know if we have a push_back or push_front. So I think
we should use
free_space query_for_middle_insertion(std::size_t pos,std::size_t n);
free_space query_for_back_insertion(std::size_t pos,std::size_t n);
free_space query_for_front_insertion(std::size_t pos,std::size_t n);
so we have clear control over inserts/push to either end.
kind regards
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk