Je travaille sur un programme où il est nécessaire d'insérer un QCPGraph
du QCustomPlot FrameWork dans un std::multimap
. Note: Je suis encore assez nouveau en C++. Cependant, je n'arrive pas à faire fonctionner cela, ce qui est vraiment frustrant.Impossible d'insérer QCustomPlot :: QCPGraph dans multiMap C++
Voici mon code:
ui->customPlot->addGraph();
/*
fill graph with some data
*/
QCPGraph *graph = ui->customPlot->graph(0);
std::multimap<int, std::pair<std::vector<double>, QCPGraph>, _comparator> myMap;
//just for demo
std::vector<double> vec;
vec.at(0) = 2.2;
myMap.insert(std::make_pair(1, std::make_pair(vec, graph)));
La dernière ligne me donne les erreurs du compilateur suivantes:
C:\path\mainwindow.cpp:178: Error: no matching function for call to 'std::multimap<int, std::pair<std::vector<double>, QCPGraph>, MainWindow::__comparator>::insert(std::pair<int, std::pair<std::vector<double>, QCPGraph*> >)'
myMap.insert(std::make_pair(1, std::make_pair(vec, graph)));
^
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\c++\bits\stl_multimap.h:524: Error: no type named 'type' in 'struct std::enable_if<false, void>'
template<typename _Pair, typename = typename
^
Je sais qu'il a probablement à voir avec les pointeurs et les types, mais je ne peux » t le comprendre. J'ai essayé de donner &graph
et (*graph)
à insérer, ce qui n'a pas fonctionné non plus. S'il vous plaît aider.
Merci! Je savais que c'était une erreur vraiment stupide! : O – masterBroesel