TMMint Sort;
for(int i=1;i<StringGrid2->RowCount;i++)
{
int value = StrToInt(StringGrid2->Cells[3][i]); // <---
Sort.insert(TMMint::value_type(value, StringGrid2->Cells[1][i]));// Ok
}
Could not find a match for 'pair<const int,AnsiString>::pair(AnsiString,AnsiString)'
The code you showed originally is perfectly fine, so I don't know why the compiler would think you are trying to pass an AnsiString in the value_type constructor's 1st parameter when you are clearly passing an int instead. But, you can try using the std::make_pair() function instead of constructing the value_type directly: