Skip to Content.
Sympa Menu

cgal-discuss - Conflicting TemplateName / Macro (MAP_TYPE)

Subject: CGAL users discussion list

List archive

Conflicting TemplateName / Macro (MAP_TYPE)


Chronological Thread 
  • From:
  • To:
  • Subject: Conflicting TemplateName / Macro (MAP_TYPE)
  • Date: Wed, 19 Dec 2007 18:27:30 +0100

Hello,

I'm using CGAL in combination with
<sys/mman.h>
on a Linux System (I believe every linux has one like that). This header
defines a preprocessor macro named MAP_TYPE

e.g.
#define MAP_TYPE 0x0f /* Mask for type of mapping */

which leads to very strange behaviour when combined with the
./include/compare_vertices.h class, which is apparently a part of CGAL (see
below).
This CGAL class uses MAP_TYPE as a template parameter, which is obviously
replaced by the preprocessor. To avoid unnecessary hacks (and because it is
unlikely that mman.h will be changed that easily - although I recognize its
not a very good style to name a macro like that): could you choose some other
name? :D

greetings
Chris



# 23
"/home/takifugu2/software/Linux/OpenMS/contrib32bit-gcc4.1.1/include/CGAL/compare_vertices.h"
namespace CGAL {

namespace CGALi {


template<class VP, class NT,class 0x0f>
class compare_vertices {
public:

0x0f* pmap;

compare_vertices(0x0f *p){ pmap=p; }

bool operator()(VP e1, VP e2)

{ NT& v1 = (*pmap)[e1];
NT& v2 = (*pmap)[e2];
return (v1 > v2);
}
};


}


  • Conflicting TemplateName / Macro (MAP_TYPE), bielow, 12/19/2007

Archive powered by MHonArc 2.6.16.

Top of Page