#include "polygon.h" #include "polygon.h" // multiple include should work #include int main() { std::cout << "Testing the Polygons." << std::endl; Polygon p1{3, 4}; std::cout << p1 << std::endl; Polygon p2{2, 6}; p2 += 7; std::cout << p2 << std::endl; std::cout << p2 + 9 << std::endl; std::cout << 1 + p2 << std::endl; try { Polygon p3{ 7, 5 }; p3 += 0; p3 += 8; } catch(std::invalid_argument const& e) { std::cout << e.what() << std::endl; } try { Polygon p4{ 7, 5 }; p4 += 0; } catch(std::invalid_argument const& e) { std::cout << e.what() << std::endl; } { // Polygon p5{ 7 }; // Should not compile! } // Just to produce same output as other test function std::cout << "Bad polygon: To few sides" << std::endl; }