-
Notifications
You must be signed in to change notification settings - Fork 104
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
sprintf / sscanf / std::regex frozen version #35
Comments
Another minor issue with
We are implementing a completely different class now, following a Stackoverflow answer by Nicol Bolas: https://stackoverflow.com/questions/41286898/using-stdstring-view-with-api-what-expects-null-terminated-string/41288372#41288372 The idea is that And, After we have that, I can't see that there's any use-case for I think I think if I had to do this, I would attempt to basically convert a frozen string to a |
Recently, I was writing a simple Syslog viewer. Basicaly, it's a simple UDP server receiving syslog packets, which are parsed with a regex, formatted using constant format string and then displayed to the console. To avoid parsing the constant format string on each packet, I wrote a custom constexpr formatter taking constexpr formatting string and building at compile time a list of 'formatting action' that are executed at runtime for each packet. For now, I didn't check if it's more efficient than parsing the format string on each packet.
But it makes me wonder that it could be worthy to have frozen implementation of :
sprintf
/snprintf
/sscanf
: for frozen format string parsingstd::regex
: for frozen regex string parsingMaybe we could write a frozen implementation and see how it compares to the runtime version.
What do you think ?
The text was updated successfully, but these errors were encountered: