[PATCH] Improve std::fill for vector<bool>

François Dumont frs.dumont@gmail.com
Wed May 6 18:46:41 GMT 2020


Hi

I am not clear about current stage so I am proposing this trivial patch 
to find out if we are back in stage 1.

This patch extend the overload so that it is used even when 
_GLIBCXX_DEBUG mode is activated.

             * include/bits/stl_algobase.h (struct _Bit_iterator): New 
declaration.
             (std::__fill_a1(_Bit_iterator, _Bit_iterator, const 
bool&)): Likewise.
             * include/bits/stl_bvector.h (__fill_bvector): Move outside
             _GLIBCXX_STD_C namespace.
             (fill(_Bit_iterator, _Bit_iterator, const bool&)): Likewise 
and rename
             into...
             (__fill_a1): ...this.
             * testsuite/25_algorithms/fill/bvector/1.cc: New.

Tested under Linux x86_64 normal and debug modes.

Ok to commit ?

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bvector_fill.patch
Type: text/x-patch
Size: 5390 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200506/84893802/attachment.bin>


More information about the Gcc-patches mailing list