There are some differences:
-
std::tupleis not required by the standard to ever be standard-layout. Everystd::pair<T, Y>is standard-layout if bothTandYare standard-layout. -
It’s a bit easier to get the contents of a
pairthan atuple. You have to use a function call in thetuplecase, while thepaircase is just a member field.
But that’s about it.