Skip to content

Instantly share code, notes, and snippets.

@raghunayak
Last active March 26, 2021 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raghunayak/f32caa9ca952c4cda7f9c6e58145fc6a to your computer and use it in GitHub Desktop.
Save raghunayak/f32caa9ca952c4cda7f9c6e58145fc6a to your computer and use it in GitHub Desktop.
Nested QMap with std::array
#include <QMap>
#include <QString>
#include <QDebug>
#include <array>
int main(int argc, char *argv[])
{
enum Gnss { Phoenix, Serell };
enum ImuType { VH301, VD231, Seldov };
static const QMap<Gnss, QMap<ImuType, std::array<double, 3>>> gnssImuParameters {
{ Gnss::Phoenix, {
{ ImuType::VH301, {1.11, 1.22, 1.33} },
{ ImuType::VD231, {2.11, 2.22, 3.33} },
}
}, { Gnss::Serell, {
{ ImuType::Seldov, {3.11, 3.22, 3.33} }
}
}
};
for (auto i : gnssImuParameters.keys()) {
for (auto j : gnssImuParameters[i].keys()) {
qDebug() << i << j
<< gnssImuParameters[i][j][0]
<< gnssImuParameters[i][j][1]
<< gnssImuParameters[i][j][2];
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment