开发者

Resolving C++ Name Collision

InitializeQTML is a function in QTML.h. I'm writing a wrapper and I would like to use the name InitializeQTML for the wrapper function:

#include <QTML.h>

public class QuickTime
{ 
  public:  
    static void InitializeQTML(InitializationFlags flag) {
    开发者_开发技巧    InitializeQTML((long)flag));
    };
};

How can I reference the original InitializeQTML function from inside the wrapper function and avoid the name collision without renaming the wrapper?


You can qualify the name. If the QTML library's InitializeQTML function is in the global namespace, you can use this in your QuickTime::InitializeQTML static member function to refer to it:

::InitializeQTML((long)flag);
^ look in the global namespace
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜