Skip to content
New issue

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

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

Already on GitHub? # to your account

Existing GSG violations: non-trivially destructible types at a static storage duration? #552

Open
EricCousineau-TRI opened this issue Apr 29, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@EricCousineau-TRI
Copy link
Collaborator

Environment

N/A

Description

https://github.com/osrf/sdformat/blob/689ee8410a97917e2087ffd5045861d63258ebd4/include/sdf/Types.hh#L64-L72

Steps to reproduce

N/A

Output

N/A

@EricCousineau-TRI EricCousineau-TRI added the bug Something isn't working label Apr 29, 2021
@EricCousineau-TRI
Copy link
Collaborator Author

EricCousineau-TRI commented Apr 29, 2021

May not be easiest to fix given that some of these are part of public API.

Some options:

  • Using things ilke std::string is important, then make it a function which returns a copy (or even a const reference to) something that is wrap in something like Drake's never_destroyed<> class: https://drake.mit.edu/styleguide/cppguide.html#Static_and_Global_Variables (drake::never_destroyed)
    • Deprecate old spelling.
  • Change the type, and just change immediate downstream usages. (Ew).

FYI @azeey @aaronchongth - we came across this in #537

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant