I saw the following code snippet:
class WindowHandle {
public:
WindowHandle(WINDOW_HANDLE handle) : w(handle) {}
~WindowHandle() { destoryWindow(w); }
operator WINDOW_HANDLE() { return w; }
...
private:
WINDOW_HANDLE w;
...
}
Here is the question: how do I use operator WINDOW_HANDLE() to get the raw pointer? I list my guess as follows:
WindowHandle win(createWindow());
WINDOW_HANDLE winPtr = win.operator WINDOW_HANDLE(); // I am not sure whether this is correct.
Thank you
Simply
is sufficient. User-defined operators create implicit conversions.