我正在从 VCL 类派生一个新TStream
类:
// A stream based on a temporary file, deleted when the stream is closed
class TTempFileStream : public TStream
{
...
public:
using TStream::Seek;
__int64 __fastcall Seek(const __int64 Offset, TSeekOrigin Origin)
{
return 0; // for simplicity!
}
...
} ;
TStream
声明了 Seek 的以下两种变体:-
virtual int __fastcall Seek(int Offset, System::Word Origin)/* overload */;
virtual __int64 __fastcall Seek(const __int64 Offset, TSeekOrigin Origin)/* overload */;
但是在编译我的课程时我收到以下 W8022 警告:-
[BCC32 Warning]_utils.h(166): W8022
'_fastcall TTempFileStream::Seek(const __int64,TSeekOrigin)' hides virtual function '_fastcall TStream::Seek(int,unsigned short)'
当然 Using 声明应该解决这个问题?
为了将这个问题拖回正轨,我知道两个版本的 TStream::seek 相互关联的方式,我只是想获得派生类公开的继承 Seek(int,int) 方法。为什么我的using
声明不这样做?