Avoiding repetition with left-right children of tree in C++
<p>I wanted to avoid repeating my if-else twice (once for left, once for right, identically), so I did this, which feels very unidiomatic:</p>

<pre><code>MovieNode** child = title &lt; parent-&gt;title ? &amp;parent-&gt;left : &amp;parent-&gt;right;
if(*child)
    parent = *child;
else
    *child = new MovieNode(ranking, title, releaseYear, quantity);
</code></pre>

<p>What's the proper way to do this? </p>

<p>[btw this is why I prefer Haskell XD, I would just do <code>parent = child</code>]</p>