Question: Consider this program: #include Sequence.h // class template from problem 1 class Coord { public: Coord(int r, int c) : m_r(r), m_c(c) {} Coord() :
Consider this program:
#include "Sequence.h" // class template from problem 1 class Coord { public: Coord(int r, int c) : m_r(r), m_c(c) {} Coord() : m_r(0), m_c(0) {} double r() const { return m_r; } double c() const { return m_c; } private: double m_r; double m_c; }; int main() { Sequence si; si.insert(50); // OK Sequence sc; sc.insert(0, Coord(50,20)); // OK sc.insert(Coord(40,10)); // error! } Explain in a sentence or two why the call to the one-argument form of Sequence
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
