These are chat archives for symengine/symengine

4th
Sep 2014
Thilina Rathnayake
@thilinarmtb
Sep 04 2014 01:49
I tried std::sort with the following custom compare function.
bool cmp(const RCP<const Integer> &a, const RCP<const Integer> &b)
{
    if (a->compare(*b) >= 0)
        return true;
    else
        return false;
}
It fails with the following error.
/home/thilina/Repos/csympy/benchmarks/isuru.cpp:48:5: error: no matching
      function for call to 'sort'
    std::sort(v.begin(), v.end(), cmp);
    ^~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_algo.h:5474:5: note: 
      candidate template ignored: couldn't infer template argument '_Compare'
    sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
I am using Clang.
Here v is a std::vector<RCP<const Integer>>