开发者

Resolving C++ Name Collision

开发者 https://www.devze.com 2023-02-01 22:26 出处:网络
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:

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

精彩评论

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