class cellPair
{
public:
vector<int> pair;
int size;
cellPair(const int& a) { pair.push_back(a); size=static_cast<int>( pair.size() ); }
};
int main()
{
map<int, cellPair> aMap;
aMap[1]=cellPair(3);
aMap[1]=cellPair(2);
}
I think the aMap.second.size should ==2, but it still have 1 value, the second value did not push back to the pair.
Could you please give me some suggestions?
ztdep -8 Junior Poster in Training
alwaysLearning0 39 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.