C++ Logo

std-proposals

Advanced search

Re: [std-proposals] New printf/scanf modifiers

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 1 Feb 2023 11:32:32 +0000
On Wed, 1 Feb 2023 at 08:24, Lee Shallis via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> I chose those modifiers because they already existed in tables like
> the one here (halfway down the page)
>
> https://cplusplus.com/reference/cstdio/scanf/
>
> I didn't know there was yet ANOTHER committee for the printf family of
>

I'm not sure what you mean by yet ANOTHER. There's a committee for C, and a
committee for C++.

printf comes from C.


> functions, I'll see if I can implement the change in my own version,
> annoying that they used U8,U16 & U32 though, I once saw a vid where U
> was used as a specifier for uuid_t and I rather liked that idea, I
> wanted a fast custom printf, not a bogged down one by checking for
> specifiers after the modifiers, so far I've gotten away with keeping
> the options & modifiers in a separate set of checks from the
> specifiers and the specifiers just ignoring unsupported options &
> modifiers, with U8, U16 & U32 I'll have to do differently in order to
> also support the U specifier. I suppose there's also the alternative
> of just ignoring the standards since I'm using a separate name
> (paws_printf,pawls_printf etc) but that also makes it less likely the
> library I'm making will be used simply because of the different
> standard, that and I'm used to using the standard modifiers, really
> don't want to change my habits there
>

Again: std::format.

Received on 2023-02-01 11:32:48