<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 15, 2016, at 6:49 PM, Haravikk <<a href="mailto:swift-evolution@haravikk.me" class="">swift-evolution@haravikk.me</a>> wrote:</div><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 15 Mar 2016, at 15:48, Lorenzo Racca <<a href="mailto:lorenzo.racca@live.it" class="">lorenzo.racca@live.it</a>> wrote:</div><div class=""><br class="">I already knew the impossibility of applying such a predicate as “$0 == 3” and I actually couldn’t quite figure out a solution.</div></blockquote><br class=""></div><div class="">I thought so, and I don’t think there is a way to do it, my point was really just that your swift doc comments weren’t clear on that point, then I went off at a bit of a tangent ;)</div></div><br class=""></div></div></blockquote>No problem! What I am trying to figure out here is how we should implement the lowerBound and upperBound functions. Should they exactly reflect their C++ counterparts? </div><div>Anyway, it seems all of our implementations have the same problem, that they cannot be univocally called with any predicate whatsoever, (or at least it seemed to me during some tests with the implementations :) ), so I don’t really know how we should act. I am a little blocked.</div><div>Does anyone have ideas on how that could work no matter what predicate is given? Especially, an upperBound() function, which is a little trickier. </div><div><br class=""></div><div><blockquote type="cite" class=""><blockquote type="cite" class="">On Mar 15, 2016, at 6:07 PM, Jeff Hajewski<b style="font-family: 'Helvetica Neue';" class=""> </b> <<a href="mailto:jeff.hajewski@gmail.come" class="">jeff.hajewski@gmail.come</a>> wrote:</blockquote></blockquote><blockquote type="cite" class=""><blockquote type="cite" class="">I suspect there is an easy solution here and I'm just having a mental block...</blockquote></blockquote></div><div><br class=""></div><div>Jeff, I really do feel you, I’m in the same situation! </div><div>I think your solution could be applicable though, just in a little more complicated way than C++ did, which is to extract the complement of the predicate and act differently upon that. </div><div>As of now I don’t have the time to put down some code (time zone sucks) but will try asap.</div><div><br class=""></div><div>Lorenzo</div><div><br class=""></div><div>Lorenzo Racca<br class="">+39 345 9294756<br class=""><a href="mailto:lorenzo.racca@live.it" class="">lorenzo.racca@live.it</a><br class=""></div><br class=""></body></html>