Skip to content

Commit e94c4c0

Browse files
committed
make indice trivially constructible
1 parent 174f279 commit e94c4c0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ namespace CGAL {
6565
/// We write -1, which is <a href="https://en.cppreference.com/w/cpp/types/numeric_limits">
6666
/// <tt>(std::numeric_limits<size_type>::max)()</tt></a>
6767
/// as `size_type` is an unsigned type.
68-
explicit SM_Index(size_type _idx=(std::numeric_limits<size_type>::max)()) : idx_(_idx) {}
68+
constexpr
69+
SM_Index() : idx_((std::numeric_limits<size_type>::max)()) {}
70+
71+
explicit SM_Index(size_type _idx) : idx_(_idx) {}
6972

7073
/// Get the underlying index of this index
7174
operator size_type() const { return idx_; }
@@ -126,7 +129,7 @@ namespace CGAL {
126129
{
127130
public:
128131

129-
SM_Vertex_index() : SM_Index<SM_Vertex_index>((std::numeric_limits<size_type>::max)()) {}
132+
SM_Vertex_index() = default;
130133

131134
explicit SM_Vertex_index(size_type _idx) : SM_Index<SM_Vertex_index>(_idx) {}
132135

@@ -171,7 +174,7 @@ namespace CGAL {
171174
typedef void pointer;
172175
typedef void reference;
173176

174-
SM_Halfedge_index() : SM_Index<SM_Halfedge_index>((std::numeric_limits<size_type>::max)()) {}
177+
SM_Halfedge_index() = default;
175178

176179
explicit SM_Halfedge_index(size_type _idx) : SM_Index<SM_Halfedge_index>(_idx) {}
177180

@@ -206,7 +209,7 @@ namespace CGAL {
206209
{
207210
public:
208211

209-
SM_Face_index() : SM_Index<SM_Face_index>((std::numeric_limits<size_type>::max)()) {}
212+
SM_Face_index() = default;
210213

211214
explicit SM_Face_index(size_type _idx) : SM_Index<SM_Face_index>(_idx) {}
212215

@@ -241,7 +244,7 @@ namespace CGAL {
241244
public:
242245
typedef std::uint32_t size_type;
243246

244-
SM_Edge_index() : halfedge_((std::numeric_limits<size_type>::max)()) { }
247+
SM_Edge_index() = default;
245248

246249
explicit SM_Edge_index(size_type idx) : halfedge_(idx * 2) { }
247250

0 commit comments

Comments
 (0)