-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support for constraint environment #254
Comments
Hi, Thank you for the nice feedback.
No, I don't have any plans specifically targeting constrained environments.
I'm not sure what you mean by that. The errors are reported as exceptions, but you can provide your own error handling mechanism via
I think turning off classes with dynamic memory allocation completely via conditional compilation will be too messy, but writing to a fixed, possibly stack-allocated, array is already supported: char buffer[100];
fmt::ArrayWriter w(buffer);
w.write("The answer is {}", 42); This could be wrapped in a function for even easier use: char buffer[100];
format_array(buffer, "The answer is {}", 42);
Again, I think it would be too messy to turn off completely, but it doesn't add any overhead if you don't use it.
IOStreams are already optional and only used when formatting types that provide an overloaded ostream void format(Formatter &f, const char *&format_str, const MyType &value) {
// parse format_str and format value
} I'm also open to pull requests that improve support for such environments provided that they don't obscure the code by introducing a lot of conditional compilation or similar. If you have any specific ideas, I recommend discussing them here or in separate issues before preparing a full PR (although a small prototype to demonstrate the idea might be useful). |
I'm closing this for now, but feel free to reopen or open another issue to discuss any specific suggestion in more details. |
Hi,
cppformat is a breath of fresh air, especially when you use it for embedded device where stupid errors could be costly.
Do you plan to make a subset of cppformat available for more constraint environment?
Specifically:
Would you accept pull requests in this direction?
The text was updated successfully, but these errors were encountered: