-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Support Incomplete Types, somehow #3180
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
Comments
I think the completeness of a formattable type is a reasonable requirement and with modules most of the rationale for supporting incomplete types goes away. That said a PR to relax this requirement would be welcome provided that it's not too intrusive. |
This may still be valuable for implementing formatters for types from C libraries. Many C libraries only provide struct declarations in their public header files to hide implementation details. They make all public APIs work with pointers so that a definition is not needed. Modules can't be a solution here since C has no idea about modules. |
Thanks to @LocalSpook this is supported now. |
Hi,
I'd like to come upwith a requirement to support the combination of fmt with incomplete types, that have been specialized in formatter.
To clarify the use case, an example might help
Rationale
IncompleteType
injects evil headers (i.e. WinApi or others).IncompleteType
is from a 3rdparty libIncompleteType
should be usable in headers in combination with fmt, without the need to have full type knowledge, thus usage is not in implementation files only.Limitations
fmt::appender
is enough and other overloads may be added, if requirements arise.Currently
Workaround
godbolt: simulation
The text was updated successfully, but these errors were encountered: