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::insert causes at least one compilation error. (Notice that the call to the one-argument form of Sequence::insert is fine, as is the call to the two-argument form of Sequence::insert.) Don't just transcribe a compiler error message; your answer must indicate you understand the ultimate root cause of the problem and why that is connected to the call to Sequence::insert.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!