Skip to content

fix: Make impossible to accidently copy JsonExporter singleton #975

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

tony-p
Copy link
Contributor

@tony-p tony-p commented May 16, 2025

Make it impossible to copy the JsonExporter accidentally. The following snippet currently compiles and runs fine, however will not actually add the converters as it is working with a copy, so not produce the desired output.

auto json_exporter = JsonExporter::get();
json_exporter.addConverter<MyType>();

With this change it will throw a compiler error.

@facontidavide facontidavide merged commit 7ffab7e into BehaviorTree:master May 29, 2025
8 of 9 checks passed
@facontidavide
Copy link
Collaborator

thanks!

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.

2 participants