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

safe_printf feature request #3

Open
rockeet opened this issue Apr 25, 2014 · 1 comment
Open

safe_printf feature request #3

rockeet opened this issue Apr 25, 2014 · 1 comment

Comments

@rockeet
Copy link

rockeet commented Apr 25, 2014

I read and tested your safe_printf, it was amazed me...
So, what I need is not only "safe", but also "convenient", for example, I want (maybe many people want too) such a features:
When I write safe_printf<"%d %X %s">(10LL, 11L, std::string("abc")), my intention is really safe_printf<"%lld %lX %s">(10LL, 11L, std::string("abc").c_str()). In C++11, it is possible to convert the original format string with the intended one, so, we needn't to specify the redundant width format specifier and s.c_str() ect...

@sabel83
Copy link
Owner

sabel83 commented Apr 27, 2014

With safe_printf in its current form you can easily replace it with the original printf if you want to compile quickly. Extra type conversions based on the format string would not make it possible.

Some new placeholder notation could be added to the format string to express that printf should detect the type of the argument and use that.

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

No branches or pull requests

2 participants