constructors-point-rectangle/more-about-constructs/prog.cc - Attempting Point constructions. | Lecture 4 - slide 7 : 40 Program 3 |
// Attempting construction of points. #include <iostream> #include "point.h" using namespace std; int main(){ Point p1{1, 2}, p2{3}, p3{p1}, // Error: No copy constructor. p4, p5, p6; p4 = 4.0; // Error: explicit Point(double) cannot be used in implicit type conversion. p5 = static_cast<Point>(4.0); // OK p6 = Point(4.0); // OK // use of points here // ... }