I am trying to do the following
std::map <int, std::vector<std::vector<double> > > mapof2Dvectors;
std::vector<std::vector<double> > temp;
for(int u=0; u<size1; u++){
temp.push_back( std::vector<double> ());
temp[u].push_back(somedoublehere);
}
mapof2Dvectors[key].push_back(temp);
It fails when I try to compile with “error: Semantic Issue: No viable conversion from ‘std::vector >’ to ‘const value_type’ (aka ‘const std::vector >’)”
Any help would be most appreciated.
Might I suggest using some typedefs? The error is actually quite simple.
Now you’re trying to do this:
Does this help spot the problem? You’re basically trying to push_back Vectors2d into a Vectors2d object when Vectors2d::push_back expects a Vectors1d object. It should be this according to your types:
Or faster:
A simple analogy of your error is like this:
So I’m not sure what you’re after, but it’s probably going to be either this:
Or this: