<br><br><div class="gmail_quote">On Sun, Apr 22, 2012 at 11:32 PM, Marc Glisse <span dir="ltr"><<a href="mailto:marc.glisse@inria.fr">marc.glisse@inria.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Sun, 22 Apr 2012, Ovanes Markaryan wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello *,<br>
just tried to compile SYMPHONY-5.4.4 with clang 3.0 + libc++ (tag 31). While<br>
compiling it I receive this error:<br>
<br>
include/c++/v1/algorithm:643:<u></u>97: error: invalid operands to binary<br>
expression<br>
      ('const reducedCost' and 'const reducedCost')<br>
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1&<br>
__y) const {return __x < __y;}<br>
</blockquote>
<br></div>
[...]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    bool operator<(const reducedCost & other)<br>
</blockquote>
<br></div>
Missing const here. It is often preferable to avoid making operators member functions when you can avoid it.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    {<br>
        return (value>other.value);<br>
    }<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Marc Glisse<br></font></span></blockquote><div><br></div><div>Hello Marc,</div><div><br></div><div>you are definitely right. I overlooked it, since as already wrote this is not my code (just copy pasted it from the lib)... But in my tests I commented out this operator< and provided the specialization of  std::less, to just test it and it failed as well. I did not test with both enable (operator< and less-specialization). Actually this code is somehow really bad, because less is actually not less but greater ;) This code compiles fine with gcc and clang + gcc's version of stdlib. As far as I remember the standard requires that std::less is specialized to allow the less comparison or the operator< is implicitly used through the generalized less. In my tests less specialization was not considered by make_heap. This is my point.</div>

<div><br></div><div>Thanks,</div><div>Ovanes</div><div><br></div></div>