In below listed function, I am trying create a pointer to an std::pair object where I get a compilation error shown at the bottom of this message (The related line number has been marked in the code snippet below). Could you please tell me what's wrong with this code? Thanks.
void
XXX::addSubscription(EndPointAddr* ptrRequesterServiceAddr,
EndPointAddr* ptrRequestedServiceAddr)
{
//LINE 908 indicated in the g++ output starts HERE
std::pair<EndPointAddr*, EndPointAddr* > *thePair =
new std::make_pair(ptrRequesterServiceAddr, ptrRequestedServiceAddr);
mServiceSubscriptionsList.push_back(thePair);
}
Compilation Output:
../XXX.cpp:
In member function ‘void XXX::addSubscription(EndPointAddr*, EndPointAddr*)’:
../XXX.cpp:908:59: error: expected type-specifier
../XXX.cpp:908:59: error: cannot convert ‘int*’ to ‘std::pair<EndPointAddr*, EndPointAddr*>*’ in initialization
../XXX.cpp:908:59: error: expected ‘,’ or ‘;’