__compressed_pair is a pre-[[no_unique_address]] way to ensure that
empty classes don't unnecessarily increase object sizes. It also
unfortunately bloats program sizes in debug builds due to added program
information. This commit replaces __compressed_pair with the
attribute, which reduces debug build sizes.
Below is a size benchmark of Clang built in debug mode with and without
__compressed_pair, using bloaty.
FILE SIZE VM SIZE -------------- -------------- +0.0% +1.94Ki +0.0% +1.94Ki .rodata +0.0% +248 +0.0% +248 .dynstr +0.2% +28 [ = ] 0 .debug_loclists -0.5% -1 [ = ] 0 .debug_aranges [DEL] -56 [DEL] -56 [LOAD #2 [R]] -0.2% -12.5Ki [ = ] 0 .debug_abbrev -1.3% -176Ki [ = ] 0 .debug_rnglists -2.5% -207Ki -2.5% -207Ki .eh_frame_hdr -1.2% -409Ki [ = ] 0 .debug_addr -0.8% -523Ki [ = ] 0 .debug_str_offsets -2.5% -622Ki [ = ] 0 .symtab -2.5% -830Ki -2.5% -830Ki .eh_frame -0.7% -1.06Mi -0.7% -1.06Mi .text -1.0% -1.51Mi [ = ] 0 .debug_line -3.2% -4.24Mi [ = ] 0 .strtab -1.5% -5.99Mi [ = ] 0 .debug_info -3.8% -10.3Mi [ = ] 0 .debug_str -1.9% -25.8Mi -0.9% -2.07Mi TOTAL
Shouldn't this follow the swap protocol using std::swap.