C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D2879R0 Proposal of Pythonesque std::print extensions LIVE LINK

From: Andrew Tomazos <andrewtomazos_at_[hidden]>
Date: Sun, 14 May 2023 23:13:00 +1000
On Sun, May 14, 2023 at 6:40 AM Ville Voutilainen via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> > std::put used
>

Where is std::put used in the existing standard library? I can't seem to
find it. (0 matches on codesearch.isocpp.org. not found on cppreference)

There's a std::puts inherited from C. The s stands for string and it does
something similar to what we're trying to do:

  https://en.cppreference.com/w/cpp/io/c/puts

even outputs an implicit newline.

So I was thinking we could propose that:

    std::put(1,2,3);

is equivalent to:

   std::println("{} {} {}", 1, 2, 3);

and forget about all the other forms.

Received on 2023-05-14 13:13:13