Skip to content

Commit

Permalink
Fix compile error of the GCC with IndexLandmark braces initializer.
Browse files Browse the repository at this point in the history
GCC compiler raise an error when it try to compile braces initializer of IndexLandmark
struct. This commit add explicit definition of intializers for this struct.
  • Loading branch information
Alpus committed Feb 18, 2019
1 parent fa1e514 commit b4b9960
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions include/eos/core/Landmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ struct Landmark
template <class LandmarkType>
struct IndexedLandmark : Landmark<LandmarkType>
{
IndexedLandmark(const Landmark<LandmarkType>& landmark, int model_index)
: Landmark<LandmarkType>(landmark), model_index(model_index) {}
IndexedLandmark(const std::string& name, const LandmarkType& coordinates, int model_index)
: Landmark<LandmarkType>{name, coordinates}, model_index(model_index) {}

int model_index; ///< Index of landmark in mesh
};

Expand Down
3 changes: 1 addition & 2 deletions include/eos/core/LandmarkMapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ class LandmarkMapper
vertex_idx = std::stoi(converted_name.value());
}

IndexedLandmark<LandmarkType> indexed_landmark{landmark.name, landmark.coordinates, vertex_idx};
indexed_landmarks.emplace_back(std::move(indexed_landmark));
indexed_landmarks.emplace_back(landmark, vertex_idx);
}
return indexed_landmarks;
}
Expand Down
6 changes: 1 addition & 5 deletions include/eos/fitting/ceres_nonlinear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,7 @@ class ModelFitter
auto contour_landmarks = core::IndexedLandmarkCollection<LandmarkType>();
for (int i = 0; i < image_points_contour.size(); ++i)
{
core::IndexedLandmark<LandmarkType> landmark;
landmark.coordinates = image_points_contour[i];
landmark.model_index = vertex_indices_contour[i];

contour_landmarks.emplace_back(std::move(landmark));
contour_landmarks.emplace_back("", image_points_contour[i], vertex_indices_contour[i]);
}

return contour_landmarks;
Expand Down

0 comments on commit b4b9960

Please sign in to comment.