Skip to content

Conversation

firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

Supersedes #377.

@firewave firewave changed the title provide safe API for TokenList only provide "safe" API for TokenList out-of-the-box Aug 15, 2025
@firewave firewave changed the title only provide "safe" API for TokenList out-of-the-box make it possible to hide "unsafe" TokenList API Aug 15, 2025
@firewave firewave force-pushed the unsafe-api branch 4 times, most recently from 333f2dd to 8313678 Compare August 15, 2025 15:13
@firewave firewave changed the title make it possible to hide "unsafe" TokenList API added TokenList constructor with modern buffer wrappers and made it possible to hide "unsafe" ones Aug 15, 2025
@firewave firewave force-pushed the unsafe-api branch 7 times, most recently from 4229d04 to ea3a026 Compare August 15, 2025 21:56
@firewave
Copy link
Collaborator Author

This came up in a discussion in danmar/cppcheck#6379.

@firewave
Copy link
Collaborator Author

The added test is only to make sure it compiles. I will leverage #261 so it will actually be used for the input.

@firewave firewave force-pushed the unsafe-api branch 2 times, most recently from ddc8da8 to ae24823 Compare August 19, 2025 07:33
@firewave
Copy link
Collaborator Author

firewave commented Aug 19, 2025

Not sure about the SIMPLECPP_UNSAFE_API name. The new constructors are just use modern wrappers and the user can still misuse them like the existing ones. Maybe SIMPLECPP_ENABLE_PTR_CTORS?

@firewave
Copy link
Collaborator Author

We could also add an overload with std::vector<char> so there's also a safer alternative for older standards.

@firewave firewave marked this pull request as ready for review August 21, 2025 12:46
@firewave
Copy link
Collaborator Author

Not sure about the SIMPLECPP_UNSAFE_API name. The new constructors are just use modern wrappers and the user can still misuse them like the existing ones. Maybe SIMPLECPP_ENABLE_PTR_CTORS?

Or SIMPLECPP_LEGACY_API?

@firewave
Copy link
Collaborator Author

I renamed the define to SIMPLECPP_TOKENLIST_ALLOW_PTR.

@firewave firewave changed the title added TokenList constructor with modern buffer wrappers and made it possible to hide "unsafe" ones added TokenList constructors with modern buffer wrappers and made it possible to hide "unsafe" ones Aug 29, 2025
@firewave firewave changed the title added TokenList constructors with modern buffer wrappers and made it possible to hide "unsafe" ones added TokenList constructors with modern buffer wrappers and hide "unsafe" ones - if available Aug 29, 2025
@firewave firewave merged commit 4056cd5 into danmar:master Aug 29, 2025
13 checks passed
@firewave firewave deleted the unsafe-api branch August 29, 2025 11:59
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