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

Made repr and str return C++ strings #43

Merged
merged 9 commits into from
Dec 21, 2024
Merged

Made repr and str return C++ strings #43

merged 9 commits into from
Dec 21, 2024

Conversation

tfpf
Copy link
Owner

@tfpf tfpf commented Dec 21, 2024

No description provided.

tfpf added 5 commits December 21, 2024 22:07
This reverts commit 8edcc92 because it resulted in the same thing being printed for both `repr` and `str`. I couldn't identify the cause.
@tfpf
Copy link
Owner Author

tfpf commented Dec 21, 2024

This is not a good approach, because if somebody writes

char const* a_str = str(a);
char const* b_str = str(b);

then both a_str and b_str are now pointing to the same buffer.

@tfpf tfpf changed the title Made repr and str return C strings Made repr and str return C++ strings Dec 21, 2024
@tfpf tfpf merged commit a031e27 into main Dec 21, 2024
7 checks passed
@tfpf tfpf deleted the repr-str-improvements branch December 21, 2024 20:32
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.

1 participant