Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3d_rec_framework compilation error #2495

Merged

Conversation

claudiofantacci
Copy link
Contributor

Eigen::aligned_allocator was set unproperly.
A const declaration was missing in template type.

See here for fruther documentation bout the error.

I also changed explicit iterator type declaration with auto, which is much more compact and less error prone (avoids redundant repetition of type names).

@claudiofantacci claudiofantacci mentioned this pull request Sep 29, 2018
16 tasks
Copy link
Member

@SergioRAgostinho SergioRAgostinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into it so quickly.

@@ -22,8 +22,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
typedef std::pair<std::string, int> mv_pair;
mv_pair pair_model_view = std::make_pair (model.id_, view_id);

std::map<mv_pair, Eigen::Matrix4f, std::less<mv_pair>, Eigen::aligned_allocator<std::pair<mv_pair, Eigen::Matrix4f> > >::iterator it =
poses_cache_.find (pair_model_view);
auto it = poses_cache_.find (pair_model_view);
Copy link
Member

@SergioRAgostinho SergioRAgostinho Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we can only adopt this once we move to C++14. Right now this is not supported.

See https://en.cppreference.com/w/cpp/language/auto .

Copy link
Contributor Author

@claudiofantacci claudiofantacci Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto is supported since C++11, not C++14.
That's why I used it. Anyway, if you want me to revert this to its previous type declaration I'll do it right away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PCL is currently on C++03, not C++11. We're skipping C++11 entirely and going straight for C++14.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PCL is currently on C++03, not C++11. We're skipping C++11 entirely and going straight for C++14.

Ok, now it's also clear to me why the topic about C++14. There's a skip of C++11 that I missed altogether 😄

Roger. Reverting the iterator right now.

@@ -463,8 +463,7 @@ template<template<class > class Distance, typename PointInT, typename FeatureT>
typedef std::pair<std::string, int> mv_pair;
mv_pair pair_model_view = std::make_pair (model.id_, view_id);

std::map<mv_pair, Eigen::Matrix4f, std::less<mv_pair>, Eigen::aligned_allocator<std::pair<mv_pair, Eigen::Matrix4f> > >::iterator it =
poses_cache_.find (pair_model_view);
auto it = poses_cache_.find (pair_model_view);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Eigen::aligned_allocator was set unproperly. A const declaration was missing in template type.

See http://eigen.tuxfamily.org/dox/group__TopicStlContainers.html.
@claudiofantacci
Copy link
Contributor Author

Ok, done 👍

@SergioRAgostinho SergioRAgostinho merged commit d7c0d98 into PointCloudLibrary:master Sep 29, 2018
@SergioRAgostinho
Copy link
Member

Thanks.

@claudiofantacci claudiofantacci deleted the fix/eigengenerator branch November 12, 2018 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants