Challenge 2: A Pair Class Template With sum() — Possible Solution ==================================================================== #include template class Pair { public: T first; T second; Pair(T a, T b) : first(a), second(b) {} T sum() { return first + second; } }; int main() { Pair intPair(3, 4); Pair doublePair(2.5, 1.5); std::cout << intPair.sum() << std::endl; std::cout << doublePair.sum() << std::endl; return 0; } Output: 7 4 WHY THIS WORKS AS AN ANSWER ------------------------------ Pair and Pair are two distinct instantiations of the same class template -- exactly the chapter's own Box pattern, here extended with a real method. Each instantiation genuinely gets its own compiled class with first/second of the correct concrete type, and sum() correctly adds either two ints or two doubles depending on which instantiation is being used.