title: How to swap 2 Dictionary objects without making copy in C#
body: <p>all:</p>
  
  <p>I have 2 Dictionary objects d1 and d2. They are created separately at beginning, and contents are added to them separately. After some processing, I want to do following things:</p>
  
  <ul>
  <li>Make d1 reference d2; </li>
  <li>Make d2 reference to a new object.</li>
  </ul>
  
  <p>I am C# beginner and only find below way to do this job:</p>
  
  <pre><code>d1 = new Dictionary&lt;int, int&gt;(d2);
  d2 = new Dictionary&lt;int, int&gt;();
  </code></pre>
  
  <p>Can I do it more efficiently like C++ way, like below? Pseudo code:</p>
  
  <pre><code>d1 = d2;
  d2 = new Dictionary&lt;int, int&gt;();
  </code></pre>
  
  <p>Thanks.</p>