C++ -- how to call user defined operator?
<p>I saw the following code snippet:</p>

<pre><code>class WindowHandle {
public:
  WindowHandle(WINDOW_HANDLE handle) : w(handle) {}
  ~WindowHandle() { destoryWindow(w); }

  operator WINDOW_HANDLE() { return w; }
  ...

private:
  WINDOW_HANDLE w;
  ...
}
</code></pre>

<p>Here is the question: how do I use operator WINDOW_HANDLE() to get the raw pointer? I list my guess as follows:</p>

<pre><code>WindowHandle win(createWindow());

WINDOW_HANDLE winPtr = win.operator WINDOW_HANDLE(); // I am not sure whether this is correct.
</code></pre>

<p>Thank you</p>
