Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create the following header file in c++ ////Main File////////////// #include #include #include #include using namespace std; using namespace teaching_project; // Place stand-alone function in unnamed
Create the following header file in c++
////Main File//////////////
#include
#include #include #include using namespace std; using namespace teaching_project;
// Place stand-alone function in unnamed namespace. namespace { void TestPart1() { Points2 a, b; // Two empty Points2 are created. cout
void TestPart2() { Points2 a, b; cout
} // namespace
int main(int argc, char **argv) { TestPart1(); TestPart2(); return 0; } ////////end main file//////////////////////////
///////point2 class///////////////
ifndef CSCI335_HOMEWORK1_POINTS2_H_ #define CSCI335_HOMEWORK1_POINTS2_H_ #include#include #include #include #include namespace teaching_project { // Place comments that provide a brief explanation of the class, // and its sample usage. template class Points2 { public: // Default "big five" -- you have to alter them for your assignment. // That means that you will remove the "= default" statement. // and you will provide an implementation. // Zero-parameter constructor. // Set size to 0. Points2() = default; // Copy-constructor. Points2(const Points2 &rhs) = default; // Copy-assignment. If you have already written // the copy-constructor and the move-constructor // you can just use: // { // Points2 copy = rhs; // std::swap(*this, copy); // return *this; // } Points2& operator=(const Points2 &rhs) = default; // Move-constructor. Points2(Points2 &&rhs) = default; // Move-assignment. // Just use std::swap() for all variables. Points2& operator=(Points2 &&rhs) = default; ~Points2() = default; // End of big-five. // One parameter constructor. Points2(const std::array
///////////end point2 class////////////////////
Implement the "The Big-Five". Add the output stream a, b; // Two empty Points are created. cout a point2{{7, 10}}; Points2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started