0

What's the working of first(a), second(b){ } in the code?

template <class T> class Pair { private: T first, second; public: Pair (T a, T b): first(a), second(b){ } T bigger(); }; template <class T> T Pair<T>::bigger() { // some code }

18th Aug 2017, 6:31 PM
Yash Sharma
Yash Sharma - avatar
1 Odpowiedź
0
initialization of variables before constructor is called, this is the only way to initialize const T& class variables
18th Aug 2017, 8:30 PM
Mindaugas Vinkelis
Mindaugas Vinkelis - avatar