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

add operator<< for enum #79

Merged

Conversation

v4hn
Copy link
Contributor

@v4hn v4hn commented Apr 6, 2018

Just some micro-additions && simplifications

v4hn added 2 commits April 6, 2018 18:30
shapes::Shape::Shape()
namespace shapes {

const std::string Sphere::STRING_NAME = "sphere";
Copy link
Member

Choose a reason for hiding this comment

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

How about using a static const std::map<ShapeType, std::string> ?

C++11 allows for this:

std::map <int, std::string> x { 
  { 42, "foo" }, 
  { 3, "bar" } 
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we can do that. But the static STRING_NAME variables are - ridiculous enough - public API, although not even virtual. So if you like to see this changed please create a melodic branch and file a request there.
I wanted to retain API here to merge into kinetic.

@rhaschke rhaschke merged commit 43dac19 into moveit:kinetic-devel Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants