Skip to content

Commit

Permalink
#162 Fix code to avoid overly aggressive -Wshadow warnings with const…
Browse files Browse the repository at this point in the history
…ructor parameters
  • Loading branch information
artem-ogre committed Nov 13, 2023
1 parent 8aae9a9 commit 5168f56
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions CDT/include/Triangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,29 +1906,33 @@ class FixedCapacityQueue
};

template <typename T>
struct less_than_x
class less_than_x
{
const std::vector<V2d<T> >& m_vertices;

public:
less_than_x(const std::vector<V2d<T> >& vertices)
: vertices(vertices)
: m_vertices(vertices)
{}
bool operator()(const VertInd a, const VertInd b) const
{
return vertices[a].x < vertices[b].x;
return m_vertices[a].x < m_vertices[b].x;
}
const std::vector<V2d<T> >& vertices;
};

template <typename T>
struct less_than_y
class less_than_y
{
const std::vector<V2d<T> >& m_vertices;

public:
less_than_y(const std::vector<V2d<T> >& vertices)
: vertices(vertices)
: m_vertices(vertices)
{}
bool operator()(const VertInd a, const VertInd b) const
{
return vertices[a].y < vertices[b].y;
return m_vertices[a].y < m_vertices[b].y;
}
const std::vector<V2d<T> >& vertices;
};

} // namespace detail
Expand Down

0 comments on commit 5168f56

Please sign in to comment.