On Mon, Oct 7, 2013 at 12:22 PM, Jonathan Wakely <jwakely....@gmail.com> wrote:
> because that turns into the equivalent of a std::memset() on integers.

Here I catch your idea. But think about the following example:
_M_exists.size() == 1000, but only 3 of the elements are true. Now
what I intend to do is assigning these 3 elements to false, rather
than reseting the whole vector. Is this called "pay for what you get"?

The ideal solution could be:

void _M_clear() {
    if (__exists.size() < _BaseT::size() * CPU_WORD_LENGTH * some_factor)
        clear_one_by_one();
    else
        reset_them_all();
}


-- 
Tim Shen

Reply via email to