I am getting a warning against my foreach loop that I'm "allocating an unneeded temporary container" but I have no idea what that means.
foreach(QString commandName, m_registeredResponseObjects.keys()) {
delete m_registeredResponseObjects[commandName];
};
Does this means the key() method is called on each iteration of the loop? I don't even see the container the warning is referencing...
foreach is a Qt macro defined as
template <typename T>
class QForeachContainer {
public:
inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
const T c;
int brk;
typename T::const_iterator i, e;
};