B
Ben Voigt
Found another variation on my previous bug
(https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100917)
I would welcome validation and votes.
class ISkewEstimator
{
virtual void get_Sum(double* const pdRetval) const = 0;
};
class CSkewEstimator : public ISkewEstimator
{
virtual void get_Sum(double* pdRetval) const override; // remove explicit
override for other compilers
};
CSkewEstimator skewInstance;
1>overrideconstness.cpp
1>c:\programming\constness\overrideconstness.cpp(8) : warning C4301:
'CSkewEstimator::get_Sum': overriding virtual function only differs from
'ISkewEstimator::get_Sum' by const/volatile qualifier
1> c:\programming\constness\overrideconstness.cpp(3) : see declaration of
'ISkewEstimator::get_Sum'
1>c:\programming\constness\overrideconstness.cpp(8) : error C3668:
'CSkewEstimator::get_Sum' : method with override specifier 'override' did
not override any base class methods
1>c:\programming\constness\overrideconstness.cpp(11) : error C2259:
'CSkewEstimator' : cannot instantiate abstract class
1> due to following members:
1> 'void ISkewEstimator::get_Sum(double *const ) const' : is abstract
1> c:\programming\constness\overrideconstness.cpp(3) : see declaration of
'ISkewEstimator::get_Sum'
(https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100917)
I would welcome validation and votes.
class ISkewEstimator
{
virtual void get_Sum(double* const pdRetval) const = 0;
};
class CSkewEstimator : public ISkewEstimator
{
virtual void get_Sum(double* pdRetval) const override; // remove explicit
override for other compilers
};
CSkewEstimator skewInstance;
1>overrideconstness.cpp
1>c:\programming\constness\overrideconstness.cpp(8) : warning C4301:
'CSkewEstimator::get_Sum': overriding virtual function only differs from
'ISkewEstimator::get_Sum' by const/volatile qualifier
1> c:\programming\constness\overrideconstness.cpp(3) : see declaration of
'ISkewEstimator::get_Sum'
1>c:\programming\constness\overrideconstness.cpp(8) : error C3668:
'CSkewEstimator::get_Sum' : method with override specifier 'override' did
not override any base class methods
1>c:\programming\constness\overrideconstness.cpp(11) : error C2259:
'CSkewEstimator' : cannot instantiate abstract class
1> due to following members:
1> 'void ISkewEstimator::get_Sum(double *const ) const' : is abstract
1> c:\programming\constness\overrideconstness.cpp(3) : see declaration of
'ISkewEstimator::get_Sum'