<div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 6, 2012 at 4:01 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank" class="cremed">chandlerc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Fri, Jul 6, 2012 at 3:51 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk" target="_blank" class="cremed">stoklund@2pi.dk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div>On Jul 6, 2012, at 3:40 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank" class="cremed">chandlerc@gmail.com</a>> wrote:</div>

<br><blockquote type="cite"><div style="font-family:Optima;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

I still think we should likely make join() use this code because we should make it handle that input pattern efficiently, but fall back on something that isn't super-linear when it hits edge cases.</div></blockquote>
<div>
<br></div></div><div>How about sticking the merge state in a (local) class:</div><div><br></div><div>class LIMerger {</div><div>  NewRanges, …</div><div>public:</div><div>  LIMerger(LiveInterval &LHS, SlotIndex StartPos);</div>

<div>  void add(SlotIndex From, SlotIndex To, VNInfo *VNI);</div><div>  void finish();</div><div>};</div><div><br></div><div>That interface could readily be used by all three clients, and you don't clutter up the code with value mapping stuff.</div>

</div></div></blockquote><div><br></div></div><div>I'd love an interface that doesn't involve the value mapping stuff...</div></div></div></blockquote><div><br></div><div>What I wouldn't give for a lambda that accepts the RHS range and produces the "fixed" range for merging... </div>
</div></div>