在 C++ 接口声明中使用关键字

Using keyword in a C++ interface declaration

我正在将 Direct2D d2d1_1.h 头文件移植到 Delphi 并且我被声明困住了。没看明白(Line 1522 in d2d_1.h):

interface DX_DECLARE_INTERFACE("e8f7fe7a-191c-466d-ad95-975678bda998") ID2D1DeviceContext  : public ID2D1RenderTarget
{
    STDMETHOD(CreateBitmap)(
        D2D1_SIZE_U size,
        _In_opt_ CONST void *sourceData,
        UINT32 pitch,
        _In_ CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
        _COM_Outptr_ ID2D1Bitmap1 **bitmap
        ) PURE;    

    using ID2D1RenderTarget::CreateBitmap;       //<<<<<====== This line

    // More code deleted for simplicity
}; // ID2D1DeviceContext

在Delphi中,接口声明中没有“using”关键字这样的概念。

我的问题是: 我应该简单地忽略这一行因为 C++ 编译器做了一些神奇的事情还是应该重现 ID2D1RenderTarget::CreateBitmap 声明?

IMO 接口实际上是指向所有方法的指针数组。所以我想我必须从继承的接口中重现声明,这样他的槽就被占用了。

My question is: Should I simply ignore this line because C compiler does some magic or should I reproduce ID2D1RenderTarget::CreateBitmap declaration?

using 声明基本上是将别处定义的类型引入当前范围。它的作用是允许写 CreateBitmap 而不是 ID2D1RenderTarget::CreateBitmap.

从 C++ 移植到 Delphi 时,必须简单地忽略使用“using”关键字声明的方法。