range-loop-detach warns about temporaries
warning: c++11 range-loop might detach Qt container (QJsonArray) [-Wclazy-range-loop-detach]
for (const auto elem : (*answerIt).toArray()) {
^
std::as_const
/qAsConst
don't work in that case and apparently there's nothing wrong about being detached in such cases?