-
December 7th, 2020, 08:27 AM
#1
Override the baseclass function
hello,
In the base class, i have the following function (this is all in legacy code)
virtual const std::safemap<int, LPUMTSCELL>& GetUMTSCellList() = 0;
I am trying to create a new derived class, i am not using the above function. i just want to write a dummy override function. This is to enable instantiating the derived class.
Code:
const safemap<int, LPUMTSCELL> GetUMTSCellList()
{ std::safemap<int, LPUMTSCELL> t;
LPUMTSCELL cell;
t.insert(std::make_pair(1,cell));
return t;
}
Then i am getting the following error:
\TACPlanResultWizard.h(33,33): error C2555: 'TACPlanResultWizard::GetUMTSCellList': overriding virtual function return type differs and is not covariant from 'CWizBasePropSheet::GetUMTSCellList'
I just want to write a override function for test prupose. Please could you help with this compilation error ?
thankyou very much
pdk
-
December 7th, 2020, 09:17 AM
#2
Re: Override the baseclass function
const safemap<int, LPUMTSCELL> GetUMTSCellList() from derived implementation is different from
const safemap<int, LPUMTSCELL>& GetUMTSCellList() = 0;
See '&' from declaration of base class.
Last edited by mesajflaviu; December 7th, 2020 at 02:25 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|