You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there's no such thing in the gencpp code, so we got tripped up when we had a message with established Python usage that had class as a field name, and then got used in C++ and wouldn't compile.
For now we've simply renamed our field to class_, but it would be great to see this transformation happen in gencpp itself, as it does in genpy.
The text was updated successfully, but these errors were encountered:
This would be an interesting feature. It should be made sure that e.g. an existing field class_ doesn't collide with a new field class which gets the suffix automatically to avoid the collision though.
Please consider to provide a pull request for this since the maintainer will likely not have time to implement the feature.
The Python generation code contains logic to append with underscore any fields that match a Python keyword:
https://github.com/ros/genpy/blob/45ecd5415fc4711a3afbdf3c2923b59fa742b436/src/genpy/generator.py#L224-L225
However, there's no such thing in the gencpp code, so we got tripped up when we had a message with established Python usage that had
class
as a field name, and then got used in C++ and wouldn't compile.For now we've simply renamed our field to
class_
, but it would be great to see this transformation happen in gencpp itself, as it does in genpy.The text was updated successfully, but these errors were encountered: