title: Next iteration in z-order curve
body: <p>I am building a quadtree using the techniques described in <a href="http://en.wikipedia.org/wiki/Z-order_curve" rel="nofollow">this wikipedia article</a>.
  I am storing the coordinates in an 2- or 3-dimansional array.</p>
  
  <pre><code>boost::array&lt;unsigned int, 2 /* 3 */&gt; coord;
  </code></pre>
  
  <p>I need a method to calculate the coordinates of the next box in z-order.
  It would work by interleaving the bits, increasing by one and than deinterleaving, but this gets very complicated.
  I hope there is an implementation similar to the cmp_zorder(...) methon in the article wich works without interleaving the bits.</p>