diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 908bcc76c5dd84446fd2c4052e4af8ed59ac2cc4..1c1aed51b86547df293502dee2503d211e7b7ea8 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,7 +5,8 @@ file chooser type now changeable at runtime; fixed regression in MeshAdapt for
 non-periodic surfaces with singularities; new X3D output for geometries and
 meshes; new compound Spline/BSpline commands; renamed plugin AnalyseCurvedMesh
 to AnalyseMeshQuality; fixed regression for BSplines on geometries with built-in
-kernel (Sphere, PolarSphere); small fixes.
+kernel (Sphere, PolarSphere); improved import of STEP colors on shape
+boundaries; small fixes.
 
 * Incompatible API changes: removed mesh/smooth (now handled by mesh/optimize
   like all other mesh optimizers); new arguments to mesh/optimize,
diff --git a/Common/Hash.h b/Common/Hash.h
index d468762ce914daa9eddb7978dc5418bdcd6e86d1..aa6b5a70d210cf9cb0d566ab88c9d1d07d7df426 100644
--- a/Common/Hash.h
+++ b/Common/Hash.h
@@ -6,7 +6,7 @@
 #ifndef HASH_H
 #define HASH_H
 
-//--FNV hashing parameters
+// FNV (Fowler–Noll–Vo) hashing parameters
 
 #if defined(HAVE_64BIT_SIZE_T)
 #define FNV_PRIME 1099511628211UL
@@ -16,7 +16,7 @@
 #define FNV_OFFSET_BASIS 2166136261UL
 #endif
 
-//--Hash FNV1a implemented via for loop.  "key" has size "len" bytes.
+// Hash FNV1a implemented via for loop.  "key" has size "len" bytes.
 
 inline size_t hash_FNV1a(const void *const key, const int len)
 {
@@ -26,9 +26,9 @@ inline size_t hash_FNV1a(const void *const key, const int len)
   return hash;
 }
 
-//--Hash FNV1a implemented via template-metaprogramming loop.  This should be
-//--used if the length N is known at compile time.  "key" has size "N" bytes.
-//--Use the entry point HashFNV1a<N>::eval(key).
+// Hash FNV1a implemented via template-metaprogramming loop.  This should be
+// used if the length N is known at compile time.  "key" has size "N" bytes.
+// Use the entry point HashFNV1a<N>::eval(key).
 
 template <int N> struct Hash1FNV1a {
   static size_t eval(size_t hash, const unsigned char *p)
diff --git a/Geo/CGNSUtils.h b/Geo/CGNSUtils.h
index fe0a682349adf574682f98079bad1212428fd10a..a1e2d4eb61e821595aae01a09b2a53625b838c68 100644
--- a/Geo/CGNSUtils.h
+++ b/Geo/CGNSUtils.h
@@ -652,10 +652,10 @@ typedef std::vector<MVertex *> VertexVec;
 
 template <typename FaceT> struct LFaceTr;
 template <> struct LFaceTr<MEdge> {
-  typedef std::map<MEdge, FaceData, Less_Edge> BoFaceMap;
+  typedef std::map<MEdge, FaceData, MEdgeLessThan> BoFaceMap;
 };
 template <> struct LFaceTr<MFace> {
-  typedef std::map<MFace, FaceData, Less_Face> BoFaceMap;
+  typedef std::map<MFace, FaceData, MFaceLessThan> BoFaceMap;
 };
 
 /*******************************************************************************
diff --git a/Geo/Cell.cpp b/Geo/Cell.cpp
index 0257903528005ea8a60c3709dc6593a0f702f43e..c015f2c7f44776f629e91c07366175bc79aa9ec2 100644
--- a/Geo/Cell.cpp
+++ b/Geo/Cell.cpp
@@ -13,7 +13,7 @@
 #include "MHexahedron.h"
 #include "MPrism.h"
 
-bool Less_Cell::operator()(const Cell *c1, const Cell *c2) const
+bool CellPtrLessThan::operator()(const Cell *c1, const Cell *c2) const
 {
   // If cell complex is done use enumeration (same as vertex order)
   if(c1->getNum() != 0) return (c1->getNum() < c2->getNum());
@@ -98,7 +98,7 @@ Cell::Cell(Cell *parent, int i)
 
 bool Cell::_sortVertexIndices()
 {
-  std::map<MVertex *, int, MVertexLessThanNum> si;
+  std::map<MVertex *, int, MVertexPtrLessThan> si;
 
   bool noinsert = false;
   for(std::size_t i = 0; i < _v.size(); i++)
@@ -109,7 +109,7 @@ bool Cell::_sortVertexIndices()
     return false;
   }
 
-  std::map<MVertex *, int, MVertexLessThanNum>::iterator it;
+  std::map<MVertex *, int, MVertexPtrLessThan>::iterator it;
   for(it = si.begin(); it != si.end(); it++) _si.push_back(it->second);
 
   return true;
@@ -201,13 +201,13 @@ int Cell::findBdCellOrientation(Cell *cell, int i) const
 
   int perm = 1;
   if(equalVertices(v1, v2)) return perm;
-  while(std::next_permutation(v2.begin(), v2.end(), MVertexLessThanNum())) {
+  while(std::next_permutation(v2.begin(), v2.end(), MVertexPtrLessThan())) {
     perm *= -1;
     if(equalVertices(v1, v2)) return perm;
   }
   cell->getMeshVertices(v2);
   perm = 1;
-  while(std::prev_permutation(v2.begin(), v2.end(), MVertexLessThanNum())) {
+  while(std::prev_permutation(v2.begin(), v2.end(), MVertexPtrLessThan())) {
     perm *= -1;
     if(equalVertices(v1, v2)) return perm;
   }
@@ -498,7 +498,7 @@ bool Cell::hasVertex(int vertex) const
 
 bool CombinedCell::hasVertex(int vertex) const
 {
-  for(std::map<Cell *, int, Less_Cell>::const_iterator cit = _cells.begin();
+  for(std::map<Cell *, int, CellPtrLessThan>::const_iterator cit = _cells.begin();
       cit != _cells.end(); cit++) {
     if(cit->first->hasVertex(vertex)) return true;
   }
@@ -676,7 +676,7 @@ int Cell::getCoboundarySize(bool orig)
   return size;
 }
 
-void Cell::getBoundary(std::map<Cell *, short int, Less_Cell> &boundary,
+void Cell::getBoundary(std::map<Cell *, short int, CellPtrLessThan> &boundary,
                        bool orig)
 {
   boundary.clear();
@@ -687,7 +687,7 @@ void Cell::getBoundary(std::map<Cell *, short int, Less_Cell> &boundary,
   }
 }
 
-void Cell::getCoboundary(std::map<Cell *, short int, Less_Cell> &coboundary,
+void Cell::getCoboundary(std::map<Cell *, short int, CellPtrLessThan> &coboundary,
                          bool orig)
 {
   coboundary.clear();
@@ -738,7 +738,7 @@ CombinedCell::CombinedCell(Cell *c1, Cell *c2, bool orMatch, bool co)
 
   // cells
   c1->getCells(_cells);
-  std::map<Cell *, int, Less_Cell> c2Cells;
+  std::map<Cell *, int, CellPtrLessThan> c2Cells;
   c2->getCells(c2Cells);
   for(citer cit = c2Cells.begin(); cit != c2Cells.end(); cit++) {
     if(!orMatch) (*cit).second = -1 * (*cit).second;
diff --git a/Geo/Cell.h b/Geo/Cell.h
index dde407eee0f95267aca2e439a709d2695da02139..cd816ea83f9ec32f848f046b8d40c8f14610a351 100644
--- a/Geo/Cell.h
+++ b/Geo/Cell.h
@@ -14,7 +14,7 @@
 
 class Cell;
 
-class Less_Cell {
+class CellPtrLessThan {
 public:
   bool operator()(const Cell *c1, const Cell *c2) const;
 };
@@ -52,8 +52,8 @@ protected:
   bool _immune;
 
   // list of cells on the boundary and on the coboundary of this cell
-  std::map<Cell *, BdInfo, Less_Cell> _bd;
-  std::map<Cell *, BdInfo, Less_Cell> _cbd;
+  std::map<Cell *, BdInfo, CellPtrLessThan> _bd;
+  std::map<Cell *, BdInfo, CellPtrLessThan> _cbd;
 
   Cell() {}
 
@@ -105,7 +105,7 @@ public:
   virtual bool hasVertex(int vertex) const;
 
   // (co)boundary cell iterator
-  typedef std::map<Cell *, BdInfo, Less_Cell>::iterator biter;
+  typedef std::map<Cell *, BdInfo, CellPtrLessThan>::iterator biter;
 
   // iterators to (first/last (co)boundary cells of this cell
   // (orig: to original (co)boundary cells of this cell)
@@ -118,9 +118,9 @@ public:
   int getCoboundarySize(bool orig = false);
 
   // get the (orig: original) cell boundary
-  void getBoundary(std::map<Cell *, short int, Less_Cell> &boundary,
+  void getBoundary(std::map<Cell *, short int, CellPtrLessThan> &boundary,
                    bool orig = false);
-  void getCoboundary(std::map<Cell *, short int, Less_Cell> &coboundary,
+  void getCoboundary(std::map<Cell *, short int, CellPtrLessThan> &coboundary,
                      bool orig = false);
 
   // add (co)boundary cell
@@ -146,8 +146,8 @@ public:
   // tools for combined cells
   bool isCombined() const { return _combined; }
 
-  typedef std::map<Cell *, int, Less_Cell>::iterator citer;
-  virtual void getCells(std::map<Cell *, int, Less_Cell> &cells)
+  typedef std::map<Cell *, int, CellPtrLessThan>::iterator citer;
+  virtual void getCells(std::map<Cell *, int, CellPtrLessThan> &cells)
   {
     cells.clear();
     cells[this] = 1;
@@ -164,7 +164,7 @@ public:
 class CombinedCell : public Cell {
 private:
   // list of cells this cell is a combination of
-  std::map<Cell *, int, Less_Cell> _cells;
+  std::map<Cell *, int, CellPtrLessThan> _cells;
 
 public:
   CombinedCell(Cell *c1, Cell *c2, bool orMatch, bool co = false);
@@ -172,7 +172,7 @@ public:
   ~CombinedCell() {}
 
   int getDim() const { return _cells.begin()->first->getDim(); }
-  void getCells(std::map<Cell *, int, Less_Cell> &cells) { cells = _cells; }
+  void getCells(std::map<Cell *, int, CellPtrLessThan> &cells) { cells = _cells; }
   int getNumCells() const { return _cells.size(); }
   bool hasVertex(int vertex) const;
 
diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp
index 5546121b936d813255de2fc649bc996c211cbdd9..8b42f500e526858dff127d9b893efb42cbf5814c 100644
--- a/Geo/CellComplex.cpp
+++ b/Geo/CellComplex.cpp
@@ -160,7 +160,7 @@ bool CellComplex::_removeCells(std::vector<MElement *> &elements, int domain)
   if(elements.empty()) return true;
   Msg::Debug("Removing %d elements and their subcells from the cell complex.",
              (int)elements.size());
-  std::set<Cell *, Less_Cell> removed[4];
+  std::set<Cell *, CellPtrLessThan> removed[4];
 
   for(std::size_t i = 0; i < elements.size(); i++) {
     MElement *element = elements.at(i);
@@ -255,18 +255,18 @@ void CellComplex::insertCell(Cell *cell)
 
 void CellComplex::removeCell(Cell *cell, bool other, bool del)
 {
-  std::map<Cell *, short int, Less_Cell> coboundary;
+  std::map<Cell *, short int, CellPtrLessThan> coboundary;
   cell->getCoboundary(coboundary);
-  std::map<Cell *, short int, Less_Cell> boundary;
+  std::map<Cell *, short int, CellPtrLessThan> boundary;
   cell->getBoundary(boundary);
 
-  for(std::map<Cell *, short int, Less_Cell>::iterator it = coboundary.begin();
+  for(std::map<Cell *, short int, CellPtrLessThan>::iterator it = coboundary.begin();
       it != coboundary.end(); it++) {
     Cell *cbdCell = (*it).first;
     cbdCell->removeBoundaryCell(cell, other);
   }
 
-  for(std::map<Cell *, short int, Less_Cell>::iterator it = boundary.begin();
+  for(std::map<Cell *, short int, CellPtrLessThan>::iterator it = boundary.begin();
       it != boundary.end(); it++) {
     Cell *bdCell = (*it).first;
     bdCell->removeCoboundaryCell(cell, other);
@@ -286,11 +286,11 @@ void CellComplex::removeCell(Cell *cell, bool other, bool del)
     _removedcells.push_back(cell);
 }
 
-void CellComplex::enqueueCells(std::map<Cell *, short int, Less_Cell> &cells,
+void CellComplex::enqueueCells(std::map<Cell *, short int, CellPtrLessThan> &cells,
                                std::queue<Cell *> &Q,
-                               std::set<Cell *, Less_Cell> &Qset)
+                               std::set<Cell *, CellPtrLessThan> &Qset)
 {
-  for(std::map<Cell *, short int, Less_Cell>::iterator cit = cells.begin();
+  for(std::map<Cell *, short int, CellPtrLessThan>::iterator cit = cells.begin();
       cit != cells.end(); cit++) {
     Cell *cell = (*cit).first;
     citer it = Qset.find(cell);
@@ -307,13 +307,13 @@ int CellComplex::coreduction(Cell *startCell, int omit,
   int coreductions = 0;
 
   std::queue<Cell *> Q;
-  std::set<Cell *, Less_Cell> Qset;
+  std::set<Cell *, CellPtrLessThan> Qset;
 
   Q.push(startCell);
   Qset.insert(startCell);
 
-  std::map<Cell *, short int, Less_Cell> bd_s;
-  std::map<Cell *, short int, Less_Cell> cbd_c;
+  std::map<Cell *, short int, CellPtrLessThan> bd_s;
+  std::map<Cell *, short int, CellPtrLessThan> cbd_c;
 
   Cell *s;
   while(!Q.empty()) {
@@ -674,8 +674,8 @@ int CellComplex::combine(int dim)
   double t1 = Cpu();
 
   std::queue<Cell *> Q;
-  std::set<Cell *, Less_Cell> Qset;
-  std::map<Cell *, short int, Less_Cell> bd_c;
+  std::set<Cell *, CellPtrLessThan> Qset;
+  std::map<Cell *, short int, CellPtrLessThan> bd_c;
   int count = 0;
 
   for(citer cit = firstCell(dim); cit != lastCell(dim); cit++) {
@@ -752,8 +752,8 @@ int CellComplex::cocombine(int dim)
   double t1 = Cpu();
 
   std::queue<Cell *> Q;
-  std::set<Cell *, Less_Cell> Qset;
-  std::map<Cell *, short int, Less_Cell> cbd_c;
+  std::set<Cell *, CellPtrLessThan> Qset;
+  std::map<Cell *, short int, CellPtrLessThan> cbd_c;
   int count = 0;
 
   for(citer cit = firstCell(dim); cit != lastCell(dim); cit++) {
@@ -826,9 +826,9 @@ bool CellComplex::coherent()
   for(int i = 0; i < 4; i++) {
     for(citer cit = firstCell(i); cit != lastCell(i); cit++) {
       Cell *cell = *cit;
-      std::map<Cell *, short int, Less_Cell> boundary;
+      std::map<Cell *, short int, CellPtrLessThan> boundary;
       cell->getBoundary(boundary);
-      for(std::map<Cell *, short int, Less_Cell>::iterator it =
+      for(std::map<Cell *, short int, CellPtrLessThan>::iterator it =
             boundary.begin();
           it != boundary.end(); it++) {
         Cell *bdCell = (*it).first;
@@ -845,9 +845,9 @@ bool CellComplex::coherent()
           coherent = false;
         }
       }
-      std::map<Cell *, short int, Less_Cell> coboundary;
+      std::map<Cell *, short int, CellPtrLessThan> coboundary;
       cell->getCoboundary(coboundary);
-      for(std::map<Cell *, short int, Less_Cell>::iterator it =
+      for(std::map<Cell *, short int, CellPtrLessThan>::iterator it =
             coboundary.begin();
           it != coboundary.end(); it++) {
         Cell *cbdCell = (*it).first;
@@ -882,7 +882,7 @@ bool CellComplex::hasCell(Cell *cell, bool orig)
     return true;
 }
 
-void CellComplex::getCells(std::set<Cell *, Less_Cell> &cells, int dim,
+void CellComplex::getCells(std::set<Cell *, CellPtrLessThan> &cells, int dim,
                            int domain)
 {
   cells.clear();
diff --git a/Geo/CellComplex.h b/Geo/CellComplex.h
index 05b498e335686b827edb8cdcee58de0d7b25fe60..c178db3fe83c9c9f944f6415ae810a2f223be8c0 100644
--- a/Geo/CellComplex.h
+++ b/Geo/CellComplex.h
@@ -30,10 +30,10 @@ private:
 
   // sorted containers of unique cells in this cell complex
   // one for each dimension
-  std::set<Cell *, Less_Cell> _cells[4];
+  std::set<Cell *, CellPtrLessThan> _cells[4];
 
   // original cells of this cell complex
-  std::set<Cell *, Less_Cell> _ocells[4];
+  std::set<Cell *, CellPtrLessThan> _ocells[4];
 
   // original cells removed during reductions
   std::vector<Cell *> _removedcells;
@@ -68,8 +68,8 @@ private:
   Cell *_omitCell(Cell *cell, bool dual);
 
   // enqueue cells in queue if they are not there already
-  void enqueueCells(std::map<Cell *, short int, Less_Cell> &cells,
-                    std::queue<Cell *> &Q, std::set<Cell *, Less_Cell> &Qset);
+  void enqueueCells(std::map<Cell *, short int, CellPtrLessThan> &cells,
+                    std::queue<Cell *> &Q, std::set<Cell *, CellPtrLessThan> &Qset);
 
   // insert/remove a cell from this cell complex
   void removeCell(Cell *cell, bool other = true, bool del = false);
@@ -108,13 +108,13 @@ public:
   // domain = 0: cells in domain relative to subdomain
   // domain = 1: cells in domain
   // domain = 2: cells in subdomain
-  void getCells(std::set<Cell *, Less_Cell> &cells, int dim, int domain = 0);
+  void getCells(std::set<Cell *, CellPtrLessThan> &cells, int dim, int domain = 0);
   int getNumCells(int dim, int domain = 0);
   Cell *getACell(int dim, int domain = 0);
-  // std::set<Cell*, Less_Cell> getOrigCells(int dim){ return _ocells[dim]; }
+  // std::set<Cell*, CellPtrLessThan> getOrigCells(int dim){ return _ocells[dim]; }
 
   // iterator for the cells of same dimension
-  typedef std::set<Cell *, Less_Cell>::iterator citer;
+  typedef std::set<Cell *, CellPtrLessThan>::iterator citer;
 
   // iterators to the first and last cells of certain dimension
   citer firstCell(int dim, bool orig = false)
diff --git a/Geo/Chain.cpp b/Geo/Chain.cpp
index 1085e03de28d672bbfdb372bce3ac9b61bb8f6ba..28f5140b625f80f3660a51c090a8819261ffa43f 100644
--- a/Geo/Chain.cpp
+++ b/Geo/Chain.cpp
@@ -34,16 +34,16 @@ std::string convertInt(int number)
   return stream.str();
 }
 
-std::map<GEntity *, std::set<MVertex *, MVertexLessThanNum>, GEntityLessThan>
+std::map<GEntity *, std::set<MVertex *, MVertexPtrLessThan>, GEntityPtrLessThan>
   ElemChain::_vertexCache;
 
 inline void ElemChain::_sortVertexIndices()
 {
-  std::map<MVertex *, int, MVertexLessThanNum> si;
+  std::map<MVertex *, int, MVertexPtrLessThan> si;
 
   for(std::size_t i = 0; i < _v.size(); i++) si[_v[i]] = i;
 
-  std::map<MVertex *, int, MVertexLessThanNum>::iterator it;
+  std::map<MVertex *, int, MVertexPtrLessThan>::iterator it;
   for(it = si.begin(); it != si.end(); it++) _si.push_back(it->second);
 }
 
@@ -140,13 +140,13 @@ int ElemChain::compareOrientation(const ElemChain &c2) const
 
   int perm = 1;
   if(this->_equalVertices(v2)) return perm;
-  while(std::next_permutation(v2.begin(), v2.end(), MVertexLessThanNum())) {
+  while(std::next_permutation(v2.begin(), v2.end(), MVertexPtrLessThan())) {
     perm *= -1;
     if(this->_equalVertices(v2)) return perm;
   }
   c2.getMeshVertices(v2);
   perm = 1;
-  while(std::prev_permutation(v2.begin(), v2.end(), MVertexLessThanNum())) {
+  while(std::prev_permutation(v2.begin(), v2.end(), MVertexPtrLessThan())) {
     perm *= -1;
     if(this->_equalVertices(v2)) return perm;
   }
diff --git a/Geo/Chain.h b/Geo/Chain.h
index ca3fe6622561a145e9958ea2c8010a1084ca1176..d008aee6c00f1cbbe6b6ae6839575c4976bcbd53 100644
--- a/Geo/Chain.h
+++ b/Geo/Chain.h
@@ -125,8 +125,8 @@ private:
   inline void _sortVertexIndices();
   bool _equalVertices(const std::vector<MVertex *> &v2) const;
 
-  static std::map<GEntity *, std::set<MVertex *, MVertexLessThanNum>,
-                  GEntityLessThan>
+  static std::map<GEntity *, std::set<MVertex *, MVertexPtrLessThan>,
+                  GEntityPtrLessThan>
     _vertexCache;
 
 public:
diff --git a/Geo/ChainComplex.cpp b/Geo/ChainComplex.cpp
index b911765151d4ceb183f37bd9fb328f73dafdc9cf..d8845c0be92c4c781c97fe56d2c332c56422bcb1 100644
--- a/Geo/ChainComplex.cpp
+++ b/Geo/ChainComplex.cpp
@@ -58,7 +58,7 @@ ChainComplex::ChainComplex(CellComplex *cellComplex, int domain)
       mpz_t elem;
       mpz_init(elem);
       _hMatrix[dim] = create_gmp_matrix_zero(rows, cols);
-      for(std::set<Cell *, Less_Cell>::iterator cit =
+      for(std::set<Cell *, CellPtrLessThan>::iterator cit =
             cellComplex->firstCell(dim);
           cit != cellComplex->lastCell(dim); cit++) {
         Cell *cell = *cit;
@@ -449,7 +449,7 @@ gmp_matrix *ChainComplex::getBasis(int dim, int basis)
     return NULL;
 }
 
-void ChainComplex::getBasisChain(std::map<Cell *, int, Less_Cell> &chain,
+void ChainComplex::getBasisChain(std::map<Cell *, int, CellPtrLessThan> &chain,
                                  int num, int dim, int basis, bool deform)
 {
   if(basis < 0 || basis > 3) return;
@@ -476,7 +476,7 @@ void ChainComplex::getBasisChain(std::map<Cell *, int, Less_Cell> &chain,
     elemli = mpz_get_si(elem);
     elemi = elemli;
     if(elemli != 0) {
-      std::map<Cell *, int, Less_Cell> subCells;
+      std::map<Cell *, int, CellPtrLessThan> subCells;
       cell->getCells(subCells);
       for(Cell::citer it = subCells.begin(); it != subCells.end(); it++) {
         Cell *subCell = it->first;
@@ -522,9 +522,9 @@ int ChainComplex::getTorsion(int dim, int num)
     return _torsion[dim].at(num - 1);
 }
 
-bool ChainComplex::deform(std::map<Cell *, int, Less_Cell> &cells,
-                          std::map<Cell *, int, Less_Cell> &cellsInChain,
-                          std::map<Cell *, int, Less_Cell> &cellsNotInChain)
+bool ChainComplex::deform(std::map<Cell *, int, CellPtrLessThan> &cells,
+                          std::map<Cell *, int, CellPtrLessThan> &cellsInChain,
+                          std::map<Cell *, int, CellPtrLessThan> &cellsNotInChain)
 {
   std::vector<int> cc;
   std::vector<int> bc;
@@ -575,15 +575,15 @@ bool ChainComplex::deform(std::map<Cell *, int, Less_Cell> &cells,
   return true;
 }
 
-bool ChainComplex::deformChain(std::map<Cell *, int, Less_Cell> &cells,
+bool ChainComplex::deformChain(std::map<Cell *, int, CellPtrLessThan> &cells,
                                std::pair<Cell *, int> cell, bool bend)
 {
   Cell *c1 = cell.first;
   int dim = c1->getDim();
   for(Cell::biter cit = c1->firstCoboundary(true); cit != c1->lastCoboundary();
       cit++) {
-    std::map<Cell *, int, Less_Cell> cellsInChain;
-    std::map<Cell *, int, Less_Cell> cellsNotInChain;
+    std::map<Cell *, int, CellPtrLessThan> cellsInChain;
+    std::map<Cell *, int, CellPtrLessThan> cellsNotInChain;
     Cell *c1CbdCell = cit->first;
 
     for(Cell::biter cit2 = c1CbdCell->firstBoundary(true);
@@ -642,7 +642,7 @@ bool ChainComplex::deformChain(std::map<Cell *, int, Less_Cell> &cells,
   return false;
 }
 
-void ChainComplex::smoothenChain(std::map<Cell *, int, Less_Cell> &cells)
+void ChainComplex::smoothenChain(std::map<Cell *, int, CellPtrLessThan> &cells)
 {
   if(!_cellComplex->simplicial() || cells.size() < 2) return;
   int dim = cells.begin()->first->getDim();
@@ -676,7 +676,7 @@ void ChainComplex::smoothenChain(std::map<Cell *, int, Less_Cell> &cells)
              size);
 }
 
-void ChainComplex::eraseNullCells(std::map<Cell *, int, Less_Cell> &cells)
+void ChainComplex::eraseNullCells(std::map<Cell *, int, CellPtrLessThan> &cells)
 {
   std::vector<Cell *> toRemove;
   for(citer cit = cells.begin(); cit != cells.end(); cit++) {
@@ -685,7 +685,7 @@ void ChainComplex::eraseNullCells(std::map<Cell *, int, Less_Cell> &cells)
   for(std::size_t i = 0; i < toRemove.size(); i++) cells.erase(toRemove[i]);
 }
 
-void ChainComplex::deImmuneCells(std::map<Cell *, int, Less_Cell> &cells)
+void ChainComplex::deImmuneCells(std::map<Cell *, int, CellPtrLessThan> &cells)
 {
   for(citer cit = cells.begin(); cit != cells.end(); cit++) {
     Cell *cell = (*cit).first;
diff --git a/Geo/ChainComplex.h b/Geo/ChainComplex.h
index a342a295bfc905a2da22fee16d033205d5daf60b..4805136af013598d106c728e68a8b84808ebb8e7 100644
--- a/Geo/ChainComplex.h
+++ b/Geo/ChainComplex.h
@@ -59,7 +59,7 @@ private:
 
   // index to cell map
   // matrix indices correspond to these cells in _cellComplex
-  std::map<Cell *, int, Less_Cell> _cellIndices[4];
+  std::map<Cell *, int, CellPtrLessThan> _cellIndices[4];
 
   // set the matrices
   void setHMatrix(int dim, gmp_matrix *matrix)
@@ -132,14 +132,14 @@ private:
   }
 
   // local deformation tools for chains
-  bool deformChain(std::map<Cell *, int, Less_Cell> &cells,
+  bool deformChain(std::map<Cell *, int, CellPtrLessThan> &cells,
                    std::pair<Cell *, int> cell, bool bend);
-  bool deform(std::map<Cell *, int, Less_Cell> &cells,
-              std::map<Cell *, int, Less_Cell> &cellsInChain,
-              std::map<Cell *, int, Less_Cell> &cellsNotInChain);
-  void smoothenChain(std::map<Cell *, int, Less_Cell> &cells);
-  void eraseNullCells(std::map<Cell *, int, Less_Cell> &cells);
-  void deImmuneCells(std::map<Cell *, int, Less_Cell> &cells);
+  bool deform(std::map<Cell *, int, CellPtrLessThan> &cells,
+              std::map<Cell *, int, CellPtrLessThan> &cellsInChain,
+              std::map<Cell *, int, CellPtrLessThan> &cellsNotInChain);
+  void smoothenChain(std::map<Cell *, int, CellPtrLessThan> &cells);
+  void eraseNullCells(std::map<Cell *, int, CellPtrLessThan> &cells);
+  void deImmuneCells(std::map<Cell *, int, CellPtrLessThan> &cells);
 
 public:
   // domain = 0 : relative chain space
@@ -183,7 +183,7 @@ public:
   // Compute bases for the homology groups of this chain complex
   void computeHomology(bool dual = false);
 
-  typedef std::map<Cell *, int, Less_Cell>::iterator citer;
+  typedef std::map<Cell *, int, CellPtrLessThan>::iterator citer;
   citer firstCell(int dim) { return _cellIndices[dim].begin(); }
   citer lastCell(int dim) { return _cellIndices[dim].end(); }
   // get the cell index
@@ -202,7 +202,7 @@ public:
   // (deform: with local deformations to make chain smoother and to have
   // smaller support, deformed chain is homologous to the old one,
   // only works for chains of the primary chain complex)
-  void getBasisChain(std::map<Cell *, int, Less_Cell> &chain, int num, int dim,
+  void getBasisChain(std::map<Cell *, int, CellPtrLessThan> &chain, int num, int dim,
                      int basis, bool deform = false);
   // get rank of a basis
   int getBasisSize(int dim, int basis);
@@ -216,7 +216,7 @@ public:
       gmp_matrix_right_mult(_hbasis[dim], T);
     }
   }
-  // void printBasisChain(std::map<Cell*, int, Less_Cell>& chain);
+  // void printBasisChain(std::map<Cell*, int, CellPtrLessThan>& chain);
 
   // debugging aid
   int printMatrix(gmp_matrix *matrix)
diff --git a/Geo/GEntity.h b/Geo/GEntity.h
index 8ea56803dab40314e51150f52112957e51f22703..b0d43a7a436398545585e754676df93f18e04919 100644
--- a/Geo/GEntity.h
+++ b/Geo/GEntity.h
@@ -404,7 +404,7 @@ public:
   }
 };
 
-struct GEntityLessThan {
+struct GEntityPtrLessThan {
   bool operator()(GEntity const *const ent1, GEntity const *const ent2) const
   {
     return ent1->tag() < ent2->tag();
diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index 8a35c1e5ad634805b9cc6c3df808439ebf6ce60d..afa4a74ba11621bb47187d9b78e422006da9f251 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -789,7 +789,7 @@ void GFace::computeMeshSizeFieldAccuracy(double &avg, double &max_e,
                                          double &min_e, int &nE, int &GS)
 {
 #if defined(HAVE_MESH)
-  std::set<MEdge, Less_Edge> es;
+  std::set<MEdge, MEdgeLessThan> es;
   for(std::size_t i = 0; i < getNumMeshElements(); i++) {
     MElement *e = getMeshElement(i);
     for(int j = 0; j < e->getNumEdges(); j++) es.insert(e->getEdge(j));
@@ -802,7 +802,7 @@ void GFace::computeMeshSizeFieldAccuracy(double &avg, double &max_e,
   GS = 0;
   double oneoversqr2 = 1. / sqrt(2.);
   double sqr2 = sqrt(2.);
-  for(std::set<MEdge, Less_Edge>::const_iterator it = es.begin();
+  for(std::set<MEdge, MEdgeLessThan>::const_iterator it = es.begin();
       it != es.end(); ++it) {
     double u1, v1, u2, v2;
     MVertex *vert1 = it->getVertex(0);
@@ -1492,8 +1492,8 @@ static void meshCompound(GFace *gf, bool verbose)
 
   std::vector<GFace *> triangles_tag;
 
-  std::set<GEdge*, GEntityLessThan> bnd, emb1;
-  std::set<GVertex*, GEntityLessThan> emb0;
+  std::set<GEdge*, GEntityPtrLessThan> bnd, emb1;
+  std::set<GVertex*, GEntityPtrLessThan> emb0;
   for(std::size_t i = 0; i < gf->compound.size(); i++) {
     GFace *c = (GFace *)gf->compound[i];
     df->triangles.insert(df->triangles.end(), c->triangles.begin(),
@@ -1525,8 +1525,8 @@ static void meshCompound(GFace *gf, bool verbose)
     c->compoundSurface = df;
   }
 
-  std::set<GEdge*, GEntityLessThan> bndc;
-  for(std::set<GEdge*, GEntityLessThan>::iterator it = bnd.begin();
+  std::set<GEdge*, GEntityPtrLessThan> bndc;
+  for(std::set<GEdge*, GEntityPtrLessThan>::iterator it = bnd.begin();
       it != bnd.end(); it++){
     GEdge *e = *it;
     if(e->compoundCurve)
@@ -1537,11 +1537,11 @@ static void meshCompound(GFace *gf, bool verbose)
   std::vector<GEdge*> ed(bndc.begin(), bndc.end());
   df->set(ed);
 
-  for(std::set<GEdge*, GEntityLessThan>::iterator it = emb1.begin();
+  for(std::set<GEdge*, GEntityPtrLessThan>::iterator it = emb1.begin();
       it != emb1.end(); it++)
     df->addEmbeddedEdge(*it);
 
-  for(std::set<GVertex*, GEntityLessThan>::iterator it = emb0.begin();
+  for(std::set<GVertex*, GEntityPtrLessThan>::iterator it = emb0.begin();
       it != emb0.end(); it++)
     df->addEmbeddedVertex(*it);
 
@@ -1733,7 +1733,7 @@ void GFace::setMeshMaster(GFace *master, const std::vector<double> &tfo)
       m_vtxToEdge.insert(std::make_pair(std::make_pair(v0, v1), *eIter));
     }
   }
-  std::set<GVertex *, GEntityLessThan> m_embedded_vertices =
+  std::set<GVertex *, GEntityPtrLessThan> m_embedded_vertices =
     master->embeddedVertices();
   m_vertices.insert(m_embedded_vertices.begin(), m_embedded_vertices.end());
 
@@ -2228,7 +2228,7 @@ void GFace::alignElementsWithMaster()
   GEntity *master = getMeshMaster();
 
   if(master != this) {
-    std::set<MFace, Less_Face> srcFaces;
+    std::set<MFace, MFaceLessThan> srcFaces;
 
     for(std::size_t i = 0; i < master->getNumMeshElements(); i++) {
       MElement *face = master->getMeshElement(i);
@@ -2253,7 +2253,7 @@ void GFace::alignElementsWithMaster()
 
       MFace mf(vtcs);
 
-      std::set<MFace, Less_Face>::iterator sIter = srcFaces.find(mf);
+      std::set<MFace, MFaceLessThan>::iterator sIter = srcFaces.find(mf);
 
       if(sIter == srcFaces.end()) continue;
 
diff --git a/Geo/GFace.h b/Geo/GFace.h
index 382540160ea58a9ec629ef3bbabea98c0826f68b..0ec0e0a32d9b8b9bd399b23272e0d9ed476a4a2e 100644
--- a/Geo/GFace.h
+++ b/Geo/GFace.h
@@ -37,7 +37,7 @@ protected:
   GRegion *r1, *r2;
   mean_plane meanPlane;
   std::vector<GEdge *> embedded_edges;
-  std::set<GVertex *, GEntityLessThan> embedded_vertices;
+  std::set<GVertex *, GEntityPtrLessThan> embedded_vertices;
 
   BoundaryLayerColumns _columns;
 
@@ -120,7 +120,7 @@ public:
 
   // direct access to embedded entities
   std::vector<GEdge *> &embeddedEdges() { return embedded_edges; }
-  std::set<GVertex *, GEntityLessThan> &embeddedVertices()
+  std::set<GVertex *, GEntityPtrLessThan> &embeddedVertices()
   {
     return embedded_vertices;
   }
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 9a70bf9658bcf08301c172cb412387ab06df472a..1a72b7d0ee82a7a572460e82b22adb073a5516d7 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -172,19 +172,19 @@ void GModel::destroy(bool keepName)
 
   for(riter it = firstRegion(); it != lastRegion(); ++it) delete *it;
   regions.clear();
-  std::set<GRegion *, GEntityLessThan>().swap(regions);
+  std::set<GRegion *, GEntityPtrLessThan>().swap(regions);
 
   for(fiter it = firstFace(); it != lastFace(); ++it) delete *it;
   faces.clear();
-  std::set<GFace *, GEntityLessThan>().swap(faces);
+  std::set<GFace *, GEntityPtrLessThan>().swap(faces);
 
   for(eiter it = firstEdge(); it != lastEdge(); ++it) delete *it;
   edges.clear();
-  std::set<GEdge *, GEntityLessThan>().swap(edges);
+  std::set<GEdge *, GEntityPtrLessThan>().swap(edges);
 
   for(viter it = firstVertex(); it != lastVertex(); ++it) delete *it;
   vertices.clear();
-  std::set<GVertex *, GEntityLessThan>().swap(vertices);
+  std::set<GVertex *, GEntityPtrLessThan>().swap(vertices);
 
   destroyMeshCaches();
 
@@ -253,7 +253,7 @@ bool GModel::empty() const
 GRegion *GModel::getRegionByTag(int n) const
 {
   GEntity tmp((GModel *)this, n);
-  std::set<GRegion *, GEntityLessThan>::const_iterator it =
+  std::set<GRegion *, GEntityPtrLessThan>::const_iterator it =
     regions.find((GRegion *)&tmp);
   if(it != regions.end())
     return *it;
@@ -264,7 +264,7 @@ GRegion *GModel::getRegionByTag(int n) const
 GFace *GModel::getFaceByTag(int n) const
 {
   GEntity tmp((GModel *)this, n);
-  std::set<GFace *, GEntityLessThan>::const_iterator it =
+  std::set<GFace *, GEntityPtrLessThan>::const_iterator it =
     faces.find((GFace *)&tmp);
   if(it != faces.end())
     return *it;
@@ -275,7 +275,7 @@ GFace *GModel::getFaceByTag(int n) const
 GEdge *GModel::getEdgeByTag(int n) const
 {
   GEntity tmp((GModel *)this, n);
-  std::set<GEdge *, GEntityLessThan>::const_iterator it =
+  std::set<GEdge *, GEntityPtrLessThan>::const_iterator it =
     edges.find((GEdge *)&tmp);
   if(it != edges.end())
     return *it;
@@ -286,7 +286,7 @@ GEdge *GModel::getEdgeByTag(int n) const
 GVertex *GModel::getVertexByTag(int n) const
 {
   GEntity tmp((GModel *)this, n);
-  std::set<GVertex *, GEntityLessThan>::const_iterator it =
+  std::set<GVertex *, GEntityPtrLessThan>::const_iterator it =
     vertices.find((GVertex *)&tmp);
   if(it != vertices.end())
     return *it;
@@ -677,8 +677,8 @@ void GModel::getPhysicalGroups(
     for(std::map<int, std::vector<GEntity *> >::iterator it = group.begin();
         it != group.end(); ++it) {
       std::vector<GEntity *> &v = it->second;
-      std::sort(v.begin(), v.end(), GEntityLessThan());
-      std::unique(v.begin(), v.end(), GEntityLessThan());
+      std::sort(v.begin(), v.end(), GEntityPtrLessThan());
+      std::unique(v.begin(), v.end(), GEntityPtrLessThan());
     }
   }
 }
@@ -699,8 +699,8 @@ void GModel::getPhysicalGroups(
   for(std::map<int, std::vector<GEntity *> >::iterator it = groups.begin();
       it != groups.end(); ++it) {
     std::vector<GEntity *> &v = it->second;
-    std::sort(v.begin(), v.end(), GEntityLessThan());
-    std::unique(v.begin(), v.end(), GEntityLessThan());
+    std::sort(v.begin(), v.end(), GEntityPtrLessThan());
+    std::unique(v.begin(), v.end(), GEntityPtrLessThan());
   }
 }
 
@@ -923,12 +923,12 @@ bool GModel::setAllVolumesPositive()
 }
 
 static void
-addToMap(std::multimap<MFace, MElement *, Less_Face> &faceToElement,
+addToMap(std::multimap<MFace, MElement *, MFaceLessThan> &faceToElement,
          std::map<MElement *, std::vector<std::pair<MElement *, bool> > >
            &elToNeighbors,
          const MFace &face, MElement *el)
 {
-  std::multimap<MFace, MElement *, Less_Face>::iterator fit =
+  std::multimap<MFace, MElement *, MFaceLessThan>::iterator fit =
     faceToElement.find(face);
   if(fit == faceToElement.end()) {
     faceToElement.insert(std::pair<MFace, MElement *>(face, el));
@@ -960,7 +960,7 @@ addToMap(std::multimap<MFace, MElement *, Less_Face> &faceToElement,
 }
 
 static void
-checkConformity(std::multimap<MFace, MElement *, Less_Face> &faceToElement,
+checkConformity(std::multimap<MFace, MElement *, MFaceLessThan> &faceToElement,
                 std::map<MElement *, std::vector<std::pair<MElement *, bool> > >
                   &elToNeighbors,
                 const MFace &face, MElement *el)
@@ -995,7 +995,7 @@ void GModel::setAllVolumesPositiveTopology()
   Msg::Info("Orienting volumes according to topology");
   std::map<MElement *, std::vector<std::pair<MElement *, bool> > >
     elToNeighbors;
-  std::multimap<MFace, MElement *, Less_Face> faceToElement;
+  std::multimap<MFace, MElement *, MFaceLessThan> faceToElement;
 
   MElement *el;
   for(riter it = regions.begin(); it != regions.end(); ++it) {
@@ -2036,7 +2036,7 @@ void GModel::_storeVerticesInEntities(std::vector<MVertex *> &vertices)
 void GModel::pruneMeshVertexAssociations()
 {
   std::vector<GEntity *> entities;
-  std::set<MVertex *, MVertexLessThanNum> vertSet;
+  std::set<MVertex *, MVertexPtrLessThan> vertSet;
   getEntities(entities);
   for(std::size_t i = 0; i < entities.size(); i++) {
     for(std::size_t j = 0; j < entities[i]->mesh_vertices.size(); j++) {
@@ -2284,7 +2284,7 @@ void GModel::alignPeriodicBoundaries()
     if(src != NULL && src != tgt) {
       // compose a search list on master edge
 
-      std::map<MEdge, MLine *, Less_Edge> srcLines;
+      std::map<MEdge, MLine *, MEdgeLessThan> srcLines;
       for(std::size_t i = 0; i < src->getNumMeshElements(); i++) {
         MLine *srcLine = dynamic_cast<MLine *>(src->getMeshElement(i));
         if(!srcLine) {
@@ -2332,7 +2332,7 @@ void GModel::alignPeriodicBoundaries()
 
         MEdge tgtEdge(tgtVtcs[0], tgtVtcs[1]);
 
-        std::map<MEdge, MLine *, Less_Edge>::iterator sIter =
+        std::map<MEdge, MLine *, MEdgeLessThan>::iterator sIter =
           srcLines.find(tgtEdge);
 
         if(sIter == srcLines.end() || !sIter->second) {
@@ -2358,7 +2358,7 @@ void GModel::alignPeriodicBoundaries()
     GFace *tgt = *it;
     GFace *src = dynamic_cast<GFace *>(tgt->getMeshMaster());
     if(src != NULL && src != tgt) {
-      std::map<MFace, MElement *, Less_Face> srcElmts;
+      std::map<MFace, MElement *, MFaceLessThan> srcElmts;
 
       for(std::size_t i = 0; i < src->getNumMeshElements(); ++i) {
         MElement *srcElmt = src->getMeshElement(i);
@@ -2449,9 +2449,9 @@ void GModel::alignPeriodicBoundaries()
 
 static void
 connectMElementsByMFace(const MFace &f,
-                        std::multimap<MFace, MElement *, Less_Face> &e2f,
+                        std::multimap<MFace, MElement *, MFaceLessThan> &e2f,
                         std::set<MElement *> &group,
-                        std::set<MFace, Less_Face> &touched, int recur_level)
+                        std::set<MFace, MFaceLessThan> &touched, int recur_level)
 {
   // this is very slow...
   std::stack<MFace> _stack;
@@ -2462,7 +2462,7 @@ connectMElementsByMFace(const MFace &f,
     _stack.pop();
     if(touched.find(ff) == touched.end()) {
       touched.insert(ff);
-      for(std::multimap<MFace, MElement *, Less_Face>::iterator it =
+      for(std::multimap<MFace, MElement *, MFaceLessThan>::iterator it =
             e2f.lower_bound(ff);
           it != e2f.upper_bound(ff); ++it) {
         group.insert(it->second);
@@ -2477,7 +2477,7 @@ connectMElementsByMFace(const MFace &f,
 static int connectedVolumes(std::vector<MElement *> &elements,
                             std::vector<std::vector<MElement *> > &regs)
 {
-  std::multimap<MFace, MElement *, Less_Face> e2f;
+  std::multimap<MFace, MElement *, MFaceLessThan> e2f;
   for(std::size_t i = 0; i < elements.size(); ++i) {
     for(int j = 0; j < elements[i]->getNumFaces(); j++) {
       e2f.insert(std::make_pair(elements[i]->getFace(j), elements[i]));
@@ -2485,12 +2485,12 @@ static int connectedVolumes(std::vector<MElement *> &elements,
   }
   while(!e2f.empty()) {
     std::set<MElement *> group;
-    std::set<MFace, Less_Face> touched;
+    std::set<MFace, MFaceLessThan> touched;
     connectMElementsByMFace(e2f.begin()->first, e2f, group, touched, 0);
     std::vector<MElement *> temp;
     temp.insert(temp.begin(), group.begin(), group.end());
     regs.push_back(temp);
-    for(std::set<MFace, Less_Face>::iterator it = touched.begin();
+    for(std::set<MFace, MFaceLessThan>::iterator it = touched.begin();
         it != touched.end(); ++it)
       e2f.erase(*it);
   }
@@ -2498,8 +2498,8 @@ static int connectedVolumes(std::vector<MElement *> &elements,
 }
 
 static void connectMElementsByMEdge(
-  const MEdge &e, std::multimap<MEdge, MElement *, Less_Edge> &e2e,
-  std::set<MElement *> &group, std::set<MEdge, Less_Edge> &touched)
+  const MEdge &e, std::multimap<MEdge, MElement *, MEdgeLessThan> &e2e,
+  std::set<MElement *> &group, std::set<MEdge, MEdgeLessThan> &touched)
 {
   // this is very slow...
   std::stack<MEdge> _stack;
@@ -2510,7 +2510,7 @@ static void connectMElementsByMEdge(
     _stack.pop();
     if(touched.find(ee) == touched.end()) {
       touched.insert(ee);
-      for(std::multimap<MEdge, MElement *, Less_Edge>::iterator it =
+      for(std::multimap<MEdge, MElement *, MEdgeLessThan>::iterator it =
             e2e.lower_bound(ee);
           it != e2e.upper_bound(ee); ++it) {
         group.insert(it->second);
@@ -2525,7 +2525,7 @@ static void connectMElementsByMEdge(
 static int connectedSurfaces(std::vector<MElement *> &elements,
                              std::vector<std::vector<MElement *> > &faces)
 {
-  std::multimap<MEdge, MElement *, Less_Edge> e2e;
+  std::multimap<MEdge, MElement *, MEdgeLessThan> e2e;
   for(std::size_t i = 0; i < elements.size(); ++i) {
     for(int j = 0; j < elements[i]->getNumEdges(); j++) {
       e2e.insert(std::make_pair(elements[i]->getEdge(j), elements[i]));
@@ -2533,12 +2533,12 @@ static int connectedSurfaces(std::vector<MElement *> &elements,
   }
   while(!e2e.empty()) {
     std::set<MElement *> group;
-    std::set<MEdge, Less_Edge> touched;
+    std::set<MEdge, MEdgeLessThan> touched;
     connectMElementsByMEdge(e2e.begin()->first, e2e, group, touched);
     std::vector<MElement *> temp;
     temp.insert(temp.begin(), group.begin(), group.end());
     faces.push_back(temp);
-    for(std::set<MEdge, Less_Edge>::iterator it = touched.begin();
+    for(std::set<MEdge, MEdgeLessThan>::iterator it = touched.begin();
         it != touched.end(); ++it)
       e2e.erase(*it);
   }
@@ -2679,7 +2679,7 @@ makeSimplyConnected(std::map<int, std::vector<MElement *> > elements[11])
         elements[4].begin();
       it != elements[4].end(); it++)
     regs.push_back(it->first);
-  std::multimap<MFace, MElement *, Less_Face> f2e;
+  std::multimap<MFace, MElement *, MFaceLessThan> f2e;
   if(regs.size() > 2) {
     for(std::size_t i = 0; i < regs.size(); i++) {
       for(std::size_t j = 0; j < elements[4][regs[i]].size(); j++) {
@@ -2712,7 +2712,7 @@ makeSimplyConnected(std::map<int, std::vector<MElement *> > elements[11])
             MElement *el = conRegions[j][k];
             for(int l = 0; l < el->getNumFaces(); l++) {
               MFace mf = el->getFace(l);
-              std::multimap<MFace, MElement *, Less_Face>::iterator itl =
+              std::multimap<MFace, MElement *, MFaceLessThan>::iterator itl =
                 f2e.lower_bound(mf);
               for(; itl != f2e.upper_bound(mf); itl++) {
                 if(itl->second != el) break;
@@ -2760,7 +2760,7 @@ makeSimplyConnected(std::map<int, std::vector<MElement *> > elements[11])
         elements[2].begin();
       it != elements[2].end(); it++)
     faces.push_back(it->first);
-  std::multimap<MEdge, MElement *, Less_Edge> e2e;
+  std::multimap<MEdge, MElement *, MEdgeLessThan> e2e;
   if(faces.size() > 2) {
     for(std::size_t i = 0; i < faces.size(); i++) {
       for(std::size_t j = 0; j < elements[2][faces[i]].size(); j++) {
@@ -2793,7 +2793,7 @@ makeSimplyConnected(std::map<int, std::vector<MElement *> > elements[11])
             MElement *el = conSurfaces[j][k];
             for(int l = 0; l < el->getNumEdges(); l++) {
               MEdge me = el->getEdge(l);
-              std::multimap<MEdge, MElement *, Less_Edge>::iterator itl =
+              std::multimap<MEdge, MElement *, MEdgeLessThan>::iterator itl =
                 e2e.lower_bound(me);
               for(; itl != e2e.upper_bound(me); itl++) {
                 if(itl->second != el) break;
diff --git a/Geo/GModel.h b/Geo/GModel.h
index 2b73fc6021cada35b5b8b0f9bbae40726e035112..25bd3dbe2e65cb2831ca3a313bade61b0d509fcd 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -23,11 +23,11 @@
 // TODO C++11 remove this nasty stuff
 #if __cplusplus >= 201103L
 #include <unordered_map>
-#define hashmapMFace std::unordered_map<MFace, int, Hash_Face, Equal_Face>
-#define hashmapMEdge std::unordered_map<MEdge, int, Hash_Edge, Equal_Edge>
+#define hashmapMFace std::unordered_map<MFace, int, MFaceHash, MFaceEqual>
+#define hashmapMEdge std::unordered_map<MEdge, int, MEdgeHash, MEdgeEqual>
 #else
-#define hashmapMFace std::map<MFace, int, Less_Face>
-#define hashmapMEdge std::map<MEdge, int, Less_Edge>
+#define hashmapMFace std::map<MFace, int, MFaceLessThan>
+#define hashmapMEdge std::map<MEdge, int, MEdgeLessThan>
 #endif
 
 template <class scalar> class simpleFunction;
@@ -49,10 +49,10 @@ private:
   std::multimap<std::pair<const std::vector<int>, const std::vector<int> >,
                 std::pair<const std::string, const std::vector<int> > >
     _homologyRequests;
-  std::set<GRegion *, GEntityLessThan> _chainRegions;
-  std::set<GFace *, GEntityLessThan> _chainFaces;
-  std::set<GEdge *, GEntityLessThan> _chainEdges;
-  std::set<GVertex *, GEntityLessThan> _chainVertices;
+  std::set<GRegion *, GEntityPtrLessThan> _chainRegions;
+  std::set<GFace *, GEntityPtrLessThan> _chainFaces;
+  std::set<GEdge *, GEntityPtrLessThan> _chainEdges;
+  std::set<GVertex *, GEntityPtrLessThan> _chainVertices;
   hashmapMEdge _mapEdgeNum;
   hashmapMFace _mapFaceNum;
   // the maximum vertex and element id number in the mesh
@@ -138,10 +138,10 @@ protected:
 
   // the sets of geometrical regions, faces, edges and vertices in the
   // model
-  std::set<GRegion *, GEntityLessThan> regions;
-  std::set<GFace *, GEntityLessThan> faces;
-  std::set<GEdge *, GEntityLessThan> edges;
-  std::set<GVertex *, GEntityLessThan> vertices;
+  std::set<GRegion *, GEntityPtrLessThan> regions;
+  std::set<GFace *, GEntityPtrLessThan> faces;
+  std::set<GEdge *, GEntityPtrLessThan> edges;
+  std::set<GVertex *, GEntityPtrLessThan> vertices;
 
   // map between the pair <dimension, elementary or physical number>
   // and an optional associated name
@@ -187,15 +187,15 @@ protected:
 
 public:
   // region, face, edge and vertex iterators
-  typedef std::set<GRegion *, GEntityLessThan>::iterator riter;
-  typedef std::set<GFace *, GEntityLessThan>::iterator fiter;
-  typedef std::set<GEdge *, GEntityLessThan>::iterator eiter;
-  typedef std::set<GVertex *, GEntityLessThan>::iterator viter;
+  typedef std::set<GRegion *, GEntityPtrLessThan>::iterator riter;
+  typedef std::set<GFace *, GEntityPtrLessThan>::iterator fiter;
+  typedef std::set<GEdge *, GEntityPtrLessThan>::iterator eiter;
+  typedef std::set<GVertex *, GEntityPtrLessThan>::iterator viter;
 
-  typedef std::set<GRegion *, GEntityLessThan>::const_iterator const_riter;
-  typedef std::set<GFace *, GEntityLessThan>::const_iterator const_fiter;
-  typedef std::set<GEdge *, GEntityLessThan>::const_iterator const_eiter;
-  typedef std::set<GVertex *, GEntityLessThan>::const_iterator const_viter;
+  typedef std::set<GRegion *, GEntityPtrLessThan>::const_iterator const_riter;
+  typedef std::set<GFace *, GEntityPtrLessThan>::const_iterator const_fiter;
+  typedef std::set<GEdge *, GEntityPtrLessThan>::const_iterator const_eiter;
+  typedef std::set<GVertex *, GEntityPtrLessThan>::const_iterator const_viter;
 
   // elementary/physical name iterator
   typedef std::map<std::pair<int, int>, std::string>::iterator piter;
@@ -319,10 +319,10 @@ public:
   const_viter lastVertex() const { return vertices.end(); }
 
   // get the set of entities
-  std::set<GRegion *, GEntityLessThan> getRegions() const { return regions; };
-  std::set<GFace *, GEntityLessThan> getFaces() const { return faces; };
-  std::set<GEdge *, GEntityLessThan> getEdges() const { return edges; };
-  std::set<GVertex *, GEntityLessThan> getVertices() const { return vertices; };
+  std::set<GRegion *, GEntityPtrLessThan> getRegions() const { return regions; };
+  std::set<GFace *, GEntityPtrLessThan> getFaces() const { return faces; };
+  std::set<GEdge *, GEntityPtrLessThan> getEdges() const { return edges; };
+  std::set<GVertex *, GEntityPtrLessThan> getVertices() const { return vertices; };
 
   // find the entity with the given tag
   GRegion *getRegionByTag(int n) const;
diff --git a/Geo/GModelCreateTopologyFromMesh.cpp b/Geo/GModelCreateTopologyFromMesh.cpp
index 10e2da6edf89762fb9b66c47d9455302f9fc059a..94624aebf14cdb59bf9a8e3ef9258840cb88d9ad 100644
--- a/Geo/GModelCreateTopologyFromMesh.cpp
+++ b/Geo/GModelCreateTopologyFromMesh.cpp
@@ -128,8 +128,8 @@ void assignFace(GFace *gf, std::set<MElement *> &_f)
 
 void ensureManifoldFace(GFace *gf)
 {
-  std::map<MEdge, std::pair<MElement *, MElement *>, Less_Edge> _pairs;
-  std::set<MEdge, Less_Edge> _nonManifold;
+  std::map<MEdge, std::pair<MElement *, MElement *>, MEdgeLessThan> _pairs;
+  std::set<MEdge, MEdgeLessThan> _nonManifold;
 
   std::set<MElement *> _allFaces;
 
@@ -139,7 +139,7 @@ void ensureManifoldFace(GFace *gf)
     for(int j = 0; j < e->getNumEdges(); j++) {
       MEdge ed = e->getEdge(j);
       if(_nonManifold.find(ed) == _nonManifold.end()) {
-        std::map<MEdge, std::pair<MElement *, MElement *>, Less_Edge>::iterator
+        std::map<MEdge, std::pair<MElement *, MElement *>, MEdgeLessThan>::iterator
           it = _pairs.find(ed);
         if(it == _pairs.end()) {
           _pairs[ed] = std::make_pair(e, (MElement *)NULL);
@@ -170,7 +170,7 @@ void ensureManifoldFace(GFace *gf)
         MEdge ed = e->getEdge(j);
         if(_nonManifold.find(ed) == _nonManifold.end()) {
           std::map<MEdge, std::pair<MElement *, MElement *>,
-                   Less_Edge>::iterator it = _pairs.find(ed);
+                   MEdgeLessThan>::iterator it = _pairs.find(ed);
           if(it->second.second != NULL) {
             MElement *other =
               it->second.second == e ? it->second.first : it->second.second;
diff --git a/Geo/GModelIO_CGNS.cpp b/Geo/GModelIO_CGNS.cpp
index b0941b796cc0b87fc0496c5965e07adcc7eed716..d906fb1d349a23a7ddce7e8764f040b40c6a63dc 100644
--- a/Geo/GModelIO_CGNS.cpp
+++ b/Geo/GModelIO_CGNS.cpp
@@ -3375,10 +3375,10 @@ int GModel::writeCGNS(const std::string &name, int zoneDefinition,
     This may not be complete for special cases - for eg. periodic mesh info, if
     any, are not written.  */
 
-    std::set<GRegion *, GEntityLessThan> regions_set;
-    std::set<GFace *, GEntityLessThan> faces_set;
-    std::set<GEdge *, GEntityLessThan> edges_set;
-    std::set<GVertex *, GEntityLessThan> vertices_set;
+    std::set<GRegion *, GEntityPtrLessThan> regions_set;
+    std::set<GFace *, GEntityPtrLessThan> faces_set;
+    std::set<GEdge *, GEntityPtrLessThan> edges_set;
+    std::set<GVertex *, GEntityPtrLessThan> vertices_set;
 
     for(GModel::viter it = this->firstVertex(); it != this->lastVertex(); ++it)
       vertices_set.insert(*it);
diff --git a/Geo/GModelIO_MSH4.cpp b/Geo/GModelIO_MSH4.cpp
index e51cc8bb1c436ecdbc07ad16f1c88372e3386913..8db8e5b95af6478171df6363f974925cf7608b92 100644
--- a/Geo/GModelIO_MSH4.cpp
+++ b/Geo/GModelIO_MSH4.cpp
@@ -1554,11 +1554,11 @@ static void writeMSH4BoundingBox(SBoundingBox3d boundBox, FILE *fp,
 static void writeMSH4Entities(GModel *const model, FILE *fp, bool partition,
                               bool binary, double scalingFactor, double version)
 {
-  std::set<GEntity *, GEntityLessThan> ghost;
-  std::set<GRegion *, GEntityLessThan> regions;
-  std::set<GFace *, GEntityLessThan> faces;
-  std::set<GEdge *, GEntityLessThan> edges;
-  std::set<GVertex *, GEntityLessThan> vertices;
+  std::set<GEntity *, GEntityPtrLessThan> ghost;
+  std::set<GRegion *, GEntityPtrLessThan> regions;
+  std::set<GFace *, GEntityPtrLessThan> faces;
+  std::set<GEdge *, GEntityPtrLessThan> edges;
+  std::set<GVertex *, GEntityPtrLessThan> vertices;
 
   if(partition) {
     for(GModel::viter it = model->firstVertex(); it != model->lastVertex();
@@ -1614,7 +1614,7 @@ static void writeMSH4Entities(GModel *const model, FILE *fp, bool partition,
       if(ghostSize) {
         tags.resize(2 * ghostSize);
         int index = 0;
-        for(std::set<GEntity *, GEntityLessThan>::iterator it = ghost.begin();
+        for(std::set<GEntity *, GEntityPtrLessThan>::iterator it = ghost.begin();
             it != ghost.end(); ++it) {
           if((*it)->geomType() == GEntity::GhostCurve) {
             tags[index] = (*it)->tag();
@@ -1803,7 +1803,7 @@ static void writeMSH4Entities(GModel *const model, FILE *fp, bool partition,
       if(ghostSize) {
         tags.resize(2 * ghostSize);
         int index = 0;
-        for(std::set<GEntity *, GEntityLessThan>::iterator it = ghost.begin();
+        for(std::set<GEntity *, GEntityPtrLessThan>::iterator it = ghost.begin();
             it != ghost.end(); ++it) {
           if((*it)->geomType() == GEntity::GhostCurve) {
             tags[index] = (*it)->tag();
@@ -2048,19 +2048,19 @@ static void writeMSH4EntityNodes(GEntity *ge, FILE *fp, bool binary,
 }
 
 static std::size_t
-getAdditionalEntities(std::set<GRegion *, GEntityLessThan> &regions,
-                      std::set<GFace *, GEntityLessThan> &faces,
-                      std::set<GEdge *, GEntityLessThan> &edges,
-                      std::set<GVertex *, GEntityLessThan> &vertices)
+getAdditionalEntities(std::set<GRegion *, GEntityPtrLessThan> &regions,
+                      std::set<GFace *, GEntityPtrLessThan> &faces,
+                      std::set<GEdge *, GEntityPtrLessThan> &edges,
+                      std::set<GVertex *, GEntityPtrLessThan> &vertices)
 {
   std::size_t numVertices = 0;
 
-  for(std::set<GVertex *, GEntityLessThan>::iterator it = vertices.begin();
+  for(std::set<GVertex *, GEntityPtrLessThan>::iterator it = vertices.begin();
       it != vertices.end(); ++it) {
     numVertices += (*it)->getNumMeshVertices();
   }
 
-  for(std::set<GEdge *, GEntityLessThan>::iterator it = edges.begin();
+  for(std::set<GEdge *, GEntityPtrLessThan>::iterator it = edges.begin();
       it != edges.end(); ++it) {
     numVertices += (*it)->getNumMeshVertices();
     for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++) {
@@ -2102,7 +2102,7 @@ getAdditionalEntities(std::set<GRegion *, GEntityLessThan> &regions,
     }
   }
 
-  for(std::set<GFace *, GEntityLessThan>::iterator it = faces.begin();
+  for(std::set<GFace *, GEntityPtrLessThan>::iterator it = faces.begin();
       it != faces.end(); ++it) {
     numVertices += (*it)->getNumMeshVertices();
     for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++) {
@@ -2144,7 +2144,7 @@ getAdditionalEntities(std::set<GRegion *, GEntityLessThan> &regions,
     }
   }
 
-  for(std::set<GRegion *, GEntityLessThan>::iterator it = regions.begin();
+  for(std::set<GRegion *, GEntityPtrLessThan>::iterator it = regions.begin();
       it != regions.end(); ++it) {
     numVertices += (*it)->getNumMeshVertices();
     for(std::size_t i = 0; i < (*it)->getNumMeshElements(); i++) {
@@ -2191,10 +2191,10 @@ getAdditionalEntities(std::set<GRegion *, GEntityLessThan> &regions,
 
 static std::size_t
 getEntitiesForNodes(GModel *const model, bool partitioned, bool saveAll,
-                    std::set<GRegion *, GEntityLessThan> &regions,
-                    std::set<GFace *, GEntityLessThan> &faces,
-                    std::set<GEdge *, GEntityLessThan> &edges,
-                    std::set<GVertex *, GEntityLessThan> &vertices)
+                    std::set<GRegion *, GEntityPtrLessThan> &regions,
+                    std::set<GFace *, GEntityPtrLessThan> &faces,
+                    std::set<GEdge *, GEntityPtrLessThan> &edges,
+                    std::set<GVertex *, GEntityPtrLessThan> &vertices)
 {
   if(partitioned) {
     for(GModel::viter it = model->firstVertex(); it != model->lastVertex();
@@ -2255,10 +2255,10 @@ static void writeMSH4Nodes(GModel *const model, FILE *fp, bool partitioned,
                            bool binary, int saveParametric,
                            double scalingFactor, bool saveAll, double version)
 {
-  std::set<GRegion *, GEntityLessThan> regions;
-  std::set<GFace *, GEntityLessThan> faces;
-  std::set<GEdge *, GEntityLessThan> edges;
-  std::set<GVertex *, GEntityLessThan> vertices;
+  std::set<GRegion *, GEntityPtrLessThan> regions;
+  std::set<GFace *, GEntityPtrLessThan> faces;
+  std::set<GEdge *, GEntityPtrLessThan> edges;
+  std::set<GVertex *, GEntityPtrLessThan> vertices;
   std::size_t numNodes = getEntitiesForNodes(model, partitioned, saveAll,
                                              regions, faces, edges, vertices);
 
@@ -2338,10 +2338,10 @@ static void writeMSH4Nodes(GModel *const model, FILE *fp, bool partitioned,
 static void writeMSH4Elements(GModel *const model, FILE *fp, bool partitioned,
                               bool binary, bool saveAll, double version)
 {
-  std::set<GRegion *, GEntityLessThan> regions;
-  std::set<GFace *, GEntityLessThan> faces;
-  std::set<GEdge *, GEntityLessThan> edges;
-  std::set<GVertex *, GEntityLessThan> vertices;
+  std::set<GRegion *, GEntityPtrLessThan> regions;
+  std::set<GFace *, GEntityPtrLessThan> faces;
+  std::set<GEdge *, GEntityPtrLessThan> edges;
+  std::set<GVertex *, GEntityPtrLessThan> vertices;
 
   if(partitioned) {
     for(GModel::viter it = model->firstVertex(); it != model->lastVertex();
diff --git a/Geo/GModelIO_STL.cpp b/Geo/GModelIO_STL.cpp
index b28cd94c8f064bd0936d0d0d2019139e4e9db9a4..dcc66b1e661f113aee2e85833cb2c9fcfa557ba6 100644
--- a/Geo/GModelIO_STL.cpp
+++ b/Geo/GModelIO_STL.cpp
@@ -180,7 +180,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
   MVertexRTree pos(eps);
   pos.insert(vertices);
 
-  std::set<MFace, Less_Face> unique;
+  std::set<MFace, MFaceLessThan> unique;
   int nbDuplic = 0, nbDegen = 0;
   for(std::size_t i = 0; i < points.size(); i++) {
     for(std::size_t j = 0; j < points[i].size(); j += 3) {
diff --git a/Geo/GModelParametrize.cpp b/Geo/GModelParametrize.cpp
index 63841ea9d1289ebbc3ed468a086957dda725e05c..6d943ec847a91e0547ca22ce1b73899bfc960a18 100644
--- a/Geo/GModelParametrize.cpp
+++ b/Geo/GModelParametrize.cpp
@@ -69,7 +69,7 @@ getModelEdge(GModel *gm, std::vector<GFace *> &gfs,
 #endif
 
 static void addTriangle(MTriangle *t,
-                        std::map<MEdge, std::vector<MTriangle *>, Less_Edge> &tris)
+                        std::map<MEdge, std::vector<MTriangle *>, MEdgeLessThan> &tris)
 {
   for(int i = 0; i < 3; i++) {
     MEdge e = t->getEdge(i);
@@ -125,7 +125,7 @@ void classifyFaces(GModel *gm, double curveAngleThreshold)
 
   // create a structure from mesh edges to geometrical curves, and remove curves
   // from the model
-  std::set<MLine *, compareMLinePtr> lines;
+  std::set<MLine *, MLinePtrLessThan> lines;
   std::vector<GEdge *> edgesToRemove;
   for(GModel::eiter it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
     for(std::size_t i = 0; i < (*it)->lines.size(); i++) {
@@ -148,7 +148,7 @@ void classifyFaces(GModel *gm, double curveAngleThreshold)
 
   // create triangle-triangle connections
   std::map<MTriangle *, GFace *> reverse_old;
-  std::map<MEdge, std::vector<MTriangle *>, Less_Edge> tris;
+  std::map<MEdge, std::vector<MTriangle *>, MEdgeLessThan> tris;
   std::set<MTriangle *> touched;
   for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); it++){
     GFace *gf = *it;
@@ -191,14 +191,14 @@ void classifyFaces(GModel *gm, double curveAngleThreshold)
         st.pop();
         for(int i = 0; i < 3; i++) {
           MEdge e = t->getEdge(i);
-          std::map<MEdge, std::vector<MTriangle *>, Less_Edge>::iterator it =
+          std::map<MEdge, std::vector<MTriangle *>, MEdgeLessThan>::iterator it =
             tris.find(e);
           if(it == tris.end()) {
             Msg::Error("Could not find triangle linked to edge");
             break;
           }
           MLine ll(e.getVertex(0), e.getVertex(1));
-          std::set<MLine *, compareMLinePtr>::iterator itl = lines.find(&ll);
+          std::set<MLine *, MLinePtrLessThan>::iterator itl = lines.find(&ll);
           if(itl == lines.end()) {
             MTriangle *tt = it->second[0] == t ? it->second[1] : it->second[0];
             std::set<MTriangle *>::iterator it2 = touched.find(tt);
@@ -238,11 +238,11 @@ void classifyFaces(GModel *gm, double curveAngleThreshold)
 
   std::vector<std::pair<GEdge *, std::vector<GFace *> > > newEdges;
   {
-    std::map<MEdge, std::vector<MTriangle *>, Less_Edge>::iterator it =
+    std::map<MEdge, std::vector<MTriangle *>, MEdgeLessThan>::iterator it =
       tris.begin();
     for(; it != tris.end(); ++it) {
       MLine ml(it->first.getVertex(0), it->first.getVertex(1));
-      std::set<MLine *, compareMLinePtr>::iterator itl = lines.find(&ml);
+      std::set<MLine *, MLinePtrLessThan>::iterator itl = lines.find(&ml);
       if(itl != lines.end()) {
         std::vector<GFace *> faces;
         for(size_t i = 0; i < it->second.size(); ++i)
@@ -365,8 +365,8 @@ void classifyFaces(GModel *gm, double curveAngleThreshold)
   }
 
   // delete empty mesh faces and reclasssify
-  std::set<GFace *, GEntityLessThan> fac = gm->getFaces();
-  for(std::set<GFace *, GEntityLessThan>::iterator fit = fac.begin();
+  std::set<GFace *, GEntityPtrLessThan> fac = gm->getFaces();
+  for(std::set<GFace *, GEntityPtrLessThan>::iterator fit = fac.begin();
       fit != fac.end(); ++fit) {
     std::set<MVertex *> verts;
     (*fit)->mesh_vertices.clear();
@@ -625,20 +625,20 @@ int isTriangulationParametrizable(const std::vector<MTriangle *> &t, int Nmax,
     return XX / Nmax + 1;
   }
   std::set<MVertex *> v;
-  std::map<MEdge, int, Less_Edge> e;
+  std::map<MEdge, int, MEdgeLessThan> e;
   double surf = 0;
   for(std::size_t i = 0; i < t.size(); ++i) {
     surf += t[i]->getVolume();
     for(int j = 0; j < 3; j++) {
       v.insert(t[i]->getVertex(j));
-      std::map<MEdge, int, Less_Edge>::iterator it = e.find(t[i]->getEdge(j));
+      std::map<MEdge, int, MEdgeLessThan>::iterator it = e.find(t[i]->getEdge(j));
       if(it == e.end())
         e[t[i]->getEdge(j)] = 1;
       else
         it->second++;
     }
   }
-  std::map<MEdge, int, Less_Edge>::iterator it = e.begin();
+  std::map<MEdge, int, MEdgeLessThan>::iterator it = e.begin();
   std::vector<MEdge> _bnd;
   for(; it != e.end(); ++it) {
     if(it->second == 1) _bnd.push_back(it->first);
@@ -753,8 +753,8 @@ int isTriangulationParametrizable(const std::vector<MTriangle *> &t, int Nmax,
 
 void makeMLinesUnique(std::vector<MLine *> &v)
 {
-  std::sort(v.begin(), v.end(), compareMLinePtr());
-  v.erase(std::unique(v.begin(), v.end(), equalMLinePtr()), v.end());
+  std::sort(v.begin(), v.end(), MLinePtrLessThan());
+  v.erase(std::unique(v.begin(), v.end(), MLinePtrEqual()), v.end());
 }
 
 class twoT {
@@ -773,11 +773,11 @@ static bool
 makePartitionSimplyConnected(std::vector<MTriangle *> &t,
                              std::vector<std::vector<MTriangle *> > &ts)
 {
-  std::map<MEdge, twoT, Less_Edge> conn;
+  std::map<MEdge, twoT, MEdgeLessThan> conn;
   for(std::size_t i = 0; i < t.size(); i++) {
     for(int j = 0; j < 3; j++) {
       MEdge e = t[i]->getEdge(j);
-      std::map<MEdge, twoT, Less_Edge>::iterator it = conn.find(e);
+      std::map<MEdge, twoT, MEdgeLessThan>::iterator it = conn.find(e);
       twoT twt(t[i]);
       if(it == conn.end())
         conn.insert(std::make_pair(e, twt));
@@ -796,7 +796,7 @@ makePartitionSimplyConnected(std::vector<MTriangle *> &t,
       _s.pop();
       for(int j = 0; j < 3; j++) {
         MEdge e = x->getEdge(j);
-        std::map<MEdge, twoT, Less_Edge>::iterator it = conn.find(e);
+        std::map<MEdge, twoT, MEdgeLessThan>::iterator it = conn.find(e);
         if(it->second.t2) {
           MTriangle *tt = it->second.other(x);
           if(!tt) return false; // FIXME
@@ -845,7 +845,7 @@ void computeEdgeCut(GModel *gm, std::vector<MLine *> &cut,
     if((*it)->triangles.empty()) continue;
     std::vector<MVertex *> verts = (*it)->mesh_vertices;
     std::map<MTriangle *, int> global;
-    std::map<MEdge, int, Less_Edge> cuts;
+    std::map<MEdge, int, MEdgeLessThan> cuts;
     std::stack<std::vector<MTriangle *> > partitions;
     std::stack<int> _levels;
     partitions.push((*it)->triangles);
@@ -915,7 +915,7 @@ void computeEdgeCut(GModel *gm, std::vector<MLine *> &cut,
       (*it)->triangles.push_back(t);
       for(int i = 0; i < 3; i++) {
         MEdge ed = t->getEdge(i);
-        std::map<MEdge, int, Less_Edge>::iterator it3 = cuts.find(ed);
+        std::map<MEdge, int, MEdgeLessThan>::iterator it3 = cuts.find(ed);
         if(it3 == cuts.end())
           cuts[ed] = it2->second;
         else {
@@ -932,11 +932,11 @@ void computeEdgeCut(GModel *gm, std::vector<MLine *> &cut,
 void computeNonManifoldEdges(GModel *gm, std::vector<MLine *> &cut,
                              bool addBoundary)
 {
-  std::map<MEdge, int, Less_Edge> m;
+  std::map<MEdge, int, MEdgeLessThan> m;
   for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
     for(std::size_t i = 0; i < (*it)->triangles.size(); i++) {
       for(int j = 0; j < 3; j++) {
-        std::map<MEdge, int, Less_Edge>::iterator it2 =
+        std::map<MEdge, int, MEdgeLessThan>::iterator it2 =
           m.find((*it)->triangles[i]->getEdge(j));
         if(it2 == m.end())
           m[(*it)->triangles[i]->getEdge(j)] = 1;
@@ -947,7 +947,7 @@ void computeNonManifoldEdges(GModel *gm, std::vector<MLine *> &cut,
   }
   {
     int countNM = 0, countBND = 0;
-    std::map<MEdge, int, Less_Edge>::iterator it = m.begin();
+    std::map<MEdge, int, MEdgeLessThan>::iterator it = m.begin();
     for(; it != m.end(); ++it) {
       if(it->second > 2) {
         cut.push_back(
diff --git a/Geo/Homology.cpp b/Geo/Homology.cpp
index 02eb954aec8c618d625133c4ecfd3ee75970555c..a392912366dcf6e06db8ed20d0635fa6299c440e 100644
--- a/Geo/Homology.cpp
+++ b/Geo/Homology.cpp
@@ -207,7 +207,7 @@ void Homology::findHomologyBasis(std::vector<int> dim)
       std::string generator = convertInt(i);
 
       std::string name = "H_" + dimension + domain + generator;
-      std::map<Cell *, int, Less_Cell> chain;
+      std::map<Cell *, int, CellPtrLessThan> chain;
       chainComplex.getBasisChain(chain, i, j, 3, _smoothen);
       int torsion = chainComplex.getTorsion(j, i);
       if(!chain.empty()) {
@@ -296,7 +296,7 @@ void Homology::findCohomologyBasis(std::vector<int> dim)
       std::string generator = convertInt(i);
 
       std::string name = "H^" + dimension + domain + generator;
-      std::map<Cell *, int, Less_Cell> chain;
+      std::map<Cell *, int, CellPtrLessThan> chain;
       chainComplex.getBasisChain(chain, i, j, 3, false);
       int torsion = chainComplex.getTorsion(j, i);
       if(!chain.empty()) {
@@ -577,7 +577,7 @@ int Homology::eulerCharacteristic()
   return _cellComplex->eulerCharacteristic();
 }
 
-void Homology::_createChain(std::map<Cell *, int, Less_Cell> &preChain,
+void Homology::_createChain(std::map<Cell *, int, CellPtrLessThan> &preChain,
                             const std::string &name, bool co)
 {
   Chain<int> *chain = new Chain<int>();
@@ -646,7 +646,7 @@ void Homology::storeCells(CellComplex *cellComplex, int dim)
   for(CellComplex::citer cit = cellComplex->firstCell(dim);
       cit != cellComplex->lastCell(dim); cit++) {
     Cell *cell = *cit;
-    std::map<Cell *, int, Less_Cell> cells;
+    std::map<Cell *, int, CellPtrLessThan> cells;
     cell->getCells(cells);
     for(Cell::citer it = cells.begin(); it != cells.end(); it++) {
       Cell *subCell = it->first;
diff --git a/Geo/Homology.h b/Geo/Homology.h
index 53a820c083af7104ca9fed60dc40362bb7cc44c0..5e181f3f4f65d86ec977f031eba6d65c87f797d3 100644
--- a/Geo/Homology.h
+++ b/Geo/Homology.h
@@ -67,7 +67,7 @@ private:
   std::vector<Chain<int> *> _chains[4];
   std::vector<Chain<int> *> _cochains[4];
 
-  typedef std::map<Cell *, int, Less_Cell>::iterator citer;
+  typedef std::map<Cell *, int, CellPtrLessThan>::iterator citer;
 
   void _getEntities(const std::vector<int> &physicalGroups,
                     std::vector<GEntity *> &entities);
@@ -82,7 +82,7 @@ private:
   void _createCellComplex();
 
   // create and store a chain from homology solver result
-  void _createChain(std::map<Cell *, int, Less_Cell> &preChain,
+  void _createChain(std::map<Cell *, int, CellPtrLessThan> &preChain,
                     const std::string &name, bool co);
 
   void _deleteChains(std::vector<int> dim = vecN0(4));
diff --git a/Geo/MEdge.cpp b/Geo/MEdge.cpp
index e83831d37e602b4dfe4cb053b1903a389dfb7d7e..1fb5a85f280255791adc25d93fdaaa7449c88266 100644
--- a/Geo/MEdge.cpp
+++ b/Geo/MEdge.cpp
@@ -15,10 +15,10 @@
 // remove that when MElementCut is removed
 bool MEdge::isInside(MVertex *v) const
 {
-  double tol = MVertexLessThanLexicographic::getTolerance();
+  double tol = MVertexPtrLessThanLexicographic::getTolerance();
   MVertex *v0 = _v[0];
   MVertex *v1 = _v[1];
-  MVertexLessThanLexicographic lt;
+  MVertexPtrLessThanLexicographic lt;
   if(lt(v0, v1)) {
     v0 = _v[1];
     v1 = _v[0];
diff --git a/Geo/MEdge.h b/Geo/MEdge.h
index 6fd303a8633f214a5f15ef1a7c26dd85e9c3f46a..a17870901f53d6598235fd3fae33a85a37d014a7 100644
--- a/Geo/MEdge.h
+++ b/Geo/MEdge.h
@@ -115,14 +115,14 @@ inline bool operator!=(const MEdge &e1, const MEdge &e2)
           e1.getMaxVertex() != e2.getMaxVertex());
 }
 
-struct Equal_Edge {
+struct MEdgeEqual {
   bool operator()(const MEdge &e1, const MEdge &e2) const
   {
     return (e1 == e2);
   }
 };
 
-struct Less_Edge {
+struct MEdgeLessThan {
   bool operator()(const MEdge &e1, const MEdge &e2) const
   {
     if(e1.getMinVertex()->getNum() < e2.getMinVertex()->getNum()) return true;
diff --git a/Geo/MEdgeHash.h b/Geo/MEdgeHash.h
index 52ed245c43787e0d41d2a0c1ada3048f1d468133..eb350724f8835d22a228908c2d4f73b398c8397c 100644
--- a/Geo/MEdgeHash.h
+++ b/Geo/MEdgeHash.h
@@ -9,7 +9,7 @@
 #include "MEdge.h"
 #include "Hash.h"
 
-struct Hash_Edge : public std::unary_function<MEdge, size_t> {
+struct MEdgeHash : public std::unary_function<MEdge, size_t> {
   size_t operator()(const MEdge &e) const
   {
     const MVertex *v[2];
diff --git a/Geo/MElement.h b/Geo/MElement.h
index 4e6c5fb5478a7778004788a23d8983f5e99359ef..8724e25e1c4e2886caa3b3c91cf968815250d02c 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -555,7 +555,7 @@ template <> struct DimTr<3> {
   }
 };
 
-struct Less_ElementPtr {
+struct MElementPtrLessThan {
   bool operator()(const MElement *e1, const MElement *e2) const
   {
     return e1->getNum() < e2->getNum();
diff --git a/Geo/MElementCut.cpp b/Geo/MElementCut.cpp
index 6217451b43b42c441f1b0104eb0ea515c440ef1b..2544d0b63cf1dec3bc3ebf3e6826aef43ff1e5e2 100644
--- a/Geo/MElementCut.cpp
+++ b/Geo/MElementCut.cpp
@@ -828,7 +828,7 @@ static int getElementVertexNum(DI_Point *p, MElement *e)
   return -1;
 }
 
-typedef std::set<MVertex *, MVertexLessThanLexicographic> newVerticesContainer;
+typedef std::set<MVertex *, MVertexPtrLessThanLexicographic> newVerticesContainer;
 
 static void elementCutMesh(
   MElement *e, std::vector<gLevelset *> &RPN, fullMatrix<double> &verticesLs,
diff --git a/Geo/MFace.h b/Geo/MFace.h
index fdd8f47b7a2ec8f2f62ede8ad3191572d1c83c38..7e0cf74dd51b5e57faab8008730fb86bfe8ad8ea 100644
--- a/Geo/MFace.h
+++ b/Geo/MFace.h
@@ -122,11 +122,11 @@ inline bool operator!=(const MFace &f1, const MFace &f2)
   return false;
 }
 
-struct Equal_Face : public std::binary_function<MFace, MFace, bool> {
+struct MFaceEqual : public std::binary_function<MFace, MFace, bool> {
   bool operator()(const MFace &f1, const MFace &f2) const { return (f1 == f2); }
 };
 
-struct Less_Face : public std::binary_function<MFace, MFace, bool> {
+struct MFaceLessThan : public std::binary_function<MFace, MFace, bool> {
   bool operator()(const MFace &f1, const MFace &f2) const
   {
     if(f1.getNumVertices() != f2.getNumVertices())
diff --git a/Geo/MFaceHash.h b/Geo/MFaceHash.h
index ad855613473cacc26e333f066b7554c5703c5bc2..698d1efa6afcde630d44697314f275dc86f792ac 100644
--- a/Geo/MFaceHash.h
+++ b/Geo/MFaceHash.h
@@ -9,7 +9,7 @@
 #include "MFace.h"
 #include "Hash.h"
 
-struct Hash_Face : public std::unary_function<MFace, size_t> {
+struct MFaceHash : public std::unary_function<MFace, size_t> {
   size_t operator()(const MFace &f) const
   {
     const MVertex *v[4] = {0, 0, 0, 0};
diff --git a/Geo/MLine.h b/Geo/MLine.h
index 051bb2fcf4b45ed5b37057b0439569698b7f107a..223b840d1569875025f057d67f71e2fc2680b418 100644
--- a/Geo/MLine.h
+++ b/Geo/MLine.h
@@ -288,18 +288,18 @@ public:
                           std::vector<double> &ts);
 };
 
-struct compareMLinePtr {
+struct MLinePtrLessThan {
   bool operator()(MLine *l1, MLine *l2) const
   {
-    static Less_Edge le;
+    static MEdgeLessThan le;
     return le(l1->getEdge(0), l2->getEdge(0));
   }
 };
 
-struct equalMLinePtr {
+struct MLinePtrEqual {
   bool operator()(MLine *l1, MLine *l2) const
   {
-    static Equal_Edge le;
+    static MEdgeEqual le;
     return le(l1->getEdge(0), l2->getEdge(0));
   }
 };
diff --git a/Geo/MVertex.cpp b/Geo/MVertex.cpp
index 2ceff731081f71e58100fdf5fcec9b4f2981359c..de42fe3c9db03e560644e2bb3504ca0c358dc989 100644
--- a/Geo/MVertex.cpp
+++ b/Geo/MVertex.cpp
@@ -405,12 +405,12 @@ void MVertex::writeSU2(FILE *fp, int dim, double scalingFactor)
             y() * scalingFactor, z() * scalingFactor, _index - 1);
 }
 
-double MVertexLessThanLexicographic::tolerance = 1.e-6;
+double MVertexPtrLessThanLexicographic::tolerance = 1.e-6;
 
-double MVertexLessThanLexicographic::getTolerance() { return tolerance; }
+double MVertexPtrLessThanLexicographic::getTolerance() { return tolerance; }
 
-bool MVertexLessThanLexicographic::operator()(const MVertex *v1,
-                                              const MVertex *v2) const
+bool MVertexPtrLessThanLexicographic::operator()(const MVertex *v1,
+                                                 const MVertex *v2) const
 {
   // you should not use this unless you know what you are doing; to create
   // unique vertices, use MVertexRTree
diff --git a/Geo/MVertex.h b/Geo/MVertex.h
index 1c9feecbb0e3b95a008c6a09d57b1cbd6f6e4464..b0083729badc0aa170523a85de01e175712bfb20 100644
--- a/Geo/MVertex.h
+++ b/Geo/MVertex.h
@@ -198,7 +198,7 @@ public:
   }
 };
 
-class MVertexLessThanLexicographic {
+class MVertexPtrLessThanLexicographic {
   static double tolerance;
 
 public:
@@ -206,13 +206,27 @@ public:
   bool operator()(const MVertex *v1, const MVertex *v2) const;
 };
 
-struct MVertexLessThanNum {
+struct MVertexPtrLessThan {
   bool operator()(const MVertex *v1, const MVertex *v2) const
   {
     return v1->getNum() < v2->getNum();
   }
 };
 
+struct MVertexPtrEqual {
+  bool operator()(const MVertex *v1, const MVertex *v2) const
+  {
+    return v1->getNum() == v2->getNum();
+  }
+};
+
+struct MVertexPtrHash {
+  size_t operator()(const MVertex *v) const
+  {
+    return v->getNum();
+  }
+};
+
 bool reparamMeshEdgeOnFace(MVertex *v1, MVertex *v2, GFace *gf, SPoint2 &param1,
                            SPoint2 &param2);
 bool reparamMeshVertexOnFace(MVertex const *v, const GFace *gf, SPoint2 &param,
diff --git a/Geo/boundaryLayersData.cpp b/Geo/boundaryLayersData.cpp
index 71411090ccaedeff198dc9ec6f1af77b236437eb..ba335124d9609bfa76d4059ca7e7458737d44be2 100644
--- a/Geo/boundaryLayersData.cpp
+++ b/Geo/boundaryLayersData.cpp
@@ -53,7 +53,7 @@ SVector3 interiorNormal(const SPoint2 &p1, const SPoint2 &p2, const SPoint2 &p3)
 
 edgeColumn BoundaryLayerColumns::getColumns(MVertex *v1, MVertex *v2, int side)
 {
-  Equal_Edge aaa;
+  MEdgeEqual aaa;
   MEdge e(v1, v2);
   std::map<MVertex *, BoundaryLayerFan>::const_iterator it1 = _fans.find(v1);
   std::map<MVertex *, BoundaryLayerFan>::const_iterator it2 = _fans.find(v2);
@@ -158,11 +158,11 @@ static void treat2Connections(GFace *gf, MVertex *_myVert, MEdge &e1, MEdge &e2,
                               std::vector<SVector3> &_dirs, bool fan)
 {
   std::vector<SVector3> N1, N2;
-  for(std::multimap<MEdge, SVector3, Less_Edge>::iterator itm =
+  for(std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm =
         _columns->_normals.lower_bound(e1);
       itm != _columns->_normals.upper_bound(e1); ++itm)
     N1.push_back(itm->second);
-  for(std::multimap<MEdge, SVector3, Less_Edge>::iterator itm =
+  for(std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm =
         _columns->_normals.lower_bound(e2);
       itm != _columns->_normals.upper_bound(e2); ++itm)
     N2.push_back(itm->second);
@@ -224,15 +224,15 @@ static void treat3Connections(GFace *gf, MVertex *_myVert, MEdge &e1, MEdge &e2,
                               std::vector<SVector3> &_dirs)
 {
   std::vector<SVector3> N1, N2, N3;
-  for(std::multimap<MEdge, SVector3, Less_Edge>::iterator itm =
+  for(std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm =
         _columns->_normals.lower_bound(e1);
       itm != _columns->_normals.upper_bound(e1); ++itm)
     N1.push_back(itm->second);
-  for(std::multimap<MEdge, SVector3, Less_Edge>::iterator itm =
+  for(std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm =
         _columns->_normals.lower_bound(e2);
       itm != _columns->_normals.upper_bound(e2); ++itm)
     N2.push_back(itm->second);
-  for(std::multimap<MEdge, SVector3, Less_Edge>::iterator itm =
+  for(std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm =
         _columns->_normals.lower_bound(e3);
       itm != _columns->_normals.upper_bound(e3); ++itm)
     N3.push_back(itm->second);
@@ -291,7 +291,7 @@ static bool isEdgeOfFaceBL(GFace *gf, GEdge *ge, BoundaryLayerField *blf)
 static void getEdgesData(GFace *gf, BoundaryLayerField *blf,
                          BoundaryLayerColumns *_columns,
                          std::set<MVertex *> &_vertices,
-                         std::set<MEdge, Less_Edge> &allEdges,
+                         std::set<MEdge, MEdgeLessThan> &allEdges,
                          std::multimap<MVertex *, MVertex *> &tangents)
 {
   // get all model edges
@@ -328,7 +328,7 @@ static void getEdgesData(GFace *gf, BoundaryLayerField *blf,
 
 static void getNormals(GFace *gf, BoundaryLayerField *blf,
                        BoundaryLayerColumns *_columns,
-                       std::set<MEdge, Less_Edge> &allEdges)
+                       std::set<MEdge, MEdgeLessThan> &allEdges)
 {
   // assume that the initial mesh has been created i.e. that there exist
   // triangles inside the domain. Triangles are used to define exterior normals
@@ -430,7 +430,7 @@ bool buildAdditionalPoints2D(GFace *gf)
     blf->setupFor2d(gf->tag());
 
     std::set<MVertex *> _vertices;
-    std::set<MEdge, Less_Edge> allEdges;
+    std::set<MEdge, MEdgeLessThan> allEdges;
     std::multimap<MVertex *, MVertex *> tangents;
 
     getEdgesData(gf, blf, _columns, _vertices, allEdges, tangents);
@@ -475,7 +475,7 @@ bool buildAdditionalPoints2D(GFace *gf)
       else if(_connections.size() == 1) {
         MEdge e1(*it, _connections[0]);
         std::vector<SVector3> N1;
-        std::multimap<MEdge, SVector3, Less_Edge>::iterator itm;
+        std::multimap<MEdge, SVector3, MEdgeLessThan>::iterator itm;
         for(itm = _columns->_normals.lower_bound(e1);
             itm != _columns->_normals.upper_bound(e1); ++itm)
           N1.push_back(itm->second);
diff --git a/Geo/boundaryLayersData.h b/Geo/boundaryLayersData.h
index 6cb6cbed7e29a358eb710252ee1eb985355bc5a6..c07ce2a0eeef85d141096dd92adb1be8d275f94c 100644
--- a/Geo/boundaryLayersData.h
+++ b/Geo/boundaryLayersData.h
@@ -55,13 +55,13 @@ public:
   // Element columns
   std::map<MElement *, MElement *> _toFirst;
   std::map<MElement *, std::vector<MElement *> > _elemColumns;
-  std::map<MFace, GFace *, Less_Face> _inverse_classification;
+  std::map<MFace, GFace *, MFaceLessThan> _inverse_classification;
   std::multimap<MVertex *, BoundaryLayerData> _data;
   size_t size() const { return _data.size(); }
   typedef std::multimap<MVertex *, BoundaryLayerData>::iterator iter;
   typedef std::map<MVertex *, BoundaryLayerFan>::iterator iterf;
   std::multimap<MVertex *, MVertex *> _non_manifold_edges;
-  std::multimap<MEdge, SVector3, Less_Edge> _normals;
+  std::multimap<MEdge, SVector3, MEdgeLessThan> _normals;
   void clearData()
   {
     _toFirst.clear();
@@ -105,7 +105,7 @@ public:
     std::map<MVertex *, BoundaryLayerFan>::const_iterator it = _fans.find(v);
     int N = getNbColumns(v);
     if(N == 1) return getColumn(v, 0);
-    Equal_Edge aaa;
+    MEdgeEqual aaa;
     if(it != _fans.end()) {
       if(aaa(it->second._e1, e))
         return getColumn(v, 0);
diff --git a/Geo/discreteRegion.cpp b/Geo/discreteRegion.cpp
index 720f0352360b838bcedb16a8c0309b8105e111d5..dc5c2168b5f6df0cdc2317206d779e14624e5070 100644
--- a/Geo/discreteRegion.cpp
+++ b/Geo/discreteRegion.cpp
@@ -63,14 +63,14 @@ void discreteRegion::setBoundFaces(const std::vector<int> &tagFaces,
 }
 
 void discreteRegion::findFaces(
-  std::map<MFace, std::vector<int>, Less_Face> &map_faces)
+  std::map<MFace, std::vector<int>, MFaceLessThan> &map_faces)
 {
-  std::set<MFace, Less_Face> bound_faces;
+  std::set<MFace, MFaceLessThan> bound_faces;
   for(std::size_t elem = 0; elem < getNumMeshElements(); elem++) {
     MElement *e = getMeshElement(elem);
     for(int iFace = 0; iFace < e->getNumFaces(); iFace++) {
       MFace tmp_face = e->getFace(iFace);
-      std::set<MFace, Less_Face>::iterator itset = bound_faces.find(tmp_face);
+      std::set<MFace, MFaceLessThan>::iterator itset = bound_faces.find(tmp_face);
       if(itset == bound_faces.end())
         bound_faces.insert(tmp_face);
       else
@@ -79,9 +79,9 @@ void discreteRegion::findFaces(
   }
 
   // for the boundary faces, associate the tag of the discrete face
-  for(std::set<MFace, Less_Face>::iterator itv = bound_faces.begin();
+  for(std::set<MFace, MFaceLessThan>::iterator itv = bound_faces.begin();
       itv != bound_faces.end(); ++itv) {
-    std::map<MFace, std::vector<int>, Less_Face>::iterator itmap =
+    std::map<MFace, std::vector<int>, MFaceLessThan>::iterator itmap =
       map_faces.find(*itv);
     if(itmap == map_faces.end()) {
       std::vector<int> tagRegions;
diff --git a/Geo/discreteRegion.h b/Geo/discreteRegion.h
index d07638e91a1479e821426fc7672c3744b6bdd81a..4a4af35e38312326236a497e6051b8ae94cea908 100644
--- a/Geo/discreteRegion.h
+++ b/Geo/discreteRegion.h
@@ -19,7 +19,7 @@ public:
   void setBoundFaces(const std::set<int> &tagFaces);
   void setBoundFaces(const std::vector<int> &tagFaces,
                      const std::vector<int> &signFaces);
-  void findFaces(std::map<MFace, std::vector<int>, Less_Face> &map_faces);
+  void findFaces(std::map<MFace, std::vector<int>, MFaceLessThan> &map_faces);
   virtual void remesh();
 };
 
diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp
index c985615db2541d267de4295556b6cb62bfceb531..8400f3b41a533c6ed40c2af1c442cfb9f4315515 100644
--- a/Mesh/BackgroundMesh.cpp
+++ b/Mesh/BackgroundMesh.cpp
@@ -531,7 +531,7 @@ void backgroundMesh::updateSizes(GFace *_gf)
   // do not allow large variations in the size field
   // (Int. J. Numer. Meth. Engng. 43, 1143-1165 (1998) MESH GRADATION
   // CONTROL, BOROUCHAKI, HECHT, FREY)
-  std::set<MEdge, Less_Edge> edges;
+  std::set<MEdge, MEdgeLessThan> edges;
   for(std::size_t i = 0; i < _triangles.size(); i++) {
     for(int j = 0; j < _triangles[i]->getNumEdges(); j++) {
       edges.insert(_triangles[i]->getEdge(j));
@@ -539,7 +539,7 @@ void backgroundMesh::updateSizes(GFace *_gf)
   }
   const double _beta = 1.3;
   for(int i = 0; i < 3; i++) {
-    std::set<MEdge, Less_Edge>::iterator it = edges.begin();
+    std::set<MEdge, MEdgeLessThan>::iterator it = edges.begin();
     for(; it != edges.end(); ++it) {
       MVertex *v0 = it->getVertex(0);
       MVertex *v1 = it->getVertex(1);
diff --git a/Mesh/BoundaryLayers.cpp b/Mesh/BoundaryLayers.cpp
index 3ed6f3ed572a3c9b832fb503d04519005fff766d..1bdfa3391b1e03f1e23728a8be2850173e0eaeb4 100644
--- a/Mesh/BoundaryLayers.cpp
+++ b/Mesh/BoundaryLayers.cpp
@@ -260,7 +260,7 @@ FixErasedExtrScaleFlags(GModel *m, std::map<int, bool> &faceSkipScaleCalc,
                         std::map<int, bool> &edgeSkipScaleCalc)
 {
   unsigned int num_changed = 0;
-  std::set<GRegion *, GEntityLessThan>::iterator itreg;
+  std::set<GRegion *, GEntityPtrLessThan>::iterator itreg;
   // fix all extruded faces bordering ScaleLast regions
   for(itreg = m->firstRegion(); itreg != m->lastRegion(); itreg++) {
     ExtrudeParams *r_ep = (*itreg)->meshAttributes.extrude;
diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index 731de47a2e52d9ce6f9e92ed811204bdcf846106..7ab07a6f6cb67017b52d42ced684de43cc5b52cd 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -64,8 +64,8 @@ public:
     std::vector<GEdge *> const &e = gr->embeddedEdges();
     std::vector<GFace *> const &f = gr->embeddedFaces();
     if(e.empty() && f.empty()) return;
-    std::map<MEdge, GEdge *, Less_Edge> edges;
-    std::map<MFace, GFace *, Less_Face> faces;
+    std::map<MEdge, GEdge *, MEdgeLessThan> edges;
+    std::map<MFace, GFace *, MFaceLessThan> faces;
     std::vector<GEdge *>::const_iterator it = e.begin();
     std::vector<GFace *>::const_iterator itf = f.begin();
     for(; it != e.end(); ++it) {
@@ -108,7 +108,7 @@ public:
       Msg::Error("Saving the missing edges in file %s", name);
       FILE *f = fopen(name, "w");
       fprintf(f, "View \" \" {\n");
-      for(std::map<MEdge, GEdge *, Less_Edge>::iterator it = edges.begin();
+      for(std::map<MEdge, GEdge *, MEdgeLessThan>::iterator it = edges.begin();
           it != edges.end(); ++it) {
         MVertex *v1 = it->first.getVertex(0);
         MVertex *v2 = it->first.getVertex(1);
@@ -128,7 +128,7 @@ public:
       Msg::Error("Saving the missing faces in file %s", name);
       FILE *f = fopen(name, "w");
       fprintf(f, "View \" \" {\n");
-      for(std::map<MFace, GFace *, Less_Face>::iterator it = faces.begin();
+      for(std::map<MFace, GFace *, MFaceLessThan>::iterator it = faces.begin();
           it != faces.end(); ++it) {
         MVertex *v1 = it->first.getVertex(0);
         MVertex *v2 = it->first.getVertex(1);
@@ -511,7 +511,7 @@ static void Mesh2D(GModel *m)
   // meshes) is global as it depends on a smooth normal field generated from the
   // surface mesh of the source surfaces
   if(!Mesh2DWithBoundaryLayers(m)) {
-    std::set<GFace *, GEntityLessThan> f;
+    std::set<GFace *, GEntityPtrLessThan> f;
     for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
       f.insert(*it);
 
@@ -617,13 +617,13 @@ FindConnectedRegions(const std::vector<GRegion *> &del,
   v0       v1
  */
 
-void buildUniqueFaces(GRegion *gr, std::set<MFace, Less_Face> &bnd)
+void buildUniqueFaces(GRegion *gr, std::set<MFace, MFaceLessThan> &bnd)
 {
   for(std::size_t i = 0; i < gr->getNumMeshElements(); i++) {
     MElement *e = gr->getMeshElement(i);
     for(int j = 0; j < e->getNumFaces(); j++) {
       MFace f = e->getFace(j);
-      std::set<MFace, Less_Face>::iterator it = bnd.find(f);
+      std::set<MFace, MFaceLessThan>::iterator it = bnd.find(f);
       if(it == bnd.end())
         bnd.insert(f);
       else
@@ -636,15 +636,15 @@ bool MakeMeshConformal(GModel *gm, int howto)
 {
   fs_cont search;
   buildFaceSearchStructure(gm, search);
-  std::set<MFace, Less_Face> bnd;
+  std::set<MFace, MFaceLessThan> bnd;
   for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
     GRegion *gr = *rit;
     buildUniqueFaces(gr, bnd);
   }
   // bnd2 contains non conforming faces
 
-  std::set<MFace, Less_Face> bnd2;
-  for(std::set<MFace, Less_Face>::iterator itf = bnd.begin(); itf != bnd.end();
+  std::set<MFace, MFaceLessThan> bnd2;
+  for(std::set<MFace, MFaceLessThan>::iterator itf = bnd.begin(); itf != bnd.end();
       ++itf) {
     GFace *gfound = findInFaceSearchStructure(*itf, search);
     if(!gfound) {
@@ -655,14 +655,14 @@ bool MakeMeshConformal(GModel *gm, int howto)
 
   Msg::Info("%d hanging faces", bnd2.size());
 
-  std::set<MFace, Less_Face> ncf;
-  for(std::set<MFace, Less_Face>::iterator itf = bnd2.begin();
+  std::set<MFace, MFaceLessThan> ncf;
+  for(std::set<MFace, MFaceLessThan>::iterator itf = bnd2.begin();
       itf != bnd2.end(); ++itf) {
     const MFace &f = *itf;
     if(f.getNumVertices() == 4) { // quad face
-      std::set<MFace, Less_Face>::iterator it1 =
+      std::set<MFace, MFaceLessThan>::iterator it1 =
         bnd2.find(MFace(f.getVertex(0), f.getVertex(1), f.getVertex(2)));
-      std::set<MFace, Less_Face>::iterator it2 =
+      std::set<MFace, MFaceLessThan>::iterator it2 =
         bnd2.find(MFace(f.getVertex(2), f.getVertex(3), f.getVertex(0)));
       if(it1 != bnd2.end() && it2 != bnd2.end()) {
         ncf.insert(MFace(f.getVertex(1), f.getVertex(2), f.getVertex(3),
@@ -692,7 +692,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
       std::vector<MFace> faces;
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, Less_Face>::iterator it = ncf.find(f);
+        std::set<MFace, MFaceLessThan>::iterator it = ncf.find(f);
         if(it == ncf.end()) {
           faces.push_back(f);
         }
@@ -733,7 +733,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
       std::vector<MFace> faces;
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, Less_Face>::iterator it = ncf.find(f);
+        std::set<MFace, MFaceLessThan>::iterator it = ncf.find(f);
         if(it == ncf.end()) {
           faces.push_back(f);
         }
@@ -780,14 +780,14 @@ static void TestConformity(GModel *gm)
   int count = 0;
   for(GModel::riter rit = gm->firstRegion(); rit != gm->lastRegion(); ++rit) {
     GRegion *gr = *rit;
-    std::set<MFace, Less_Face> bnd;
+    std::set<MFace, MFaceLessThan> bnd;
     double vol = 0.0;
     for(std::size_t i = 0; i < gr->getNumMeshElements(); i++) {
       MElement *e = gr->getMeshElement(i);
       vol += fabs(e->getVolume());
       for(int j = 0; j < e->getNumFaces(); j++) {
         MFace f = e->getFace(j);
-        std::set<MFace, Less_Face>::iterator it = bnd.find(f);
+        std::set<MFace, MFaceLessThan>::iterator it = bnd.find(f);
         if(it == bnd.end())
           bnd.insert(f);
         else
@@ -796,7 +796,7 @@ static void TestConformity(GModel *gm)
     }
     printf("vol(%d) = %12.5E\n", gr->tag(), vol);
 
-    for(std::set<MFace, Less_Face>::iterator itf = bnd.begin();
+    for(std::set<MFace, MFaceLessThan>::iterator itf = bnd.begin();
         itf != bnd.end(); ++itf) {
       GFace *gfound = findInFaceSearchStructure(*itf, search);
       if(!gfound) {
diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp
index fe39f0c4dfacac1023ea6ad606a7f56c17d3d526..0bc01cbff6a932656b5f5f14187c0f71d98d27df 100644
--- a/Mesh/HighOrder.cpp
+++ b/Mesh/HighOrder.cpp
@@ -39,7 +39,7 @@ typedef std::map<std::pair<MVertex *, MVertex *>, std::vector<MVertex *> >
 
 // for each face (a list of vertices) we build a list of vertices that are the
 // high order representation of the face
-typedef std::map<MFace, std::vector<MVertex *>, Less_Face> faceContainer;
+typedef std::map<MFace, std::vector<MVertex *>, MFaceLessThan> faceContainer;
 
 // Functions that help optimizing placement of points on geometry
 
@@ -1261,7 +1261,7 @@ void FixPeriodicMesh(GModel *m)
       Msg::Info("Reconstructing periodicity for curve connection %d - %d",
                 tgt->tag(), src->tag());
 
-      std::map<MEdge, MLine *, Less_Edge> srcEdges;
+      std::map<MEdge, MLine *, MEdgeLessThan> srcEdges;
       for(std::size_t i = 0; i < src->getNumMeshElements(); i++) {
         MLine *srcLine = dynamic_cast<MLine *>(src->getMeshElement(i));
         if(!srcLine) {
@@ -1293,7 +1293,7 @@ void FixPeriodicMesh(GModel *m)
             vtcs[iVtx] = tIter->second;
         }
 
-        std::map<MEdge, MLine *, Less_Edge>::iterator srcIter =
+        std::map<MEdge, MLine *, MEdgeLessThan>::iterator srcIter =
           srcEdges.find(MEdge(vtcs[0], vtcs[1]));
         if(srcIter == srcEdges.end()) {
           Msg::Error("Can't find periodic counterpart of mesh edge %d-%d "
@@ -1345,7 +1345,7 @@ void FixPeriodicMesh(GModel *m)
         continue;
       }
 
-      std::map<MFace, MElement *, Less_Face> srcFaces;
+      std::map<MFace, MElement *, MFaceLessThan> srcFaces;
 
       for(std::size_t i = 0; i < src->getNumMeshElements(); ++i) {
         MElement *srcElmt = src->getMeshElement(i);
@@ -1381,7 +1381,7 @@ void FixPeriodicMesh(GModel *m)
         }
 
         MFace tgtFace(vtcs);
-        std::map<MFace, MElement *, Less_Face>::iterator srcIter =
+        std::map<MFace, MElement *, MFaceLessThan>::iterator srcIter =
           srcFaces.find(tgtFace);
         if(srcIter == srcFaces.end()) {
           std::ostringstream faceDef;
diff --git a/Mesh/gmshCrossFields.cpp b/Mesh/gmshCrossFields.cpp
index 0b0f9a9a6ec3c16104611f7e5d7327396d8286da..2a913ef685e2db31a7ab5a2292dface6fd194e2c 100644
--- a/Mesh/gmshCrossFields.cpp
+++ b/Mesh/gmshCrossFields.cpp
@@ -168,7 +168,7 @@ public:
     }
   }
 
-  void finish(std::map<MEdge, cross2d, Less_Edge> &C)
+  void finish(std::map<MEdge, cross2d, MEdgeLessThan> &C)
   {
     _tgt = SVector3(1, 0, 0);
     _tgt2 = SVector3(0, 1, 0);
@@ -204,7 +204,7 @@ public:
     }
 
     for(size_t i = 0; i < _neighbors.size(); i++) {
-      std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(_neighbors[i]);
+      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(_neighbors[i]);
       if(it == C.end())
         Msg::Error("impossible situation");
       else
@@ -393,13 +393,13 @@ static void closest(const cross2d &c1, const cross2d &c2, double &a2,
 }
 
 static void computeLifting(cross2d *first, int branch,
-                           std::set<MEdge, Less_Edge> &cutG,
+                           std::set<MEdge, MEdgeLessThan> &cutG,
                            std::set<MVertex *> &sing, std::set<MVertex *> &bnd)
 {
   // store in _atemp the branch of the neighbor
   std::set<MVertex *> cg;
   {
-    std::set<MEdge, Less_Edge>::iterator it = cutG.begin();
+    std::set<MEdge, MEdgeLessThan>::iterator it = cutG.begin();
     for(; it != cutG.end(); ++it) {
       cg.insert(it->getVertex(0));
       cg.insert(it->getVertex(1));
@@ -474,10 +474,10 @@ struct groupOfCross2d {
 
 #if 0
 static void duplicateNodesInCutGraph2(
-  std::vector<GFace *> &f, std::map<MEdge, cross2d, Less_Edge> &C,
+  std::vector<GFace *> &f, std::map<MEdge, cross2d, MEdgeLessThan> &C,
   std::map<MVertex *, MVertex *> &new2old,
   std::map<MVertex *, MVertex *> &old2new,
-  std::map<MEdge, MEdge, Less_Edge> &duplicateEdges, std::set<MVertex *> &sing,
+  std::map<MEdge, MEdge, MEdgeLessThan> &duplicateEdges, std::set<MVertex *> &sing,
   v2t_cont &adj, std::vector<groupOfCross2d> &G)
 {
   for(size_t i = 0; i < G.size(); i++) {
@@ -514,10 +514,10 @@ static void duplicateNodesInCutGraph2(
 #endif
 
 static void duplicateNodesInCutGraph(
-  std::vector<GFace *> &f, std::map<MEdge, cross2d, Less_Edge> &C,
+  std::vector<GFace *> &f, std::map<MEdge, cross2d, MEdgeLessThan> &C,
   std::map<MVertex *, MVertex *> &new2old,
   std::map<MVertex *, MVertex *> &old2new,
-  std::map<MEdge, MEdge, Less_Edge> &duplicateEdges, std::set<MVertex *> &sing,
+  std::map<MEdge, MEdge, MEdgeLessThan> &duplicateEdges, std::set<MVertex *> &sing,
   v2t_cont &adj, std::vector<groupOfCross2d> &G)
 {
   FILE *_f = fopen("nodes.pos", "w");
@@ -543,7 +543,7 @@ static void duplicateNodesInCutGraph(
         _s.pop();
         for(int i = 0; i < 3; i++) {
           MEdge e0 = t->getEdge(i);
-          std::map<MEdge, cross2d, Less_Edge>::iterator it0 = C.find(e0);
+          std::map<MEdge, cross2d, MEdgeLessThan>::iterator it0 = C.find(e0);
           if(!it0->second.inCutGraph) {
             for(size_t j = 0; j < it0->second._t.size(); j++) {
               std::vector<MElement *>::iterator ite =
@@ -607,7 +607,7 @@ static void duplicateNodesInCutGraph(
 }
 
 static void print_H_and_Cross(GModel *gm, std::vector<GFace *> &f,
-                              std::map<MEdge, cross2d, Less_Edge> &C,
+                              std::map<MEdge, cross2d, MEdgeLessThan> &C,
                               dofManager<double> &dof,
                               std::set<MVertex *> &singularities)
 {
@@ -616,7 +616,7 @@ static void print_H_and_Cross(GModel *gm, std::vector<GFace *> &f,
 
   FILE *_f = fopen(fn.c_str(), "w");
 
-  std::set<MVertex *, MVertexLessThanNum> vs;
+  std::set<MVertex *, MVertexPtrLessThan> vs;
   for(size_t i = 0; i < f.size(); i++) {
     for(size_t j = 0; j < f[i]->triangles.size(); j++) {
       MTriangle *t = f[i]->triangles[j];
@@ -624,7 +624,7 @@ static void print_H_and_Cross(GModel *gm, std::vector<GFace *> &f,
     }
   }
   fprintf(_f, "%lu", vs.size());
-  for(std::set<MVertex *, MVertexLessThanNum>::iterator it = vs.begin();
+  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = vs.begin();
       it != vs.end(); ++it) {
     double a;
     dof.getDofValue(*it, 0, 1, a);
@@ -636,7 +636,7 @@ static void print_H_and_Cross(GModel *gm, std::vector<GFace *> &f,
     fprintf(_f, "%lu\n", (*it)->getNum());
   }
   fprintf(_f, "%lu", C.size());
-  for(std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
       it != C.end(); ++it) {
     fprintf(_f, "%lu %lu %12.5E %12.5E %12.5E %12.5E %12.5E %12.5E\n",
             it->first.getVertex(0)->getNum(), it->first.getVertex(1)->getNum(),
@@ -648,7 +648,7 @@ static void print_H_and_Cross(GModel *gm, std::vector<GFace *> &f,
 
 static void
 computeUniqueVectorPerTriangle(GModel *gm, std::vector<GFace *> &f,
-                               std::map<MEdge, cross2d, Less_Edge> &C, int dir,
+                               std::map<MEdge, cross2d, MEdgeLessThan> &C, int dir,
                                std::map<MTriangle *, SVector3> &d)
 {
   for(size_t i = 0; i < f.size(); i++) {
@@ -658,7 +658,7 @@ computeUniqueVectorPerTriangle(GModel *gm, std::vector<GFace *> &f,
       int n = 0;
       for(int k = 0; k < 3; k++) {
         MEdge e = t->getEdge(k);
-        std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(e);
+        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
         if(it != C.end()) {
           if(!it->second.inCutGraph) {
             n++;
@@ -802,18 +802,18 @@ static void assembleLagrangeMultipliers(dofManager<double> &myAssembler,
 
 static void
 LagrangeMultipliers2(dofManager<double> &myAssembler, int NUMDOF,
-                     std::map<MEdge, cross2d, Less_Edge> &C,
+                     std::map<MEdge, cross2d, MEdgeLessThan> &C,
                      std::vector<std::vector<cross2d *> > &groups,
-                     std::map<MEdge, MEdge, Less_Edge> &duplicateEdges,
+                     std::map<MEdge, MEdge, MEdgeLessThan> &duplicateEdges,
                      bool assemble)
 {
   for(size_t i = 0; i < groups.size(); i++) {
     size_t N = groups[i].size();
     MEdge ed = groups[i][0]->_e;
-    std::map<MEdge, MEdge, Less_Edge>::iterator ite = duplicateEdges.find(ed);
+    std::map<MEdge, MEdge, MEdgeLessThan>::iterator ite = duplicateEdges.find(ed);
     if(ite != duplicateEdges.end()) ed = ite->second;
     MVertex *v = ed.getVertex(0);
-    std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(groups[i][0]->_e);
+    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(groups[i][0]->_e);
     double S = (NUMDOF == 2) ? sin(it->second._atemp) : cos(it->second._atemp);
     if(fabs(S) > .8) {
       for(size_t j = 0; j < N; j++) {
@@ -850,10 +850,10 @@ static void createDofs(dofManager<double> &myAssembler, int NUMDOF,
 static void computePotential(GModel *gm, std::vector<GFace *> &f,
                              const char *outputName, const char *outputName2,
                              dofManager<double> &dof,
-                             std::map<MEdge, cross2d, Less_Edge> &C,
+                             std::map<MEdge, cross2d, MEdgeLessThan> &C,
                              std::map<MVertex *, MVertex *> &new2old,
                              std::vector<std::vector<cross2d *> > &groups,
-                             std::map<MEdge, MEdge, Less_Edge> &duplicateEdges,
+                             std::map<MEdge, MEdge, MEdgeLessThan> &duplicateEdges,
                              std::map<MTriangle *, SVector3> &lift,
                              std::map<MTriangle *, SVector3> &lift2,
                              std::vector<groupOfCross2d> &G,
@@ -1098,13 +1098,13 @@ static bool isSingular(MVertex *v, std::vector<cross2d *> &adj, double &MAX)
   return MAX > .5;
 }
 
-static void computeSingularities(std::map<MEdge, cross2d, Less_Edge> &C,
+static void computeSingularities(std::map<MEdge, cross2d, MEdgeLessThan> &C,
                                  std::set<MVertex *> &singularities)
 {
   FILE *f_ = fopen("sing.pos", "w");
   fprintf(f_, "View \"S\"{\n");
   std::multimap<MVertex *, cross2d *> conn;
-  for(std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
       it != C.end(); ++it) {
     std::pair<MVertex *, cross2d *> p =
       std::make_pair(it->first.getVertex(0), &it->second);
@@ -1132,8 +1132,8 @@ static void computeSingularities(std::map<MEdge, cross2d, Less_Edge> &C,
   fclose(f_);
 }
 
-static void cutGraph(std::map<MEdge, cross2d, Less_Edge> &C,
-                     dofManager<double> &dof, std::set<MEdge, Less_Edge> &cutG,
+static void cutGraph(std::map<MEdge, cross2d, MEdgeLessThan> &C,
+                     dofManager<double> &dof, std::set<MEdge, MEdgeLessThan> &cutG,
                      std::set<MVertex *> &singularities,
                      std::set<MVertex *> &boundaries)
 {
@@ -1142,7 +1142,7 @@ static void cutGraph(std::map<MEdge, cross2d, Less_Edge> &C,
   std::vector<MEdge> cotree;
   std::set<std::pair<double, MTriangle *> > _distances;
   {
-    std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+    std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
     for(; it != C.end(); ++it) {
       if(it->second._t.size() == 1) {
         boundaries.insert(it->first.getVertex(0));
@@ -1163,7 +1163,7 @@ static void cutGraph(std::map<MEdge, cross2d, Less_Edge> &C,
 
     for(int i = 0; i < 3; i++) {
       MEdge e = t->getEdge(i);
-      std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(e);
+      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
       for(size_t j = 0; j < it->second._t.size(); j++) {
         MTriangle *tt = it->second._t[j];
         if(touched.find(tt) == touched.end()) {
@@ -1177,7 +1177,7 @@ static void cutGraph(std::map<MEdge, cross2d, Less_Edge> &C,
     }
   }
   std::sort(tree.begin(), tree.end());
-  std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
   std::map<MVertex *, std::vector<MEdge> > _graph;
   std::map<MVertex *, std::vector<MEdge> > _all_graph;
   for(; it != C.end(); ++it) {
@@ -1222,7 +1222,7 @@ static void cutGraph(std::map<MEdge, cross2d, Less_Edge> &C,
   double GRR = 0;
   for (size_t i=0;i<it->second.size();i++){
 
-  std::map<MEdge,cross2d,Less_Edge >::iterator itee = C.find(it->second[i]);
+  std::map<MEdge,cross2d,MEdgeLessThan >::iterator itee = C.find(it->second[i]);
   GRR = std::max(GRR,itee->second.grad());
 
   MVertex *o = it->second[i].getVertex(0) == v ? it->second[i].getVertex(1) :
@@ -1287,7 +1287,7 @@ hV)isMax = false; if (hI < hV)isMin = false;
   }
 
   {
-    std::set<MEdge, Less_Edge>::iterator it = cutG.begin();
+    std::set<MEdge, MEdgeLessThan>::iterator it = cutG.begin();
     for(; it != cutG.end(); ++it) {
       MEdge e = *it;
       fprintf(fff, "SL(%g,%g,%g,%g,%g,%g){%d,%d};\n", e.getVertex(0)->x(),
@@ -1299,14 +1299,14 @@ hV)isMax = false; if (hI < hV)isMin = false;
   fclose(fff);
 }
 
-static void groupBoundaries(GModel *gm, std::map<MEdge, cross2d, Less_Edge> &C,
+static void groupBoundaries(GModel *gm, std::map<MEdge, cross2d, MEdgeLessThan> &C,
                             std::vector<std::vector<cross2d *> > &groups,
                             std::set<MVertex *> singularities,
                             bool cutGraph = false)
 {
   std::set<MVertex *> cutgraph;
   std::set<MVertex *> boundaries;
-  for(std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
       it != C.end(); ++it) {
     MVertex *v0 = it->first.getVertex(0);
     MVertex *v1 = it->first.getVertex(1);
@@ -1323,7 +1323,7 @@ static void groupBoundaries(GModel *gm, std::map<MEdge, cross2d, Less_Edge> &C,
   std::set<cross2d *> _all;
 
   std::multimap<MVertex *, cross2d *> conn;
-  for(std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  for(std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
       it != C.end(); ++it) {
     std::pair<MVertex *, cross2d *> p =
       std::make_pair(it->first.getVertex(0), &it->second);
@@ -1449,11 +1449,11 @@ static void groupBoundaries(GModel *gm, std::map<MEdge, cross2d, Less_Edge> &C,
   fclose(f);
 }
 
-static void fastImplementationExtrinsic(std::map<MEdge, cross2d, Less_Edge> &C)
+static void fastImplementationExtrinsic(std::map<MEdge, cross2d, MEdgeLessThan> &C)
 {
   double *data = new double[C.size() * 6];
   size_t *graph = new size_t[C.size() * 4];
-  std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
   int counter = 0;
 
   for(; it != C.end(); ++it) {
@@ -1539,7 +1539,7 @@ static void fastImplementationExtrinsic(std::map<MEdge, cross2d, Less_Edge> &C)
 
 static dofManager<double> *computeH(GModel *gm, std::vector<GFace *> &f,
                                     std::set<MVertex *> &vs,
-                                    std::map<MEdge, cross2d, Less_Edge> &C)
+                                    std::map<MEdge, cross2d, MEdgeLessThan> &C)
 {
 #if defined(HAVE_SOLVER)
 #if defined(HAVE_PETSC)
@@ -1587,9 +1587,9 @@ static dofManager<double> *computeH(GModel *gm, std::vector<GFace *> &f,
       MEdge e0 = t->getEdge(0);
       MEdge e1 = t->getEdge(1);
       MEdge e2 = t->getEdge(2);
-      std::map<MEdge, cross2d, Less_Edge>::iterator it0 = C.find(e0);
-      std::map<MEdge, cross2d, Less_Edge>::iterator it1 = C.find(e1);
-      std::map<MEdge, cross2d, Less_Edge>::iterator it2 = C.find(e2);
+      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it0 = C.find(e0);
+      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it1 = C.find(e1);
+      std::map<MEdge, cross2d, MEdgeLessThan>::iterator it2 = C.find(e2);
 
       //      printf("%g %ag %g\n",a0,a1,a2);
 
@@ -1753,10 +1753,10 @@ static double coord1d(double a0, double a1, double a)
 static void computeIso(
   MVertex *vsing, v2t_cont &adj, double VAL, MVertex *v0, MVertex *v1,
   SPoint3 &p, std::map<MVertex *, double> &pot,
-  std::set<MEdge, Less_Edge> &visited,
-  std::map<MEdge, std::pair<std::map<MVertex *, double> *, double>, Less_Edge>
+  std::set<MEdge, MEdgeLessThan> &visited,
+  std::map<MEdge, std::pair<std::map<MVertex *, double> *, double>, MEdgeLessThan>
     &cutGraphEnds,
-  std::map<MEdge, MEdge, Less_Edge> &d1, std::vector<groupOfCross2d> &G,
+  std::map<MEdge, MEdge, MEdgeLessThan> &d1, std::vector<groupOfCross2d> &G,
   FILE *f, int COUNT)
 {
   if(v0 == vsing || v1 == vsing) return;
@@ -1823,14 +1823,14 @@ static void computeIso(MVertex *vsing, v2t_cont &adj, double VAL, MVertex *v0,
                        MVertex *v1, SPoint3 &p,
                        std::map<MVertex *, double> *potU,
                        std::map<MVertex *, double> *potV,
-                       std::map<MEdge, MEdge, Less_Edge> &d1,
+                       std::map<MEdge, MEdge, MEdgeLessThan> &d1,
                        std::vector<groupOfCross2d> &G, FILE *f, int COUNT)
 {
   //  printf("computing startiung at %lu %lu val
   //  %12.5E\n",v0->getNum(),v1->getNum(),VAL);
 
-  std::set<MEdge, Less_Edge> visited;
-  std::map<MEdge, std::pair<std::map<MVertex *, double> *, double>, Less_Edge>
+  std::set<MEdge, MEdgeLessThan> visited;
+  std::map<MEdge, std::pair<std::map<MVertex *, double> *, double>, MEdgeLessThan>
     cutGraphEnds;
   computeIso(vsing, adj, VAL, v0, v1, p, *potU, visited, cutGraphEnds, d1, G, f,
              COUNT);
@@ -1892,7 +1892,7 @@ static void computeIso(MVertex *vsing, v2t_cont &adj, double VAL, MVertex *v0,
 static void computeIso(MVertex *vsing, v2t_cont &adj, double u,
                        std::map<MVertex *, double> &potU,
                        std::map<MVertex *, double> &potV, FILE *f,
-                       std::map<MEdge, MEdge, Less_Edge> &d1,
+                       std::map<MEdge, MEdge, MEdgeLessThan> &d1,
                        std::vector<groupOfCross2d> &G, int COUNT)
 {
   //  printf("computing an ISO for %lu\n",vsing->getNum());
@@ -1908,8 +1908,8 @@ static void computeIso(MVertex *vsing, v2t_cont &adj, double u,
     SPoint3 p0(v0->x(), v0->y(), v0->z());
     SPoint3 p1(v1->x(), v1->y(), v1->z());
     SPoint3 p2(v2->x(), v2->y(), v2->z());
-    //      std::set<MEdge,Less_Edge> visited;
-    //      std::set<MEdge,Less_Edge> cutGraphEnds;
+    //      std::set<MEdge,MEdgeLessThan> visited;
+    //      std::set<MEdge,MEdgeLessThan> cutGraphEnds;
     if(v2 == vsing && (U0 - u) * (U1 - u) <= 0) {
       double xi = coord1d(U0, U1, u);
       SPoint3 pp = p0 * (1 - xi) + p1 * xi;
@@ -1946,14 +1946,14 @@ static void computeIso(MVertex *vsing, v2t_cont &adj, double u,
 
 static void computeIsos(GModel *gm, std::vector<GFace *> &faces,
                         std::set<MVertex *> &singularities,
-                        std::map<MEdge, cross2d, Less_Edge> &C,
+                        std::map<MEdge, cross2d, MEdgeLessThan> &C,
                         std::map<MVertex *, MVertex *> &new2old,
-                        std::map<MEdge, MEdge, Less_Edge> &duplicateEdges,
+                        std::map<MEdge, MEdge, MEdgeLessThan> &duplicateEdges,
                         std::vector<std::vector<cross2d *> > &groups,
                         std::vector<std::vector<cross2d *> > &groups_cg,
                         std::map<MVertex *, double> &potU,
                         std::map<MVertex *, double> &potV,
-                        std::set<MEdge, Less_Edge> &cutG,
+                        std::set<MEdge, MEdgeLessThan> &cutG,
                         std::vector<groupOfCross2d> &G)
 {
   v2t_cont adj;
@@ -1979,7 +1979,7 @@ static void computeIsos(GModel *gm, std::vector<GFace *> &faces,
     }
   }
 
-  std::map<MEdge, MEdge, Less_Edge> d1;
+  std::map<MEdge, MEdge, MEdgeLessThan> d1;
   {
     for(size_t i = 0; i < G.size(); i++) {
       for(size_t j = 1; j < G[i].left.size(); j++) {
@@ -2290,7 +2290,7 @@ static int computeCrossField2dTheta(GModel *gm, std::vector<GFace *> &f,
 {
   Msg::SetNumThreads(Msg::GetMaxThreads());
 
-  std::map<MEdge, cross2d, Less_Edge> C;
+  std::map<MEdge, cross2d, MEdgeLessThan> C;
   std::set<MVertex *> vs;
   for(size_t i = 0; i < f.size(); i++) {
     for(size_t j = 0; j < f[i]->triangles.size(); j++) {
@@ -2301,7 +2301,7 @@ static int computeCrossField2dTheta(GModel *gm, std::vector<GFace *> &f,
         MEdge e1 = t->getEdge((k + 1) % 3);
         MEdge e2 = t->getEdge((k + 2) % 3);
         cross2d c(e, t, e1, e2);
-        std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(e);
+        std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
         if(it == C.end())
           C.insert(std::make_pair(e, c));
         else {
@@ -2321,14 +2321,14 @@ static int computeCrossField2dTheta(GModel *gm, std::vector<GFace *> &f,
         for(size_t k = 0; k < e[j]->lines.size(); k++) {
           MLine *l = e[j]->lines[k];
           MEdge e = l->getEdge(0);
-          std::map<MEdge, cross2d, Less_Edge>::iterator it = C.find(e);
+          std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.find(e);
           if(it != C.end()) { it->second.inBoundary = true; }
         }
       }
     }
   }
 
-  std::map<MEdge, cross2d, Less_Edge>::iterator it = C.begin();
+  std::map<MEdge, cross2d, MEdgeLessThan>::iterator it = C.begin();
   for(; it != C.end(); ++it) it->second.finish(C);
   it = C.begin();
   for(; it != C.end(); ++it) it->second.finish2();
@@ -2409,7 +2409,7 @@ static int computeCrossField2dTheta(GModel *gm, std::vector<GFace *> &f,
 
   dofManager<double> *myAssembler = computeH(gm, f, vs, C);
 
-  std::set<MEdge, Less_Edge> cutG;
+  std::set<MEdge, MEdgeLessThan> cutG;
   std::set<MVertex *> singularities;
   std::set<MVertex *> boundaries;
 
@@ -2493,7 +2493,7 @@ static int computeCrossField2dTheta(GModel *gm, std::vector<GFace *> &f,
   fprintf(_f, "};\n");
   fclose(_f);
 
-  std::map<MEdge, MEdge, Less_Edge> duplicateEdges;
+  std::map<MEdge, MEdge, MEdgeLessThan> duplicateEdges;
   std::map<MVertex *, MVertex *> new2old;
   std::map<MVertex *, MVertex *> old2new;
   duplicateNodesInCutGraph(f, C, new2old, old2new, duplicateEdges,
diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp
index 8b6402ea5d99c9d8e0e84ca41aeb18e970c92ede..8d9e67e9bb91d458fd8b8257059b1cb51c3f3468 100644
--- a/Mesh/meshGFace.cpp
+++ b/Mesh/meshGFace.cpp
@@ -124,11 +124,11 @@ class quadMeshRemoveHalfOfOneDMesh {
 private:
   GFace *_gf;
   std::map<GEdge *, std::vector<MLine *> > _backup;
-  std::map<MEdge, MVertex *, Less_Edge> _middle;
+  std::map<MEdge, MVertex *, MEdgeLessThan> _middle;
   void _subdivide()
   {
     std::vector<MQuadrangle *> qnew;
-    std::map<MEdge, MVertex *, Less_Edge> eds;
+    std::map<MEdge, MVertex *, MEdgeLessThan> eds;
     for(std::size_t i = 0; i < _gf->triangles.size(); i++) {
       MVertex *v[3];
       SPoint2 m[3];
@@ -136,8 +136,8 @@ private:
         MEdge E = _gf->triangles[i]->getEdge(j);
         SPoint2 p1, p2;
         reparamMeshEdgeOnFace(E.getVertex(0), E.getVertex(1), _gf, p1, p2);
-        std::map<MEdge, MVertex *, Less_Edge>::iterator it = _middle.find(E);
-        std::map<MEdge, MVertex *, Less_Edge>::iterator it2 = eds.find(E);
+        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it = _middle.find(E);
+        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it2 = eds.find(E);
         m[j] = p1;
         if(it == _middle.end() && it2 == eds.end()) {
           GPoint gp = _gf->point((p1 + p2) * 0.5);
@@ -190,8 +190,8 @@ private:
         MEdge E = _gf->quadrangles[i]->getEdge(j);
         SPoint2 p1, p2;
         reparamMeshEdgeOnFace(E.getVertex(0), E.getVertex(1), _gf, p1, p2);
-        std::map<MEdge, MVertex *, Less_Edge>::iterator it = _middle.find(E);
-        std::map<MEdge, MVertex *, Less_Edge>::iterator it2 = eds.find(E);
+        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it = _middle.find(E);
+        std::map<MEdge, MVertex *, MEdgeLessThan>::iterator it2 = eds.find(E);
         m[j] = p1;
         if(it == _middle.end() && it2 == eds.end()) {
           GPoint gp = _gf->point((p1 + p2) * 0.5);
@@ -817,12 +817,12 @@ static bool recoverEdge(BDS_Mesh *m, GFace *gf, GEdge *ge,
 }
 
 static void addOrRemove(MVertex *v1, MVertex *v2,
-                        std::set<MEdge, Less_Edge> &bedges,
-                        std::set<MEdge, Less_Edge> &removed)
+                        std::set<MEdge, MEdgeLessThan> &bedges,
+                        std::set<MEdge, MEdgeLessThan> &removed)
 {
   MEdge e(v1, v2);
   if(removed.find(e) != removed.end()) return;
-  std::set<MEdge, Less_Edge>::iterator it = bedges.find(e);
+  std::set<MEdge, MEdgeLessThan>::iterator it = bedges.find(e);
   if(it == bedges.end())
     bedges.insert(e);
   else {
@@ -838,8 +838,8 @@ static void modifyInitialMeshForBoundaryLayers(
   if(!buildAdditionalPoints2D(gf)) return;
   BoundaryLayerColumns *_columns = gf->getColumns();
 
-  std::set<MEdge, Less_Edge> bedges;
-  std::set<MEdge, Less_Edge> removed;
+  std::set<MEdge, MEdgeLessThan> bedges;
+  std::set<MEdge, MEdgeLessThan> removed;
 
   std::vector<GEdge *> edges = gf->edges();
   std::vector<GEdge *> embedded_edges = gf->getEmbeddedEdges();
@@ -999,7 +999,7 @@ static void modifyInitialMeshForBoundaryLayers(
 
   discreteEdge ne(gf->model(), 444444, 0, (*edges.begin())->getEndVertex());
   std::vector<GEdge *> hop;
-  std::set<MEdge, Less_Edge>::iterator it = bedges.begin();
+  std::set<MEdge, MEdgeLessThan>::iterator it = bedges.begin();
 
   FILE *ff = 0;
   if(debug) ff = Fopen("toto.pos", "w");
@@ -1132,7 +1132,7 @@ BDS2GMSH(BDS_Mesh *m, GFace *gf,
 
 static void _deleteUnusedVertices(GFace *gf)
 {
-  std::set<MVertex *, MVertexLessThanNum> allverts;
+  std::set<MVertex *, MVertexPtrLessThan> allverts;
   for(std::size_t i = 0; i < gf->triangles.size(); i++) {
     for(int j = 0; j < 3; j++) {
       if(gf->triangles[i]->getVertex(j)->onWhat() == gf)
@@ -1176,7 +1176,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
     replacement_edges ? *replacement_edges : gf->edges();
 
   // build a set with all points of the boundaries
-  std::set<MVertex *, MVertexLessThanNum> all_vertices, boundary;
+  std::set<MVertex *, MVertexPtrLessThan> all_vertices, boundary;
   std::vector<GEdge *>::const_iterator ite = edges.begin();
 
   FILE *fdeb = NULL;
@@ -1229,7 +1229,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
     Msg::Error("The 1D mesh seems not to be forming a closed loop (%d boundary "
                "nodes are considered once)",
                boundary.size());
-    for(std::set<MVertex *, MVertexLessThanNum>::iterator it = boundary.begin();
+    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it = boundary.begin();
         it != boundary.end(); it++){
       Msg::Debug("Remaining node %lu", (*it)->getNum());
     }
@@ -1272,7 +1272,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   else if(all_vertices.size() == 3) {
     MVertex *vv[3] = {0, 0, 0};
     int i = 0;
-    for(std::set<MVertex *, MVertexLessThanNum>::iterator it =
+    for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
           all_vertices.begin();
         it != all_vertices.end(); it++) {
       vv[i++] = *it;
@@ -1289,7 +1289,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
   std::vector<BDS_Point *> points(all_vertices.size());
   SBoundingBox3d bbox;
   int count = 0;
-  for(std::set<MVertex *, MVertexLessThanNum>::iterator it =
+  for(std::set<MVertex *, MVertexPtrLessThan>::iterator it =
         all_vertices.begin();
       it != all_vertices.end(); it++) {
     MVertex *here = *it;
diff --git a/Mesh/meshGFaceBDS.cpp b/Mesh/meshGFaceBDS.cpp
index 1b6890e31caa1981b9cd059dddf54fb1f50a22cf..b2782d86ea22b92a72c94d9e02e4e239b0a46bd5 100644
--- a/Mesh/meshGFaceBDS.cpp
+++ b/Mesh/meshGFaceBDS.cpp
@@ -25,7 +25,7 @@
 
 static void getDegeneratedVertices(
   BDS_Mesh &m, std::map<BDS_Point *, MVertex *, PointLessThan> *recoverMap,
-  std::set<MVertex *, MVertexLessThanNum> &degenerated,
+  std::set<MVertex *, MVertexPtrLessThan> &degenerated,
   std::vector<BDS_Edge *> &degenerated_edges)
 {
   degenerated.clear();
@@ -705,14 +705,14 @@ void modifyInitialMeshToRemoveDegeneracies(
   GFace *gf, BDS_Mesh &m,
   std::map<BDS_Point *, MVertex *, PointLessThan> *recoverMap)
 {
-  std::set<MVertex *, MVertexLessThanNum> degenerated;
+  std::set<MVertex *, MVertexPtrLessThan> degenerated;
   std::vector<BDS_Edge *> degenerated_edges;
   getDegeneratedVertices(m, recoverMap, degenerated, degenerated_edges);
 
   for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
         recoverMap->begin();
       it != recoverMap->end(); ++it) {
-    std::set<MVertex *, MVertexLessThanNum>::iterator it2 =
+    std::set<MVertex *, MVertexPtrLessThan>::iterator it2 =
       degenerated.find(it->second);
     if(it2 != degenerated.end()) {
       for(size_t K = 0; K < degenerated_edges.size(); K++) {
diff --git a/Mesh/meshGFaceDelaunayInsertion.cpp b/Mesh/meshGFaceDelaunayInsertion.cpp
index 5ac1825e2d4d176afd6cca376df8a6a8bf81f156..eb3edb2128a351b0b5bbb953790542a3dbb7c1d4 100644
--- a/Mesh/meshGFaceDelaunayInsertion.cpp
+++ b/Mesh/meshGFaceDelaunayInsertion.cpp
@@ -197,7 +197,7 @@ static bool isActive(MTri3 *t, double limit_, int &active)
 }
 
 static bool isActive(MTri3 *t, double limit_, int &i,
-                     std::set<MEdge, Less_Edge> *front)
+                     std::set<MEdge, MEdgeLessThan> *front)
 {
   if(t->isDeleted()) return false;
   for(i = 0; i < 3; i++) {
@@ -215,7 +215,7 @@ static bool isActive(MTri3 *t, double limit_, int &i,
 }
 
 static void updateActiveEdges(MTri3 *t, double limit_,
-                              std::set<MEdge, Less_Edge> &front)
+                              std::set<MEdge, MEdgeLessThan> &front)
 {
   if(t->isDeleted()) return;
   for(int active = 0; active < 3; active++) {
@@ -579,7 +579,7 @@ static void recurFindCavityAniso(GFace *gf, std::list<edgeXface> &shell,
     MTri3 *neigh = t->getNeigh(i);
     edgeXface exf(t, i);
     // take care of untouchable internal edges
-    std::set<MEdge, Less_Edge>::iterator it =
+    std::set<MEdge, MEdgeLessThan>::iterator it =
       data.internalEdges.find(MEdge(exf._v(0), exf._v(1)));
     if(!neigh || it != data.internalEdges.end())
       shell.push_back(exf);
@@ -1506,7 +1506,7 @@ void bowyerWatsonFrontalLayers(
   int ITER = 0, active_edge;
   // compute active triangle
   std::set<MTri3 *, compareTri3Ptr>::iterator it = AllTris.begin();
-  std::set<MEdge, Less_Edge> _front;
+  std::set<MEdge, MEdgeLessThan> _front;
   for(; it != AllTris.end(); ++it) {
     if(isActive(*it, LIMIT_, active_edge)) {
       ActiveTris.insert(*it);
@@ -1633,7 +1633,7 @@ void bowyerWatsonParallelograms(
     return;
   }
 
-  // std::sort(packed.begin(), packed.end(), MVertexLessThanLexicographic());
+  // std::sort(packed.begin(), packed.end(), MVertexPtrLessThanLexicographic());
   SortHilbert(packed);
 
   MTri3 *oneNewTriangle = 0;
@@ -1698,7 +1698,7 @@ void bowyerWatsonParallelogramsConstrained(
     return;
   }
 
-  std::sort(packed.begin(), packed.end(), MVertexLessThanLexicographic());
+  std::sort(packed.begin(), packed.end(), MVertexPtrLessThanLexicographic());
 
   MTri3 *oneNewTriangle = 0;
   for(std::size_t i = 0; i < packed.size();) {
@@ -1943,7 +1943,7 @@ static bool recoverEdgeBySwaps(std::vector<MTri3 *> &t, MVertex *mv1,
         if(diffend(v1, v2, mv1, mv2)) {
           if(intersection_segments(p1, p2, pv1, pv2, xcc)) {
             // if
-            // (std::binary_search(edges.begin(),edges.end(),MEdge(v1,v2),Less_Edge)){
+            // (std::binary_search(edges.begin(),edges.end(),MEdge(v1,v2),MEdgeLessThan)){
             //  Msg::Error("1D mesh self intersects");
             //	    }
             if(!intersection_segments(po, p3, pv1, pv2, xcc) ||
@@ -1963,9 +1963,9 @@ static bool recoverEdgeBySwaps(std::vector<MTri3 *> &t, MVertex *mv1,
 
 void recoverEdges(std::vector<MTri3 *> &t, std::vector<MEdge> &edges)
 {
-  Less_Edge le;
+  MEdgeLessThan le;
   std::sort(edges.begin(), edges.end(), le);
-  std::set<MEdge, Less_Edge> setOfMeshEdges;
+  std::set<MEdge, MEdgeLessThan> setOfMeshEdges;
   for(size_t i = 0; i < t.size(); i++) {
     for(int j = 0; j < 3; j++) {
       setOfMeshEdges.insert(t[i]->tri()->getEdge(j));
diff --git a/Mesh/meshGFaceDelaunayInsertion.h b/Mesh/meshGFaceDelaunayInsertion.h
index ee61cf53a8ab6a36ecd8bb5d9b3ce91db7d4981f..ccfafb320316cf5522745a2e8959f0cd1b13ebb3 100644
--- a/Mesh/meshGFaceDelaunayInsertion.h
+++ b/Mesh/meshGFaceDelaunayInsertion.h
@@ -26,7 +26,7 @@ struct bidimMeshData {
   std::vector<SMetric3> vMetricsBGM;
   std::map<MVertex *, MVertex *> *equivalence;
   std::map<MVertex *, SPoint2> *parametricCoordinates;
-  std::set<MEdge, Less_Edge> internalEdges; // embedded edges
+  std::set<MEdge, MEdgeLessThan> internalEdges; // embedded edges
   //  std::set<MVertex*> internalVertices; // embedded vertices
   inline void addVertex(MVertex *mv, double u, double v, double size,
                         double sizeBGM)
@@ -133,7 +133,7 @@ public:
 };
 
 class compareTri3Ptr {
-  Less_Face lf;
+  MFaceLessThan lf;
 
 public:
   inline bool operator()(const MTri3 *a, const MTri3 *b) const
diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp
index af9ee89e569a4c60e42dac7c8e11e5a0c98e365b..737361f8a2aa06d1ef4e454eade3537263b84d15 100644
--- a/Mesh/meshGFaceOptimize.cpp
+++ b/Mesh/meshGFaceOptimize.cpp
@@ -853,7 +853,7 @@ static void _relocate(GFace *gf, MVertex *ver,
   ver->getParameter(1, initv);
 
   // compute the vertices connected to that one
-  std::map<MVertex *, SPoint2, MVertexLessThanNum> pts;
+  std::map<MVertex *, SPoint2, MVertexPtrLessThan> pts;
   for(std::size_t i = 0; i < lt.size(); i++) {
     for(int j = 0; j < lt[i]->getNumEdges(); j++) {
       MEdge e = lt[i]->getEdge(j);
@@ -875,7 +875,7 @@ static void _relocate(GFace *gf, MVertex *ver,
   double metric[3];
   SPoint2 after(0, 0);
   double COUNT = 0.0;
-  for(std::map<MVertex *, SPoint2, MVertexLessThanNum>::iterator it =
+  for(std::map<MVertex *, SPoint2, MVertexPtrLessThan>::iterator it =
         pts.begin();
       it != pts.end(); ++it) {
     SPoint2 adj = it->second;
diff --git a/Mesh/meshGFaceOptimize.h b/Mesh/meshGFaceOptimize.h
index 60a953b52523150af4015607756ceddc4610804b..3d7c145cefaad76806ddcf3b0df4d32a0d160ef2 100644
--- a/Mesh/meshGFaceOptimize.h
+++ b/Mesh/meshGFaceOptimize.h
@@ -26,10 +26,10 @@ struct edge_angle {
 };
 
 // TODO: switch to unordered_map here & verify deterministic bahavior
-typedef std::map<MVertex *, std::vector<MElement *>, MVertexLessThanNum> v2t_cont;
+typedef std::map<MVertex *, std::vector<MElement *>, MVertexPtrLessThan> v2t_cont;
 //typedef std::unordered_map<MVertex *, std::vector<MElement *> > v2t_cont;
 
-typedef std::map<MEdge, std::pair<MElement *, MElement *>, Less_Edge> e2t_cont;
+typedef std::map<MEdge, std::pair<MElement *, MElement *>, MEdgeLessThan> e2t_cont;
 
 template <class T>
 void buildVertexToElement(std::vector<T *> const &elements, v2t_cont &adj)
diff --git a/Mesh/meshGRegion.cpp b/Mesh/meshGRegion.cpp
index 2e2582f748a1171200c965d7080ea67c0779b3f8..e20fdc45a0265cbc2fa771e25f83b463433b984a 100644
--- a/Mesh/meshGRegion.cpp
+++ b/Mesh/meshGRegion.cpp
@@ -58,7 +58,7 @@ int splitQuadRecovery::buildPyramids(GModel *gm)
     for(std::size_t i = 0; i < faces.size(); i++){
       GFace *gf = faces[i];
       for(std::size_t j = 0; j < gf->quadrangles.size(); j++){
-        std::map<MFace, MVertex *, Less_Face>::iterator it2 =
+        std::map<MFace, MVertex *, MFaceLessThan>::iterator it2 =
           _quad.find(gf->quadrangles[j]->getFace(0));
         if(it2 != _quad.end()){
           npyram++;
@@ -101,7 +101,7 @@ void MeshDelaunayVolume(std::vector<GRegion *> &regions)
   GRegion *gr = regions[0];
   std::vector<GFace *> faces = gr->faces();
 
-  std::set<GFace *, GEntityLessThan> allFacesSet;
+  std::set<GFace *, GEntityPtrLessThan> allFacesSet;
   for(std::size_t i = 0; i < regions.size(); i++) {
     std::vector<GFace *> const &f = regions[i]->faces();
     std::vector<GFace *> const &f_e = regions[i]->embeddedFaces();
@@ -112,8 +112,8 @@ void MeshDelaunayVolume(std::vector<GRegion *> &regions)
   // replace faces with compounds if elements from compound surface meshes are
   // not reclassified on the original surfaces
   if(CTX::instance()->mesh.compoundClassify == 0){
-    std::set<GFace *, GEntityLessThan> comp;
-    for(std::set<GFace *, GEntityLessThan>::iterator it = allFacesSet.begin();
+    std::set<GFace *, GEntityPtrLessThan> comp;
+    for(std::set<GFace *, GEntityPtrLessThan>::iterator it = allFacesSet.begin();
         it != allFacesSet.end(); it++){
       GFace *gf = *it;
       if(!gf->compoundSurface)
@@ -160,7 +160,7 @@ void MeshDelaunayVolume(std::vector<GRegion *> &regions)
 
   // restore set of faces and embedded edges/vertices
   if(CTX::instance()->mesh.compoundClassify == 0){
-    std::set<GFace *, GEntityLessThan> comp;
+    std::set<GFace *, GEntityPtrLessThan> comp;
     for(std::size_t i = 0; i < faces.size(); i++) {
       GFace *gf = faces[i];
       if(!gf->compoundSurface)
diff --git a/Mesh/meshGRegion.h b/Mesh/meshGRegion.h
index 65f9f80bf4bc55dac6d2fe580316caf21e10ee30..57eca57815b2746a8e48518fc397d900aa38a08d 100644
--- a/Mesh/meshGRegion.h
+++ b/Mesh/meshGRegion.h
@@ -57,7 +57,7 @@ int SubdivideExtrudedMesh(GModel *m);
 void carveHole(GRegion *gr, int num, double distance,
                std::vector<int> &surfaces);
 
-typedef std::map<MFace, GFace *, Less_Face> fs_cont;
+typedef std::map<MFace, GFace *, MFaceLessThan> fs_cont;
 typedef std::multimap<MVertex *, std::pair<MLine *, GEdge *> > es_cont;
 GFace *findInFaceSearchStructure(MVertex *p1, MVertex *p2, MVertex *p3,
                                  const fs_cont &search);
@@ -70,13 +70,13 @@ bool buildEdgeSearchStructure(GModel *model, es_cont &search);
 // hybrid mesh recovery structure
 class splitQuadRecovery {
 private:
-  std::map<MFace, MVertex *, Less_Face> _quad;
-  std::map<MFace, GFace *, Less_Face> _tri;
+  std::map<MFace, MVertex *, MFaceLessThan> _quad;
+  std::map<MFace, GFace *, MFaceLessThan> _tri;
 public:
   splitQuadRecovery() {}
   void add(const MFace &f, MVertex *v, GFace *gf);
-  std::map<MFace, GFace *, Less_Face> &getTri() { return _tri; }
-  std::map<MFace, MVertex *, Less_Face> &getQuad() { return _quad; }
+  std::map<MFace, GFace *, MFaceLessThan> &getTri() { return _tri; }
+  std::map<MFace, MVertex *, MFaceLessThan> &getQuad() { return _quad; }
   int buildPyramids(GModel *gm);
 };
 
diff --git a/Mesh/meshGRegionBoundaryLayer.cpp b/Mesh/meshGRegionBoundaryLayer.cpp
index 73a0c7288d71615897a5e9da892339dbb505f119..5a43c6efbc95fdc9b6f1df92f93306bdde3f2e45 100644
--- a/Mesh/meshGRegionBoundaryLayer.cpp
+++ b/Mesh/meshGRegionBoundaryLayer.cpp
@@ -189,11 +189,11 @@ public:
   blyr_manager(GRegion *gr, std::vector<GFace *> &bls, double t)
     : _thickness(t), _gr(gr), _faces(bls)
   {
-    std::map<MFace, SVector3, Less_Face> t_normals;
+    std::map<MFace, SVector3, MFaceLessThan> t_normals;
     for(size_t i = 0; i < _gr->tetrahedra.size(); i++) {
       for(int j = 0; j < 4; j++) {
         MFace f = _gr->tetrahedra[i]->getFace(j);
-        std::map<MFace, SVector3, Less_Face>::iterator it = t_normals.find(f);
+        std::map<MFace, SVector3, MFaceLessThan>::iterator it = t_normals.find(f);
         if(it == t_normals.end()) {
           SVector3 n = f.normal();
           MVertex *v = _gr->tetrahedra[i]->getVertex(3 - j);
@@ -260,7 +260,7 @@ public:
     for(size_t i = 0; i < bls.size(); i++) {
       for(size_t j = 0; j < bls[i]->triangles.size(); j++) {
         MTriangle *t = bls[i]->triangles[j];
-        std::map<MFace, SVector3, Less_Face>::iterator it =
+        std::map<MFace, SVector3, MFaceLessThan>::iterator it =
           t_normals.find(t->getFace(0));
         SVector3 n;
         if(it == t_normals.end())
diff --git a/Mesh/meshGRegionBoundaryRecovery.cpp b/Mesh/meshGRegionBoundaryRecovery.cpp
index 18e5f84989a6df78584fe0f9b7a76362cb0321c9..1eb921cace13a5dbc318e864507718eade797cac 100644
--- a/Mesh/meshGRegionBoundaryRecovery.cpp
+++ b/Mesh/meshGRegionBoundaryRecovery.cpp
@@ -155,7 +155,7 @@ namespace tetgenBR {
     std::map<int, MVertex *> _extras;
     // Get the set of vertices from GRegion.
     {
-      std::set<MVertex *, MVertexLessThanNum> all;
+      std::set<MVertex *, MVertexPtrLessThan> all;
       std::vector<GFace *> const &f = _gr->faces();
       for(std::vector<GFace *>::const_iterator it = f.begin(); it != f.end();
           ++it) {
@@ -531,8 +531,8 @@ namespace tetgenBR {
       } // it
 
       if(_sqr){
-        std::map<MFace, GFace *, Less_Face> f = _sqr->getTri();
-        for(std::map<MFace, GFace *, Less_Face>::iterator it = f.begin();
+        std::map<MFace, GFace *, MFaceLessThan> f = _sqr->getTri();
+        for(std::map<MFace, GFace *, MFaceLessThan>::iterator it = f.begin();
             it != f.end(); it++){
           const MFace &mf = it->first;
           for(int j = 0; j < 3; j++) {
diff --git a/Mesh/meshGRegionCarveHole.cpp b/Mesh/meshGRegionCarveHole.cpp
index ad30e82bbb3d2fab8f7d267cff6839e99328f783..acea3b2e636dfbaa216307c1df8c4529b0b763a4 100644
--- a/Mesh/meshGRegionCarveHole.cpp
+++ b/Mesh/meshGRegionCarveHole.cpp
@@ -55,12 +55,12 @@ void carveHole(std::vector<T *> &elements, double distance, ANNkd_tree *kdtree)
 }
 
 template <class T>
-void addFaces(std::vector<T *> &elements, std::set<MFace, Less_Face> &faces)
+void addFaces(std::vector<T *> &elements, std::set<MFace, MFaceLessThan> &faces)
 {
   for(std::size_t i = 0; i < elements.size(); i++) {
     for(int j = 0; j < elements[i]->getNumFaces(); j++) {
       MFace f = elements[i]->getFace(j);
-      std::set<MFace, Less_Face>::iterator it = faces.find(f);
+      std::set<MFace, MFaceLessThan>::iterator it = faces.find(f);
       if(it == faces.end())
         faces.insert(f);
       else
@@ -117,7 +117,7 @@ void carveHole(GRegion *gr, int num, double distance,
   // generate discrete boundary mesh of the carved hole
   GFace *gf = m->getFaceByTag(num);
   if(!gf) return;
-  std::set<MFace, Less_Face> faces;
+  std::set<MFace, MFaceLessThan> faces;
   std::vector<GFace *> f = gr->faces();
   for(std::vector<GFace *>::iterator it = f.begin(); it != f.end(); it++) {
     addFaces((*it)->triangles, faces);
@@ -129,7 +129,7 @@ void carveHole(GRegion *gr, int num, double distance,
   addFaces(gr->pyramids, faces);
 
   std::set<MVertex *> verts;
-  for(std::set<MFace, Less_Face>::iterator it = faces.begin();
+  for(std::set<MFace, MFaceLessThan>::iterator it = faces.begin();
       it != faces.end(); it++) {
     for(std::size_t i = 0; i < it->getNumVertices(); i++) {
       it->getVertex(i)->setEntity(gf);
diff --git a/Mesh/meshGRegionDelaunayInsertion.cpp b/Mesh/meshGRegionDelaunayInsertion.cpp
index 87c83c4a52fa2afeba52ad3bbbf83136b5b452a4..ab3ad1a94d2475f34de2c318e11dbae83a8dbf37 100644
--- a/Mesh/meshGRegionDelaunayInsertion.cpp
+++ b/Mesh/meshGRegionDelaunayInsertion.cpp
@@ -32,8 +32,8 @@ static void testIfBoundaryIsRecovered(GRegion *gr)
   std::vector<GEdge *> const &e = gr->edges();
   std::vector<GFace *> f = gr->faces();
 
-  std::map<MEdge, GEdge *, Less_Edge> edges;
-  std::map<MFace, GFace *, Less_Face> faces;
+  std::map<MEdge, GEdge *, MEdgeLessThan> edges;
+  std::map<MFace, GFace *, MFaceLessThan> faces;
 
   std::vector<GEdge *>::const_iterator it = e.begin();
   std::vector<GFace *>::iterator itf = f.begin();
@@ -112,7 +112,7 @@ struct edgeContainerB {
 };
 
 static void createAllEmbeddedEdges(GRegion *gr,
-                                   std::set<MEdge, Less_Edge> &allEmbeddedEdges)
+                                   std::set<MEdge, MEdgeLessThan> &allEmbeddedEdges)
 {
   std::vector<GEdge *> const &e = gr->embeddedEdges();
   for(std::vector<GEdge *>::const_iterator it = e.begin(); it != e.end();
@@ -137,7 +137,7 @@ static void createAllEmbeddedEdges(GRegion *gr, edgeContainerB &embedded)
 }
 
 static void createAllEmbeddedFaces(GRegion *gr,
-                                   std::set<MFace, Less_Face> &allEmbeddedFaces)
+                                   std::set<MFace, MFaceLessThan> &allEmbeddedFaces)
 {
   std::vector<GFace *> const &f = gr->embeddedFaces();
   for(std::vector<GFace *>::const_iterator it = f.begin(); it != f.end();
@@ -249,7 +249,7 @@ void connectTets_vector2_templ(std::size_t _size, ITER beg, ITER end,
 
 template <class ITER>
 void connectTets(ITER beg, ITER end,
-                 const std::set<MFace, Less_Face> *allEmbeddedFaces = 0)
+                 const std::set<MFace, MFaceLessThan> *allEmbeddedFaces = 0)
 {
   std::set<faceXtet> conn;
   while(beg != end) {
@@ -275,13 +275,13 @@ void connectTets(ITER beg, ITER end,
 }
 
 void connectTets(std::list<MTet4 *> &l,
-                 const std::set<MFace, Less_Face> *embeddedFaces)
+                 const std::set<MFace, MFaceLessThan> *embeddedFaces)
 {
   connectTets(l.begin(), l.end(), embeddedFaces);
 }
 
 void connectTets(std::vector<MTet4 *> &l,
-                 const std::set<MFace, Less_Face> *embeddedFaces)
+                 const std::set<MFace, MFaceLessThan> *embeddedFaces)
 {
   connectTets(l.begin(), l.end(), embeddedFaces);
 }
@@ -464,7 +464,7 @@ bool insertVertexB(std::vector<faceXtet> &shell, std::vector<MTet4 *> &cavity,
                    std::vector<double> &vSizes, std::vector<double> &vSizesBGM,
                    MTet4 *t, MTet4Factory &myFactory,
                    std::set<MTet4 *, compareTet4Ptr> &allTets,
-                   const std::set<MFace, Less_Face> &allEmbeddedFaces)
+                   const std::set<MFace, MFaceLessThan> &allEmbeddedFaces)
 {
   std::vector<MTet4 *> new_cavity;
   new_cavity.reserve(shell.size());
@@ -520,8 +520,8 @@ bool insertVertexB(std::vector<faceXtet> &shell, std::vector<MTet4 *> &cavity,
 }
 
 static void setLcs(MTriangle *t,
-                   std::map<MVertex *, double, MVertexLessThanNum> &vSizes,
-                   std::set<MVertex *, MVertexLessThanNum> &bndVertices)
+                   std::map<MVertex *, double, MVertexPtrLessThan> &vSizes,
+                   std::set<MVertex *, MVertexPtrLessThan> &bndVertices)
 {
   for(int i = 0; i < 3; i++) {
     bndVertices.insert(t->getVertex(i));
@@ -532,9 +532,9 @@ static void setLcs(MTriangle *t,
     double dy = vi->y() - vj->y();
     double dz = vi->z() - vj->z();
     double l = std::sqrt(dx * dx + dy * dy + dz * dz);
-    std::map<MVertex *, double, MVertexLessThanNum>::iterator iti =
+    std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
       vSizes.find(vi);
-    std::map<MVertex *, double, MVertexLessThanNum>::iterator itj =
+    std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
       vSizes.find(vj);
     if(CTX::instance()->mesh.lcExtendFromBoundary == 2) {
       // use smallest edge length
@@ -576,8 +576,8 @@ static void setLcs(MTriangle *t,
 }
 
 static void setLcs(MTetrahedron *t,
-                   std::map<MVertex *, double, MVertexLessThanNum> &vSizes,
-                   std::set<MVertex *, MVertexLessThanNum> &bndVertices)
+                   std::map<MVertex *, double, MVertexPtrLessThan> &vSizes,
+                   std::set<MVertex *, MVertexPtrLessThan> &bndVertices)
 {
   for(int i = 0; i < 4; i++) {
     for(int j = i + 1; j < 4; j++) {
@@ -586,7 +586,7 @@ static void setLcs(MTetrahedron *t,
 
       // smallest tet edge
       if(bndVertices.find(vi) == bndVertices.end()) {
-        std::map<MVertex *, double, MVertexLessThanNum>::iterator iti =
+        std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
           vSizes.find(vi);
 
         double const length =
@@ -596,7 +596,7 @@ static void setLcs(MTetrahedron *t,
       }
 
       if(bndVertices.find(vj) == bndVertices.end()) {
-        std::map<MVertex *, double, MVertexLessThanNum>::iterator itj =
+        std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
           vSizes.find(vj);
 
         double const length =
@@ -702,9 +702,9 @@ void adaptMeshGRegion::operator()(GRegion *gr)
   }
   gr->tetrahedra.clear();
 
-  std::set<MFace, Less_Face> allEmbeddedFaces;
+  std::set<MFace, MFaceLessThan> allEmbeddedFaces;
   createAllEmbeddedFaces(gr, allEmbeddedFaces);
-  std::set<MEdge, Less_Edge> allEmbeddedEdges;
+  std::set<MEdge, MEdgeLessThan> allEmbeddedEdges;
   createAllEmbeddedEdges(gr, allEmbeddedEdges);
 
   connectTets(allTets.begin(), allTets.end(), &allEmbeddedFaces);
@@ -895,10 +895,10 @@ void optimizeMesh(GRegion *gr, const qmTetrahedron::Measures &qm)
   }
   gr->tetrahedra.clear();
 
-  std::set<MFace, Less_Face> allEmbeddedFaces;
+  std::set<MFace, MFaceLessThan> allEmbeddedFaces;
   createAllEmbeddedFaces(gr, allEmbeddedFaces);
 
-  std::set<MEdge, Less_Edge> allEmbeddedEdges;
+  std::set<MEdge, MEdgeLessThan> allEmbeddedEdges;
   createAllEmbeddedEdges(gr, allEmbeddedEdges);
 
   if(allEmbeddedFaces.empty()) {
@@ -1172,7 +1172,7 @@ static int isCavityCompatibleWithEmbeddedEdges(std::vector<MTet4 *> &cavity,
 
 static int isCavityCompatibleWithEmbeddedFace(
   const std::vector<MTet4 *> &cavity, const std::vector<faceXtet> &shell,
-  const std::set<MFace, Less_Face> &allEmbeddedFaces)
+  const std::set<MFace, MFaceLessThan> &allEmbeddedFaces)
 {
   if (allEmbeddedFaces.empty())return 1;
   std::vector<MFace> shellFaces;
@@ -1201,7 +1201,7 @@ static int isCavityCompatibleWithEmbeddedFace(
 
 static void _deleteUnusedVertices(GRegion *gr)
 {
-  std::set<MVertex *, MVertexLessThanNum> allverts;
+  std::set<MVertex *, MVertexPtrLessThan> allverts;
   for(std::size_t i = 0; i < gr->tetrahedra.size(); i++) {
     for(int j = 0; j < 4; j++) {
       if(gr->tetrahedra[i]->getVertex(j)->onWhat() == gr)
@@ -1233,8 +1233,8 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
 
   // leave this in a block so the map gets deallocated directly
   {
-    std::map<MVertex *, double, MVertexLessThanNum> vSizesMap;
-    std::set<MVertex *, MVertexLessThanNum> bndVertices;
+    std::map<MVertex *, double, MVertexPtrLessThan> vSizesMap;
+    std::set<MVertex *, MVertexPtrLessThan> bndVertices;
 
     for(GModel::riter rit = gr->model()->firstRegion();
         rit != gr->model()->lastRegion(); ++rit) {
@@ -1249,9 +1249,9 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
           double dz = vi->z() - vj->z();
           double l = std::sqrt(dx * dx + dy * dy + dz * dz);
 
-          std::map<MVertex *, double, MVertexLessThanNum>::iterator iti =
+          std::map<MVertex *, double, MVertexPtrLessThan>::iterator iti =
             vSizesMap.find(vi);
-          std::map<MVertex *, double, MVertexLessThanNum>::iterator itj =
+          std::map<MVertex *, double, MVertexPtrLessThan>::iterator itj =
             vSizesMap.find(vj);
 
           // smallest tet edge
@@ -1268,7 +1268,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
           it != vertices.end(); ++it) {
         MVertex *v = (*it)->getMeshVertex(0);
         double l = (*it)->prescribedMeshSizeAtVertex();
-        std::map<MVertex *, double, MVertexLessThanNum>::iterator itv =
+        std::map<MVertex *, double, MVertexPtrLessThan>::iterator itv =
           vSizesMap.find(v);
         if(itv == vSizesMap.end() || itv->second > l) vSizesMap[v] = l;
       }
@@ -1284,7 +1284,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     for(std::size_t i = 0; i < gr->tetrahedra.size(); i++)
       setLcs(gr->tetrahedra[i], vSizesMap, bndVertices);
 
-    for(std::map<MVertex *, double, MVertexLessThanNum>::iterator it =
+    for(std::map<MVertex *, double, MVertexPtrLessThan>::iterator it =
           vSizesMap.begin();
         it != vSizesMap.end(); ++it) {
       it->first->setIndex(NUM++);
@@ -1370,7 +1370,7 @@ void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarge
     (*it)->setNeigh(3, 0);
   }
   // store all embedded faces
-  std::set<MFace, Less_Face> allEmbeddedFaces;
+  std::set<MFace, MFaceLessThan> allEmbeddedFaces;
   edgeContainerB allEmbeddedEdges;
   for(GModel::riter it = gr->model()->firstRegion();
       it != gr->model()->lastRegion(); ++it) {
diff --git a/Mesh/meshGRegionDelaunayInsertion.h b/Mesh/meshGRegionDelaunayInsertion.h
index 038d7233c8cf6bbde03079b45cf4b4d2afe24fe9..cf11800c36ee92476ef725e5587c2664f40be654 100644
--- a/Mesh/meshGRegionDelaunayInsertion.h
+++ b/Mesh/meshGRegionDelaunayInsertion.h
@@ -215,8 +215,8 @@ public:
   }
 };
 
-void connectTets(std::list<MTet4 *> &, const std::set<MFace, Less_Face> * = 0);
-void connectTets(std::vector<MTet4 *> &, const std::set<MFace, Less_Face> * = 0);
+void connectTets(std::list<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = 0);
+void connectTets(std::vector<MTet4 *> &, const std::set<MFace, MFaceLessThan> * = 0);
 void delaunayMeshIn3D(std::vector<MVertex *> &, std::vector<MTetrahedron *> &);
 void insertVerticesInRegion(GRegion *gr, int maxIter, double worstTetRadiusTarget,
                             bool _classify = true, splitQuadRecovery *sqr = 0);
diff --git a/Mesh/meshGRegionHxt.cpp b/Mesh/meshGRegionHxt.cpp
index 8eb318de7b18665f8e9e21f154bced2e80d44416..9e8ce3c612fb724c2b0de340a3ac044ff3cad93d 100644
--- a/Mesh/meshGRegionHxt.cpp
+++ b/Mesh/meshGRegionHxt.cpp
@@ -45,7 +45,7 @@ static HXTStatus getAllFacesOfAllRegions(std::vector<GRegion *> &regions,
                                          HXTMesh *m,
                                          std::vector<GFace *> &allFaces)
 {
-  std::set<GFace *, GEntityLessThan> allFacesSet;
+  std::set<GFace *, GEntityPtrLessThan> allFacesSet;
   if(m) {
     m->brep.numVolumes = regions.size();
     HXT_CHECK(hxtAlignedMalloc(&m->brep.numSurfacesPerVolume,
@@ -96,7 +96,7 @@ static HXTStatus getAllEdgesOfAllFaces(std::vector<GFace *> &faces, HXTMesh *m,
   }
   uint32_t to_alloc = 0;
 
-  std::set<GEdge *, GEntityLessThan> allEdgesSet;
+  std::set<GEdge *, GEntityPtrLessThan> allEdgesSet;
   for(std::size_t i = 0; i < faces.size(); i++) {
     std::vector<GEdge *> const &f = faces[i]->edges();
     std::vector<GEdge *> const &f_e = faces[i]->embeddedEdges();
diff --git a/Mesh/meshGRegionLocalMeshMod.cpp b/Mesh/meshGRegionLocalMeshMod.cpp
index f6df076c56a15dd043094440ce8342113189be7c..5aba7cc6bf70a8389d57d8669b634a7ea5ec9ff4 100644
--- a/Mesh/meshGRegionLocalMeshMod.cpp
+++ b/Mesh/meshGRegionLocalMeshMod.cpp
@@ -238,7 +238,7 @@ void BuildSwapPattern7(SwapPattern *sc)
 
 bool edgeSwap(std::vector<MTet4 *> &newTets, MTet4 *tet, int iLocalEdge,
               const qmTetrahedron::Measures &cr,
-              const std::set<MFace, Less_Face> &embeddedFaces)
+              const std::set<MFace, MFaceLessThan> &embeddedFaces)
 {
   // static int edges[6][2] =    {{0,1},{0,2},{0,3},{1,2},{1,3},{2,3}};
   int permut[6] = {0, 3, 1, 2, 5, 4};
@@ -391,7 +391,7 @@ bool edgeSplit(std::vector<MTet4 *> &newTets, MTet4 *tet, MVertex *newVertex,
 // swap a face i.e. remove a face shared by 2 tets
 bool faceSwap(std::vector<MTet4 *> &newTets, MTet4 *t1, int iLocalFace,
               const qmTetrahedron::Measures &cr,
-              const std::set<MFace, Less_Face> &embeddedFaces)
+              const std::set<MFace, MFaceLessThan> &embeddedFaces)
 {
   MTet4 *t2 = t1->getNeigh(iLocalFace);
   if(!t2) return false;
diff --git a/Mesh/meshGRegionLocalMeshMod.h b/Mesh/meshGRegionLocalMeshMod.h
index 2daf41aabf42b4487b96b32e0721fa42153835fe..6a200a890cc42a2ba553e4722fa4d0827a4d8cf3 100644
--- a/Mesh/meshGRegionLocalMeshMod.h
+++ b/Mesh/meshGRegionLocalMeshMod.h
@@ -18,11 +18,11 @@ int LaplaceSmoothing(GRegion *gr);
 
 bool edgeSwap(std::vector<MTet4 *> &newTets, MTet4 *tet, int iLocalEdge,
               const qmTetrahedron::Measures &cr,
-              const std::set<MFace, Less_Face> &embeddedFaces);
+              const std::set<MFace, MFaceLessThan> &embeddedFaces);
 
 bool faceSwap(std::vector<MTet4 *> &newTets, MTet4 *tet, int iLocalFace,
               const qmTetrahedron::Measures &cr,
-              const std::set<MFace, Less_Face> &embeddedFaces);
+              const std::set<MFace, MFaceLessThan> &embeddedFaces);
 
 bool smoothVertex(MTet4 *t, int iLocalVertex,
                   const qmTetrahedron::Measures &cr);
diff --git a/Mesh/meshGRegionNetgen.cpp b/Mesh/meshGRegionNetgen.cpp
index ffe130473b908a01e27541c54c90f6b1266eb22d..ff54a07301d6a5355f0af68ed8ec5dff898611ed 100644
--- a/Mesh/meshGRegionNetgen.cpp
+++ b/Mesh/meshGRegionNetgen.cpp
@@ -24,7 +24,7 @@ namespace nglib {
 using namespace nglib;
 
 static void getAllBoundingVertices(
-  GRegion *gr, std::set<MVertex *, MVertexLessThanNum> &allBoundingVertices)
+  GRegion *gr, std::set<MVertex *, MVertexPtrLessThan> &allBoundingVertices)
 {
   std::vector<GFace *> faces = gr->faces();
   std::vector<GFace *>::iterator it = faces.begin();
@@ -48,10 +48,10 @@ static Ng_Mesh *buildNetgenStructure(GRegion *gr, bool importVolumeMesh,
   Ng_Init();
   Ng_Mesh *ngmesh = Ng_NewMesh();
 
-  std::set<MVertex *, MVertexLessThanNum> allBoundingVertices;
+  std::set<MVertex *, MVertexPtrLessThan> allBoundingVertices;
   getAllBoundingVertices(gr, allBoundingVertices);
 
-  std::set<MVertex *, MVertexLessThanNum>::iterator itv =
+  std::set<MVertex *, MVertexPtrLessThan>::iterator itv =
     allBoundingVertices.begin();
   int I = 1;
   while(itv != allBoundingVertices.end()) {
diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp
index 02161cf1f6af2d72d50eecc95209855a026d649f..6d470ac176ea3825f8eaaeae26691fbc1d935aee 100644
--- a/Mesh/meshPartition.cpp
+++ b/Mesh/meshPartition.cpp
@@ -31,28 +31,30 @@
 #define hashmapface                                                            \
   std::unordered_map<                                                          \
     MFace, std::vector<std::pair<MElement *, std::vector<unsigned int> > >,    \
-    Hash_Face, Equal_Face>
+    MFaceHash, MFaceEqual>
 #define hashmapedge                                                            \
   std::unordered_map<                                                          \
     MEdge, std::vector<std::pair<MElement *, std::vector<unsigned int> > >,    \
-    Hash_Edge, Equal_Edge>
+    MEdgeHash, MEdgeEqual>
 #define hashmapvertex                                                          \
   std::unordered_map<                                                          \
     MVertex *,                                                                 \
-    std::vector<std::pair<MElement *, std::vector<unsigned int> > > >
+    std::vector<std::pair<MElement *, std::vector<unsigned int> > >,           \
+    MVertexPtrHash, MVertexPtrEqual>
 #else
 #define hashmap std::map
 #define hashmapface                                                            \
   std::map<MFace,                                                              \
            std::vector<std::pair<MElement *, std::vector<unsigned int> > >,    \
-           Less_Face>
+           MFaceLessThan>
 #define hashmapedge                                                            \
   std::map<MEdge,                                                              \
            std::vector<std::pair<MElement *, std::vector<unsigned int> > >,    \
-           Less_Edge>
+           MEdgeLessThan>
 #define hashmapvertex                                                          \
   std::map<MVertex *,                                                          \
-           std::vector<std::pair<MElement *, std::vector<unsigned int> > > >
+           std::vector<std::pair<MElement *, std::vector<unsigned int> > >,    \
+           MVertexPtrLessThan>
 #endif
 
 #if defined(HAVE_METIS)
@@ -960,10 +962,10 @@ fillConnectedElements(std::vector<std::set<MElement *> > &connectedElements,
 
 static bool
 dividedNonConnectedEntities(GModel *const model, int dim,
-                            std::set<GRegion *, GEntityLessThan> &regions,
-                            std::set<GFace *, GEntityLessThan> &faces,
-                            std::set<GEdge *, GEntityLessThan> &edges,
-                            std::set<GVertex *, GEntityLessThan> &vertices)
+                            std::set<GRegion *, GEntityPtrLessThan> &regions,
+                            std::set<GFace *, GEntityPtrLessThan> &faces,
+                            std::set<GEdge *, GEntityPtrLessThan> &edges,
+                            std::set<GVertex *, GEntityPtrLessThan> &vertices)
 {
   bool ret = false;
   // Loop over vertices
@@ -1303,10 +1305,10 @@ dividedNonConnectedEntities(GModel *const model, int dim,
 static void CreateNewEntities(GModel *const model,
                               hashmap<MElement *, unsigned int> &elmToPartition)
 {
-  std::set<GRegion *, GEntityLessThan> regions = model->getRegions();
-  std::set<GFace *, GEntityLessThan> faces = model->getFaces();
-  std::set<GEdge *, GEntityLessThan> edges = model->getEdges();
-  std::set<GVertex *, GEntityLessThan> vertices = model->getVertices();
+  std::set<GRegion *, GEntityPtrLessThan> regions = model->getRegions();
+  std::set<GFace *, GEntityPtrLessThan> faces = model->getFaces();
+  std::set<GEdge *, GEntityPtrLessThan> edges = model->getEdges();
+  std::set<GVertex *, GEntityPtrLessThan> vertices = model->getVertices();
 
   int elementaryNumber = model->getMaxElementaryNumber(0);
   for(GModel::const_viter it = vertices.begin(); it != vertices.end(); ++it) {
@@ -1903,10 +1905,10 @@ static void CreatePartitionTopology(
   hashmapedge edgeToElement;
   hashmapvertex vertexToElement;
 
-  std::set<GRegion *, GEntityLessThan> regions = model->getRegions();
-  std::set<GFace *, GEntityLessThan> faces = model->getFaces();
-  std::set<GEdge *, GEntityLessThan> edges = model->getEdges();
-  std::set<GVertex *, GEntityLessThan> vertices = model->getVertices();
+  std::set<GRegion *, GEntityPtrLessThan> regions = model->getRegions();
+  std::set<GFace *, GEntityPtrLessThan> faces = model->getFaces();
+  std::set<GEdge *, GEntityPtrLessThan> edges = model->getEdges();
+  std::set<GVertex *, GEntityPtrLessThan> vertices = model->getVertices();
 
   if(meshDim >= 3) {
     Msg::Info(" - Creating partition surfaces");
@@ -2437,10 +2439,10 @@ static void assignToParent(std::set<MVertex *> &verts, PART_ENTITY *entity,
 int UnpartitionMesh(GModel *const model)
 {
   // make a copy so we can iterate safely (we will remove some entities)
-  std::set<GRegion *, GEntityLessThan> regions = model->getRegions();
-  std::set<GFace *, GEntityLessThan> faces = model->getFaces();
-  std::set<GEdge *, GEntityLessThan> edges = model->getEdges();
-  std::set<GVertex *, GEntityLessThan> vertices = model->getVertices();
+  std::set<GRegion *, GEntityPtrLessThan> regions = model->getRegions();
+  std::set<GFace *, GEntityPtrLessThan> faces = model->getFaces();
+  std::set<GEdge *, GEntityPtrLessThan> edges = model->getEdges();
+  std::set<GVertex *, GEntityPtrLessThan> vertices = model->getVertices();
 
   std::set<MVertex *> verts;
 
diff --git a/Mesh/meshRefine.cpp b/Mesh/meshRefine.cpp
index 82ff44068c784546030dd7aefe3ce3843d8b0db3..a779b1d5c288ba9bd3ef14728904d99725868ea1 100644
--- a/Mesh/meshRefine.cpp
+++ b/Mesh/meshRefine.cpp
@@ -20,13 +20,13 @@
 #include "OS.h"
 #include "meshGFaceOptimize.h"
 
-typedef std::map<MFace, std::vector<MVertex *>, Less_Face> faceContainer;
+typedef std::map<MFace, std::vector<MVertex *>, MFaceLessThan> faceContainer;
 
 void subdivide_pyramid(MElement *element, GRegion *gr,
                        faceContainer &faceVertices,
                        std::vector<MHexahedron *> &dwarfs88);
 
-struct MVertexLessThanParam {
+struct MVertexPtrLessThanParam {
   bool operator()(const MVertex *v1, const MVertex *v2) const
   {
     double u1 = 0., u2 = 1.;
@@ -99,7 +99,7 @@ static void Subdivide(GEdge *ge)
 
   // 2nd order meshing destroyed the ordering of the vertices on the edge
   std::sort(ge->mesh_vertices.begin(), ge->mesh_vertices.end(),
-            MVertexLessThanParam());
+            MVertexPtrLessThanParam());
   for(std::size_t i = 0; i < ge->mesh_vertices.size(); i++)
     ge->mesh_vertices[i]->setPolynomialOrder(1);
   ge->deleteVertexArrays();
diff --git a/Mesh/qualityMeasuresJacobian.cpp b/Mesh/qualityMeasuresJacobian.cpp
index 2c56d1094317c545700bc46d8705f9a026fa3638..486529afe2760987dd63ca4668494d220d0e7a56 100644
--- a/Mesh/qualityMeasuresJacobian.cpp
+++ b/Mesh/qualityMeasuresJacobian.cpp
@@ -973,7 +973,7 @@ namespace jacobianBasedQuality {
   void testAllMeasuresAllElements()
   {
     GModel *m = GModel::current();
-    std::set<GEntity *, GEntityLessThan> entities;
+    std::set<GEntity *, GEntityPtrLessThan> entities;
     for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); it++)
       entities.insert(*it);
     for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++)
@@ -981,7 +981,7 @@ namespace jacobianBasedQuality {
     for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); it++)
       entities.insert(*it);
 
-    std::set<GEntity *, GEntityLessThan>::iterator it;
+    std::set<GEntity *, GEntityPtrLessThan>::iterator it;
     for(it = entities.begin(); it != entities.end(); ++it) {
       unsigned num = (*it)->getNumMeshElements();
       for(unsigned i = 0; i < num; ++i) {
diff --git a/Plugin/AnalyseMeshQuality.cpp b/Plugin/AnalyseMeshQuality.cpp
index c5def2a76f9df626c37d0379e0289873be01d2d4..851d5d85a0f40e8c183498af7547d4c612bbd7c1 100644
--- a/Plugin/AnalyseMeshQuality.cpp
+++ b/Plugin/AnalyseMeshQuality.cpp
@@ -258,7 +258,7 @@ void GMSH_AnalyseMeshQualityPlugin::_computeMinMaxJandValidity(int dim)
 {
   if(_computedJac[dim - 1]) return;
 
-  std::set<GEntity *, GEntityLessThan> entities;
+  std::set<GEntity *, GEntityPtrLessThan> entities;
   switch(dim) {
   case 3:
     for(GModel::riter it = _m->firstRegion(); it != _m->lastRegion(); it++)
@@ -276,7 +276,7 @@ void GMSH_AnalyseMeshQualityPlugin::_computeMinMaxJandValidity(int dim)
   }
 
   int cntInverted = 0;
-  std::set<GEntity *, GEntityLessThan>::iterator it;
+  std::set<GEntity *, GEntityPtrLessThan>::iterator it;
   for(it = entities.begin(); it != entities.end(); ++it) {
     GEntity *entity = *it;
     unsigned num = entity->getNumMeshElements();
diff --git a/Plugin/Crack.cpp b/Plugin/Crack.cpp
index d169a10e3b2916c403121fcfc6ffd41679da67d0..7a013faa0a2d0ad7de1163dd0b5551d132cc1500 100644
--- a/Plugin/Crack.cpp
+++ b/Plugin/Crack.cpp
@@ -62,7 +62,7 @@ public:
   std::vector<MVertex *> data;
 };
 
-struct Less_EdgeData : public std::binary_function<EdgeData, EdgeData, bool> {
+struct MEdgeDataLessThan : public std::binary_function<EdgeData, EdgeData, bool> {
   bool operator()(const EdgeData &e1, const EdgeData &e2) const
   {
     if(e1.edge.getMinVertex() < e2.edge.getMinVertex()) return true;
@@ -133,7 +133,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
     }
   }
   else {
-    std::set<EdgeData, Less_EdgeData> bnd;
+    std::set<EdgeData, MEdgeDataLessThan> bnd;
     for(std::size_t i = 0; i < crackElements.size(); i++) {
       for(std::size_t j = 0; j < crackElements[i]->getNumVertices(); j++) {
         MVertex *v = crackElements[i]->getVertex(j);
@@ -149,7 +149,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
           bnd.erase(ed);
       }
     }
-    for(std::set<EdgeData, Less_EdgeData>::iterator it = bnd.begin();
+    for(std::set<EdgeData, MEdgeDataLessThan>::iterator it = bnd.begin();
         it != bnd.end(); it++)
       bndVertices.insert(it->data.begin(), it->data.end());
   }
diff --git a/Plugin/MeshSubEntities.cpp b/Plugin/MeshSubEntities.cpp
index 2bf673035c30acd656c1d412148902ec508a734e..5c2c618710fded1600b11fe03a710a1578c150bd 100644
--- a/Plugin/MeshSubEntities.cpp
+++ b/Plugin/MeshSubEntities.cpp
@@ -106,14 +106,14 @@ PView *GMSH_MeshSubEntitiesPlugin::execute(PView *view)
     m->pruneMeshVertexAssociations();
   }
   else if(outputdim == 1) { // create line elements for mesh edges
-    std::set<MEdge, Less_Edge> edges;
+    std::set<MEdge, MEdgeLessThan> edges;
     for(std::size_t i = 0; i < elements.size(); i++) {
       for(int j = 0; j < elements[i]->getNumEdges(); j++) {
         MEdge e = elements[i]->getEdge(j);
         edges.insert(e);
       }
     }
-    for(std::set<MEdge, Less_Edge>::const_iterator it = edges.begin();
+    for(std::set<MEdge, MEdgeLessThan>::const_iterator it = edges.begin();
         it != edges.end(); ++it) {
       const MEdge &e = *it;
       GEdge *ge = 0;
diff --git a/Plugin/Skin.cpp b/Plugin/Skin.cpp
index dbe0b4cf944eeaace28239e00967643550dc9c0d..6cce46b5b902336a80da526a344b6b2adafee72e 100644
--- a/Plugin/Skin.cpp
+++ b/Plugin/Skin.cpp
@@ -191,8 +191,8 @@ static void getBoundaryFromMesh(GModel *m, int visible)
   int dim = m->getDim();
   std::vector<GEntity *> entities;
   m->getEntities(entities);
-  std::set<MFace, Less_Face> bndFaces;
-  std::set<MEdge, Less_Edge> bndEdges;
+  std::set<MFace, MFaceLessThan> bndFaces;
+  std::set<MEdge, MEdgeLessThan> bndEdges;
   for(std::size_t i = 0; i < entities.size(); i++) {
     GEntity *ge = entities[i];
     if(ge->dim() != dim) continue;
@@ -224,7 +224,7 @@ static void getBoundaryFromMesh(GModel *m, int visible)
     discreteEdge *e =
       new discreteEdge(m, m->getMaxElementaryNumber(1) + 1, 0, 0);
     m->add(e);
-    for(std::set<MEdge, Less_Edge>::iterator it = bndEdges.begin();
+    for(std::set<MEdge, MEdgeLessThan>::iterator it = bndEdges.begin();
         it != bndEdges.end(); it++) {
       e->lines.push_back(new MLine(it->getVertex(0), it->getVertex(1)));
     }
@@ -232,7 +232,7 @@ static void getBoundaryFromMesh(GModel *m, int visible)
   else if(dim == 3) {
     discreteFace *f = new discreteFace(m, m->getMaxElementaryNumber(2) + 1);
     m->add(f);
-    for(std::set<MFace, Less_Face>::iterator it = bndFaces.begin();
+    for(std::set<MFace, MFaceLessThan>::iterator it = bndFaces.begin();
         it != bndFaces.end(); it++) {
       if(it->getNumVertices() == 3)
         f->triangles.push_back(
diff --git a/Post/PViewVertexArrays.cpp b/Post/PViewVertexArrays.cpp
index a22b7a421dee17cb95709c5a222dacd755ee8b82..4aaaa6b5b971f89f46226adaf7b4af54fa312ed2 100644
--- a/Post/PViewVertexArrays.cpp
+++ b/Post/PViewVertexArrays.cpp
@@ -653,7 +653,7 @@ static void addScalarPolygon(PView *p, double **xyz, double **val, bool pre,
 
   if(opt->boundary > 0) {
     const int il[3][2] = {{0, 1}, {1, 2}, {2, 0}};
-    std::map<MEdge, int, Less_Edge> edges;
+    std::map<MEdge, int, MEdgeLessThan> edges;
     std::vector<MVertex *> verts;
     verts.reserve(numNodes);
     for(int i = 0; i < numNodes; i++)
@@ -661,7 +661,7 @@ static void addScalarPolygon(PView *p, double **xyz, double **val, bool pre,
     for(int i = 0; i < numNodes / 3; i++) {
       for(int j = 0; j < 3; j++) {
         MEdge ed(verts[3 * i + il[j][0]], verts[3 * i + il[j][1]]);
-        std::map<MEdge, int, Less_Edge>::iterator ite;
+        std::map<MEdge, int, MEdgeLessThan>::iterator ite;
         for(ite = edges.begin(); ite != edges.end(); ite++)
           if((*ite).first == ed) break;
         if(ite == edges.end())
@@ -672,7 +672,7 @@ static void addScalarPolygon(PView *p, double **xyz, double **val, bool pre,
     }
 
     opt->boundary--;
-    for(std::map<MEdge, int, Less_Edge>::iterator ite = edges.begin();
+    for(std::map<MEdge, int, MEdgeLessThan>::iterator ite = edges.begin();
         ite != edges.end(); ite++) {
       int i = (int)(*ite).second / 100;
       int j = (*ite).second % 100;
@@ -876,7 +876,7 @@ static void addOutlinePolyhedron(PView *p, double **xyz, unsigned int color,
 {
   // FIXME: this code is horribly slow
   const int it[4][3] = {{0, 2, 1}, {0, 1, 3}, {0, 3, 2}, {3, 1, 2}};
-  std::map<MFace, int, Less_Face> triFaces;
+  std::map<MFace, int, MFaceLessThan> triFaces;
   std::vector<MVertex *> verts;
   verts.reserve(numNodes);
   for(int i = 0; i < numNodes; i++)
@@ -885,7 +885,7 @@ static void addOutlinePolyhedron(PView *p, double **xyz, unsigned int color,
     for(int j = 0; j < 4; j++) {
       MFace f(verts[4 * i + it[j][0]], verts[4 * i + it[j][1]],
               verts[4 * i + it[j][2]]);
-      std::map<MFace, int, Less_Face>::iterator ite;
+      std::map<MFace, int, MFaceLessThan>::iterator ite;
       for(ite = triFaces.begin(); ite != triFaces.end(); ite++)
         if((*ite).first == f) break;
       if(ite == triFaces.end())
@@ -894,7 +894,7 @@ static void addOutlinePolyhedron(PView *p, double **xyz, unsigned int color,
         triFaces.erase(ite);
     }
   }
-  for(std::map<MFace, int, Less_Face>::iterator ite = triFaces.begin();
+  for(std::map<MFace, int, MFaceLessThan>::iterator ite = triFaces.begin();
       ite != triFaces.end(); ite++) {
     int i = (int)(*ite).second / 100;
     int j = (*ite).second % 100;
diff --git a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
index c8fb36487c3f1f27aa92467c8fe9f980cb0e665e..9f82e978f8122c9ba14fca2c9a4b3a389165529d 100644
--- a/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
+++ b/contrib/HighOrderMeshOptimizer/BoundaryLayerCurver3D.cpp
@@ -434,12 +434,12 @@ namespace BoundaryLayerCurver {
   void computeAdjacencies(VecPairMElemVecMElem &bndEl2column,
                           std::vector<std::pair<int, int> > &adjacencies)
   {
-    std::map<MEdge, int, Less_Edge> edge2element;
+    std::map<MEdge, int, MEdgeLessThan> edge2element;
     for(std::size_t i = 0; i < bndEl2column.size(); ++i) {
       MElement *el = bndEl2column[i].first;
       for(std::size_t j = 0; j < el->getNumEdges(); ++j) {
         MEdge e = el->getEdge(j);
-        std::map<MEdge, int, Less_Edge>::iterator it = edge2element.find(e);
+        std::map<MEdge, int, MEdgeLessThan>::iterator it = edge2element.find(e);
         if(it != edge2element.end()) {
           adjacencies.push_back(std::make_pair(i, it->second));
           // This is for debug purpose, we expect that two elements at most
diff --git a/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp b/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
index 56d242c8133d369de5eeba8a6deff5694139d988..a4563f4cac5263aae57c8c742cecec19fea2dd1a 100644
--- a/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
+++ b/contrib/HighOrderMeshOptimizer/HighOrderMeshFastCurving.cpp
@@ -53,8 +53,8 @@
 
 namespace {
 
-  typedef std::map<MEdge, std::vector<MElement *>, Less_Edge> MEdgeVecMEltMap;
-  typedef std::map<MFace, std::vector<MElement *>, Less_Face> MFaceVecMEltMap;
+  typedef std::map<MEdge, std::vector<MElement *>, MEdgeLessThan> MEdgeVecMEltMap;
+  typedef std::map<MFace, std::vector<MElement *>, MFaceLessThan> MFaceVecMEltMap;
 
   // Compute edge -> element connectivity (for 2D elements)
   void calcEdge2Elements(GEntity *entity, MEdgeVecMEltMap &ed2el)
diff --git a/contrib/MeshOptimizer/CADDistances.cpp b/contrib/MeshOptimizer/CADDistances.cpp
index 21ef1364c146160062e901b0ea2d7ae41a197ad9..566933a887bbaece7229fe1d8d19c7c9cf7c2e6f 100644
--- a/contrib/MeshOptimizer/CADDistances.cpp
+++ b/contrib/MeshOptimizer/CADDistances.cpp
@@ -520,7 +520,7 @@ double taylorDistanceFace(MElement *el, GFace *gf)
 void distanceFromElementsToGeometry(GModel *gm, int dim,
                                     std::map<MElement *, double> &distances)
 {
-  std::map<MEdge, double, Less_Edge> dist2Edge;
+  std::map<MEdge, double, MEdgeLessThan> dist2Edge;
   for(GModel::eiter it = gm->firstEdge(); it != gm->lastEdge(); ++it) {
     if((*it)->geomType() == GEntity::Line) continue;
     for(unsigned int i = 0; i < (*it)->lines.size(); i++) {
@@ -530,7 +530,7 @@ void distanceFromElementsToGeometry(GModel *gm, int dim,
     }
   }
 
-  std::map<MFace, double, Less_Face> dist2Face;
+  std::map<MFace, double, MFaceLessThan> dist2Face;
   for(GModel::fiter it = gm->firstFace(); it != gm->lastFace(); ++it) {
     if((*it)->geomType() == GEntity::Plane) continue;
     for(unsigned int i = 0; i < (*it)->triangles.size(); i++) {
@@ -551,12 +551,12 @@ void distanceFromElementsToGeometry(GModel *gm, int dim,
       double d = 0.;
       for(int iEdge = 0; iEdge < element->getNumEdges(); ++iEdge) {
         MEdge e = element->getEdge(iEdge);
-        std::map<MEdge, double, Less_Edge>::iterator it = dist2Edge.find(e);
+        std::map<MEdge, double, MEdgeLessThan>::iterator it = dist2Edge.find(e);
         if(it != dist2Edge.end()) d += it->second;
       }
       for(int iFace = 0; iFace < element->getNumFaces(); ++iFace) {
         MFace f = element->getFace(iFace);
-        std::map<MFace, double, Less_Face>::iterator it = dist2Face.find(f);
+        std::map<MFace, double, MFaceLessThan>::iterator it = dist2Face.find(f);
         if(it != dist2Face.end()) d += it->second;
       }
       distances[element] = d;
diff --git a/contrib/QuadTri/QuadTriExtruded2D.cpp b/contrib/QuadTri/QuadTriExtruded2D.cpp
index d5b4b1b8fde9dbe73a5c0be339641d086dbb74e0..c6e2fbbe4d77cb0ab4ddf28ab795abefe6646587 100644
--- a/contrib/QuadTri/QuadTriExtruded2D.cpp
+++ b/contrib/QuadTri/QuadTriExtruded2D.cpp
@@ -227,7 +227,7 @@ int IsValidQuadToTriTop(GFace *face, int *quadToTri, bool *detectQuadToTriTop)
     std::vector<GRegion *> all_regions;
     int numRegions = 0;
     int numTopRegions = 0;
-    std::set<GRegion *, GEntityLessThan>::iterator itreg;
+    std::set<GRegion *, GEntityPtrLessThan>::iterator itreg;
 
     for(itreg = model->firstRegion(); itreg != model->lastRegion(); itreg++)
       all_regions.push_back((*itreg));
diff --git a/contrib/QuadTri/QuadTriUtils.cpp b/contrib/QuadTri/QuadTriUtils.cpp
index 43d54eacedb1c9123c92178596f180a1fffe5117..5f9973ef78ac3c900cd5437362610d79510c6dd6 100644
--- a/contrib/QuadTri/QuadTriUtils.cpp
+++ b/contrib/QuadTri/QuadTriUtils.cpp
@@ -45,7 +45,7 @@ int IsInToroidalQuadToTri(GFace *face)
   // find the two regions adjacent to the root face. If this is a structured
   // torus, then both regions
   // should be structured extrusions and BOTH should have the same root face
-  std::set<GRegion *, GEntityLessThan>::iterator itreg;
+  std::set<GRegion *, GEntityPtrLessThan>::iterator itreg;
   for(itreg = model->firstRegion(); itreg != model->lastRegion(); itreg++) {
     // save time
     if(numRegions >= 2) break;
@@ -634,7 +634,7 @@ int GetNeighborRegionsOfFace(GFace *face, std::vector<GRegion *> &neighbors)
     regions_count = 0;
 
   // pedantic search
-  std::set<GRegion *, GEntityLessThan>::iterator itreg;
+  std::set<GRegion *, GEntityPtrLessThan>::iterator itreg;
   for(itreg = model->firstRegion(); itreg != model->lastRegion(); itreg++) {
     std::vector<GFace *> reg_faces = (*itreg)->faces();
     if(std::find(reg_faces.begin(), reg_faces.end(), face) != reg_faces.end()) {
diff --git a/contrib/domhex/BackgroundMesh2D.cpp b/contrib/domhex/BackgroundMesh2D.cpp
index 7f43ce32c9e80025a735aaadf434fb9fc654caba..166424d91523ffa4e5d9812f72fb04b01d966ff8 100644
--- a/contrib/domhex/BackgroundMesh2D.cpp
+++ b/contrib/domhex/BackgroundMesh2D.cpp
@@ -363,7 +363,7 @@ void backgroundMesh2D::updateSizes()
   // do not allow large variations in the size field
   // (Int. J. Numer. Meth. Engng. 43, 1143-1165 (1998) MESH GRADATION
   // CONTROL, BOROUCHAKI, HECHT, FREY)
-  std::set<MEdge, Less_Edge> edges;
+  std::set<MEdge, MEdgeLessThan> edges;
   for(unsigned int i = 0; i < getNumMeshElements(); i++) {
     for(int j = 0; j < getElement(i)->getNumEdges(); j++) {
       edges.insert(getElement(i)->getEdge(j));
@@ -371,7 +371,7 @@ void backgroundMesh2D::updateSizes()
   }
   const double _beta = 1.3;
   for(int i = 0; i < 0; i++) {
-    std::set<MEdge, Less_Edge>::iterator it = edges.begin();
+    std::set<MEdge, MEdgeLessThan>::iterator it = edges.begin();
     for(; it != edges.end(); ++it) {
       MVertex *v0 = it->getVertex(0);
       MVertex *v1 = it->getVertex(1);
diff --git a/contrib/domhex/directions3D.cpp b/contrib/domhex/directions3D.cpp
index 5d394c7481a5272f5442d28d367031a53857e0e4..3048165e41226a28a7e16edec91663bc87f56b63 100644
--- a/contrib/domhex/directions3D.cpp
+++ b/contrib/domhex/directions3D.cpp
@@ -1046,7 +1046,7 @@ void Frame_field::save_dist(const std::string &filename)
   std::ofstream file(filename.c_str());
   file << "View \"Distance\" {\n";
 
-  for(std::map<MEdge, double, Less_Edge>::iterator it = crossDist.begin();
+  for(std::map<MEdge, double, MEdgeLessThan>::iterator it = crossDist.begin();
       it != crossDist.end(); it++) {
     MVertex *pVerta = it->first.getVertex(0);
     MVertex *pVertb = it->first.getVertex(1);
@@ -1118,7 +1118,7 @@ void Frame_field::save_energy(GRegion *gr, const std::string &filename)
         matvec(inv, gsf[nod1], grd1);
         matvec(inv, gsf[nod2], grd2);
         SVector3 esf = sf[nod1] * SVector3(grd2) - sf[nod2] * SVector3(grd1);
-        std::map<MEdge, double, Less_Edge>::iterator it =
+        std::map<MEdge, double, MEdgeLessThan>::iterator it =
           crossDist.find(pTet->getEdge(k));
         sum += it->second * esf;
         // sum += (pTet->getVertex(nod2)->z() - pTet->getVertex(nod1)->z()) *
@@ -1752,7 +1752,7 @@ std::vector<std::pair<SPoint3, STensor3> > Frame_field::field;
 std::vector<int> Frame_field::labels;
 std::map<MVertex *, STensor3> Frame_field::crossField;
 std::map<MVertex *, double> Frame_field::crossFieldSmoothness;
-std::map<MEdge, double, Less_Edge> Frame_field::crossDist;
+std::map<MEdge, double, MEdgeLessThan> Frame_field::crossDist;
 std::map<MVertex *, std::set<MVertex *> > Frame_field::vertex_to_vertices;
 std::map<MVertex *, std::set<MElement *> > Frame_field::vertex_to_elements;
 std::vector<MVertex *> Frame_field::listVertices;
diff --git a/contrib/domhex/directions3D.h b/contrib/domhex/directions3D.h
index fb9d99a0bb534d5677b496e4bee241794d19cad4..e71e8f6fd6f330a61b93e16c9d0e4a752d07fa68 100644
--- a/contrib/domhex/directions3D.h
+++ b/contrib/domhex/directions3D.h
@@ -32,7 +32,7 @@ private:
   static std::vector<int> labels;
   static std::map<MVertex *, STensor3> crossField;
   static std::map<MVertex *, double> crossFieldSmoothness;
-  static std::map<MEdge, double, Less_Edge> crossDist;
+  static std::map<MEdge, double, MEdgeLessThan> crossDist;
   static std::vector<MVertex *> listVertices;
 #if defined(HAVE_ANN)
   static ANNkd_tree *kd_tree;
diff --git a/utils/wrappers/gmshpy/gmshGeo.i b/utils/wrappers/gmshpy/gmshGeo.i
index 0d542b0b685ebb32056cacb822897583642b5991..ef7ba72e72e8307f96e4dcaae7abb995e95177af 100644
--- a/utils/wrappers/gmshpy/gmshGeo.i
+++ b/utils/wrappers/gmshpy/gmshGeo.i
@@ -130,11 +130,11 @@ namespace std {
 %include "MHexahedron.h"
 %include "MQuadrangle.h"
 %include "MLine.h"
-%warnfilter(401) Equal_Edge;
-%warnfilter(401) Less_Edge;
+%warnfilter(401) MEdgeEqual;
+%warnfilter(401) MEdgeLessThan;
 %include "MEdge.h"
-%warnfilter(401) Equal_Face;
-%warnfilter(401) Less_Face;
+%warnfilter(401) MFaceEqual;
+%warnfilter(401) MFaceLessThan;
 %include "MFace.h"
 %include "MPoint.h"
 %ignore SVector3::operator()(int);
diff --git a/utils/wrappers/java/WrapGmsh.i b/utils/wrappers/java/WrapGmsh.i
index cebe1f35a1e5b812f9e888505a9539996bd5901b..0a6b19596c4249dc3156abb2836750643bc786b5 100644
--- a/utils/wrappers/java/WrapGmsh.i
+++ b/utils/wrappers/java/WrapGmsh.i
@@ -72,17 +72,17 @@ namespace std {
 //wrap Set from std
 %include "setWrapperGmsh.h"
 
-%template (GVertexSetWrapper) SetWrapperGmsh<GVertex*, GEntityLessThan>;
-%template (GVertexSetIterator) SetIteratorGmsh<GVertex*, GEntityLessThan>;
+%template (GVertexSetWrapper) SetWrapperGmsh<GVertex*, GEntityPtrLessThan>;
+%template (GVertexSetIterator) SetIteratorGmsh<GVertex*, GEntityPtrLessThan>;
 
-%template (GEdgeSetWrapper) SetWrapperGmsh<GEdge*, GEntityLessThan>;
-%template (GEdgeSetIterator) SetIteratorGmsh<GEdge*, GEntityLessThan>;
+%template (GEdgeSetWrapper) SetWrapperGmsh<GEdge*, GEntityPtrLessThan>;
+%template (GEdgeSetIterator) SetIteratorGmsh<GEdge*, GEntityPtrLessThan>;
 
-%template (GFaceSetWrapper) SetWrapperGmsh<GFace*, GEntityLessThan>;
-%template (GFaceSetIterator) SetIteratorGmsh<GFace*, GEntityLessThan>;
+%template (GFaceSetWrapper) SetWrapperGmsh<GFace*, GEntityPtrLessThan>;
+%template (GFaceSetIterator) SetIteratorGmsh<GFace*, GEntityPtrLessThan>;
 
-%template (GRegionSetWrapper) SetWrapperGmsh<GRegion*, GEntityLessThan>;
-%template (GRegionSetIterator) SetIteratorGmsh<GRegion*, GEntityLessThan>;
+%template (GRegionSetWrapper) SetWrapperGmsh<GRegion*, GEntityPtrLessThan>;
+%template (GRegionSetIterator) SetIteratorGmsh<GRegion*, GEntityPtrLessThan>;
 
 
 //wrap List from std