I thought I knew a little something from boost libraries that would help
me create a array of the following mess, but I came up empty.
I like converting long stuff like this to arrays, better code you see.
Can anyone help me converting this scenario:
int none(void)
{
for(size_t i=0; i<objects.size(); i++) {
switch(type){
case(ENUM_FA):
cout << endl << endl << "Object "<< i << ", recieved value: " << objects[i]->getValue<int8_t>(strPropertyName);
break;
case(ENUM_GH):
cout << endl << endl << "Object "<< i << ", recieved value: " << objects[i]->getValue<uint8_t>(strPropertyName);
break;
case(ENUM_YA):
cout << endl << endl << "Object "<< i << ", recieved value: " << objects[i]->getValue<int16_t>(strPropertyName);
break;
}
}
}
The template parameter also tells the return value. And I made this a lot shorter than it really is and made simplifications.


Sign In
Create Account


Back to top









