C ++ Name Conflict Resolution

InitializeQTML is a function in QTML.h. I am 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 inside a wrapper function and avoid name collisions without renaming the shell?

+3
source share
1 answer

You can qualify a name. If the QTMLlibrary function InitializeQTMLis in the global namespace, you can use it in your static member function QuickTime::InitializeQTMLto refer to it:

::InitializeQTML((long)flag);
^ look in the global namespace
+6
source

Source: https://habr.com/ru/post/1782691/


All Articles