Right now I have a switch statement that takes in an input and choose one of the following actions:
Option 1
for(; i < queue_size; ++i)
{
prepared->setString(i+1, queue.at(i).model);
}
Option 2
for(; i < queue_size; ++i)
{
prepared->setString(i+1, queue.at(i).manufacturer);
}
Option 3
for(; i < queue_size; ++i)
{
prepared->setString(i+1, queue.at(i).name);
}
In PHP, you would be able to do the same doing something like this:
$queue[i][$member];
$member could then be set to "name", "manufacturer", etc.
Is there any way to do something similar or more robust in C++?
Thanks in advance for any help/suggestions!