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

Investigate ISpanFormattable #245

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Investigate ISpanFormattable #245

wants to merge 6 commits into from

Conversation

Corniel
Copy link
Collaborator

@Corniel Corniel commented May 31, 2022

It is far from trivial to support it, and I see no way to avoid double implementations. Specially supporting ICustomFormatter is potential challenging, but I gave Issue #244 a try.

The implementation for Guid was a bit of an inspiration.

@Corniel Corniel self-assigned this May 31, 2022
@Corniel Corniel marked this pull request as draft May 31, 2022 20:52
@Corniel
Copy link
Collaborator Author

Corniel commented Nov 18, 2022

@sonnemaf I gave it a second go. I think I;'ll will slowly add them.

@Sjaaky
Copy link
Collaborator

Sjaaky commented Nov 18, 2022

Calling StringFormatter.TryApplyCustomFormatter() and copying the formatted string into a span kinda defeats the purpose of Span's, doesn't it?

@Corniel
Copy link
Collaborator Author

Corniel commented Nov 20, 2022

Calling StringFormatter.TryApplyCustomFormatter() and copying the formatted string into a span kinda defeats the purpose of Span's, doesn't it?

You don't gain anything from using TryFormat() in those scenario's, that's true. But if the behavior should be the same for both ToString() and TryFormat().

The thing that I did not find yet, if it is recommended to implement it, if there is nothing to be gained. What could be the case for at least a part of the string based SVO's.

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.

None yet

2 participants