Why is `std::pair ` not designed to be trivially copyable? (stackoverflow.com)stack
19 points by xmllmx in stackoverflow.com · 2h ago · stack
If std::is_trivially_copyable_v<std::pair<int, int>> is true, then most implementations of std::vector can use the fastest std::memcpy to perform element relocations, providing a significant performance benefit. Why is std::pair<int, int> not designed to be trivially copyable?