What is the difference regarding memory allocation and efficiency between using a struct with two fields and a pair?
No difference in terms of memory allocation or efficiency. In fact, in the STL implementation I am using pair is defined as struct pair
struct pair