What is "operator int&() { return i; } " doing in the code
<p>I came across this code just few minutes back here in stackoverflow.
I was confused about What actually  <code>operator int&amp;() { return i; }</code> is doing in the code</p>

<pre><code># include&lt;iostream&gt;
# include&lt;conio.h&gt;

using namespace std;

class INT {
public:
            INT(int ii = 0) : i(ii) {}
            operator int&amp;() { return i; }
            void display()
            {
              cout &lt;&lt; "value of i is : " &lt;&lt; i;       
            }
private:
  int i;
};

int main()
{
  INT l;
  cin &gt;&gt; l;
  l.display();
  getch();
  return 0;
}
</code></pre>

<p>I added the display function just to get some insight. I saw the the value that I get from <code>cin &gt;&gt; l;</code> gets assigned to <code>i</code> which is private member of object <code>l</code>. So this is 
some sort of overloading definitely I guess.</p>

<p>Can you let me know can we take the Value of the object of class from directly through cin? Does it works fine? </p>

<p>What if I have two int variable in private part of my class INT?</p>
