#include #include #include "BodyPartT.h" using namespace std; int main() { BodyPartT i{FIRST_BODY_PART}; size_t j; for(i=FIRST_BODY_PART; i != BodyPartT::NONE; ++i) { cout << "\t" << i << " = -" << -i << endl; } cout << endl; cout << setw(10) << ""; for(j = 0; j < 5; ++j) { cout << setw(10) << j; } cout << endl; cout << "A + table " << endl; for(i=FIRST_BODY_PART; i != BodyPartT::NONE; i++) { cout << setw(10) << i; for(j = 0; j < 5; ++j) { cout << setw(10) << i + j ; } cout << endl; } cout << endl; // check the ++ operators i = FIRST_BODY_PART; cout << " Starting i = " << i << endl; cout << " Doing ++i, should be the next value: " << ++i << endl; cout << " After ++i, should be same as above: " << i << endl; cout << " Doing i++, should be same as above: " << i++ << endl; cout << " After i++, should be next value: " << i << endl; cout << endl; cout << "Testing += " << endl; for (j = 0; i != BodyPartT::NONE; ++j) { i = FIRST_BODY_PART; cout << i << " += " << j ; i+= j; cout << " returns " << i << endl; } cout << endl << endl; // testing += in a chain BodyPartT a,b; i = FIRST_BODY_PART; cout << "Starting i = " << i << endl; a = b = i += 2; cout << "Doing a = b = i += 2 " << endl; cout << " a = " << a << endl; cout << " b = " << b << endl; cout << " i = " << i << endl; return 0; }