Error: no matching function for call to ‘check_and_cast(cModule*&)’
I am trying to use the current position from another module "mobility" with n class type MassMobility.
cModule* parentmod = getParentModule(); cModule* mobilitymod = parentmod->getParentModule()->getSubmodule("mobility"); EV<<"Current module is "<<mobilitymod->getFullName() <<endl; MassMobility* mobility = check_and_cast<MassMobility *>(mobilitymod); mobility->getCurrentPosition();
I am getting compile time error :- no matching function for call to ‘check_and_cast(cModule*&)’
. But still I am able to get the functions from the mobility object as shown in last line. Can anybody please suggest me how can I correct it.