From 698c9f048ff36a06f2edbd45a7d64d6610c1272d Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Wed, 1 Jun 2016 14:25:49 +0200 Subject: [PATCH] [GL] Use std::array instead of C array. --- GeoLib/Triangle.cpp | 5 +---- GeoLib/Triangle.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/GeoLib/Triangle.cpp b/GeoLib/Triangle.cpp index f29e4568a54..b257021ab6a 100644 --- a/GeoLib/Triangle.cpp +++ b/GeoLib/Triangle.cpp @@ -23,12 +23,9 @@ namespace GeoLib { Triangle::Triangle (std::vector<Point *> const &pnt_vec, std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_c) : - _pnts(pnt_vec), _initialized (true) + _pnts(pnt_vec), _pnt_ids( {{pnt_a, pnt_b, pnt_c}} ) { assert(!_pnts.empty()); - _pnt_ids[0] = pnt_a; - _pnt_ids[1] = pnt_b; - _pnt_ids[2] = pnt_c; } void Triangle::setTriangle (std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_c) diff --git a/GeoLib/Triangle.h b/GeoLib/Triangle.h index b137ad69059..50c1a22d9ac 100644 --- a/GeoLib/Triangle.h +++ b/GeoLib/Triangle.h @@ -78,7 +78,7 @@ protected: /** a vector of pointers to points */ const std::vector<Point*> &_pnts; /** position of pointers to the geometric points */ - std::size_t _pnt_ids[3]; + std::array<std::size_t, 3> _pnt_ids; }; void getPlaneCoefficients(Triangle const& tri, double c[3]); -- GitLab