Skip to content

Commit e69c518

Browse files
committed
Avoid class member that is a reference
1 parent 05f4ff9 commit e69c518

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/geom-functions.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,18 @@ namespace {
252252
class without_first
253253
{
254254
public:
255-
explicit without_first(point_list_t const &list) : m_list(list) {}
255+
explicit without_first(point_list_t const &list) : m_list(&list) {}
256256

257257
point_list_t::const_iterator begin()
258258
{
259-
assert(m_list.begin() != m_list.end());
260-
return std::next(m_list.begin());
259+
assert(m_list->begin() != m_list->end());
260+
return std::next(m_list->begin());
261261
}
262262

263-
point_list_t::const_iterator end() { return m_list.end(); }
263+
point_list_t::const_iterator end() { return m_list->end(); }
264264

265265
private:
266-
point_list_t const &m_list;
266+
point_list_t const *m_list;
267267
}; // class without_first
268268

269269
} // anonymous namespace

0 commit comments

Comments
 (0)