iv3d-users

Text archives Help


[IV3D-USERS] Re: Re: Re: Basics/Clipper.cpp:143: error: no matching function for call to sort


Chronological Thread 
  • From: tom fogal <tfogal@sci.utah.edu>
  • To: iv3d-users@sci.utah.edu
  • Subject: [IV3D-USERS] Re: Re: Re: Basics/Clipper.cpp:143: error: no matching function for call to sort
  • Date: Tue, 13 Nov 2012 15:12:02 +0100

Hi Mathieu,

I just committed a fix to the clipper issue you found here; it looked
to point to a real syntax issue, but our compilers were lenient and
accepted it anyway.

... but I just hit another issue right afterwards, in another file.

I attached the patch anyway, in case it's useful somehow.

On 11/13/2012 02:27 PM, Mathieu Malaterre wrote:
> On Tue, Nov 13, 2012 at 9:58 AM, tom fogal <tfogal@sci.utah.edu> wrote:
>> Which compiler revision, exactly?
> 
> $ g++ -dumpversion
> 4.4.5
[snip]
> It looks as if imagevis3d requires a certain g++ version. And this
> particular version is not specified in the debian/* files...  Hence
> my question which gcc version is required to build imagevis3d ?

Indeed, you're right.  We had a (potentially internal, sorry)
conversation about only supporting g++-4.5 some time ago.  4.5 was
specifically chosen because it was the oldest compiler we had on a
`stable' OS at the time.  We apparently didn't have Debian's stable
release.

That said, I think we're only testing with 4.*6* right now.  I would
/like/ our policy to be `support the default compilers on the most
popular 3 Linux distros, latest two OS X releases, and whatever MSVC
we find convenient'.  James, our buildbot should reflect that---after
supercomputing.

(It is hard to drop down to 4.4, since we've jumped on the C++11
bandwagon.  4.4 doesn't support lambdas, for example.  Is "Wheezy" far
off?)

-tom
commit 41b89ddb5538bbeb2aad6ddaadb55ee6669e5e92 (HEAD, git-svn, private, master)
Author: tfogal <tfogal@5b8196f7-c1c0-4be6-8b13-4feed349168d>
Date:   Tue Nov 13 13:57:43 2012 +0000

    Fix sorting code.
    
    Was taking the object type instead of an instance...
    
    git-svn-id: https://gforge.sci.utah.edu/svn/basics/trunk@270 5b8196f7-c1c0-4be6-8b13-4feed349168d
---
 Clipper.cpp |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Clipper.cpp b/Clipper.cpp
index cb347c4..5ae4f2d 100644
--- a/Clipper.cpp
+++ b/Clipper.cpp
@@ -112,11 +112,12 @@ std::vector<FLOATVECTOR3> Clipper::TriPlane(std::vector<FLOATVECTOR3>& posData,
   return newVertices;
 }
 
-struct {
-  bool operator() (const FLOATVECTOR3& i, const FLOATVECTOR3& j) { 
-    return i.x < j.x || (i.x == j.x && i.y < j.y) || (i.x == j.x && i.y == j.y && i.z < j.z);
+struct CompSorter {
+  bool operator() (const FLOATVECTOR3& i, const FLOATVECTOR3& j) const {
+    return i.x < j.x || (i.x == j.x && i.y < j.y) ||
+           (i.x == j.x && i.y == j.y && i.z < j.z);
   }
-} CompSorter;
+};
 
 static bool AngleSorter(const FLOATVECTOR3& i, const FLOATVECTOR3& j, const FLOATVECTOR3& center, const FLOATVECTOR3& refVec, const FLOATVECTOR3& normal) { 
   FLOATVECTOR3 vecI = (i-center).normalized();
@@ -140,8 +141,9 @@ void Clipper::BoxPlane(std::vector<FLOATVECTOR3>& posData, const FLOATVECTOR3 &n
   if (newVertices.size() < 3) return;
   
   // remove duplicate vertices
-  std::sort(newVertices.begin(), newVertices.end(), CompSorter);
-  newVertices.erase(std::unique(newVertices.begin(), newVertices.end()), newVertices.end());
+  std::sort(newVertices.begin(), newVertices.end(), CompSorter());
+  newVertices.erase(std::unique(newVertices.begin(), newVertices.end()),
+                    newVertices.end());
 
   // sort counter clockwise
   using namespace std::placeholders;



Archive powered by MHonArc 2.6.16.

Top of page