[#BloombergLP-bdlc-BitArray-swapBits] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/BitArray.adoc[BitArray]::swapBits :relfileprefix: ../../../ :mrdocs: Efficiently exchange the values of the bits at the specified `index1` and `index2` indices. The behavior is undefined unless `index1 < length()` and `index2 < length()`. == Synopsis Declared in `<bdlc_bitarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swapBits( std::size_t index1, std::size_t index2); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#