wanghenshui / cppweeklynews

c++中文周刊
https://wanghenshui.github.io/cppweeklynews/
Creative Commons Zero v1.0 Universal
452 stars 22 forks source link

144 draft #86

Closed wanghenshui closed 10 months ago

wanghenshui commented 10 months ago

std::allocator_traits::propagate_on_container_swap::value

If std::allocator_traits::propagate_on_container_swap::value is true, then the allocators are exchanged using an unqualified call to non-member swap. Otherwise, they are not swapped (and if get_allocator() != other.get_allocator(), the behavior is undefined).

https://en.cppreference.com/w/cpp/container/vector/swap

https://godbolt.org/z/41Tz1sKdq

wanghenshui commented 10 months ago

https://www.jeremyong.com/c++/2023/12/24/cpp20-gamedev-naughty-nice/