CoverBig

And the Five Winners for the “C++20 STL Cookbook” are

Today, I want to present the five winners for the pdf of the book “C++20 STL Cookbook” by Bill Weinman.

 CoverBig

To get the book, you had to answer the following question by Bill Weinmann: “What are the major advantages of the C++20 format library over printf and iostream?“. Here are the best five answers. Two answers were almost literally identical, but I had to decide for one of them.

Manali

1. Format () is clean, precise , flexible variadic template function in terms of its usage and code readability.
2. With iostream we use for example: std::cout, std::cin . This use of scope resolution (namespaces) and insertion / extraction operations is overcome with help of format function , improving performance and efficiency.
3. format() function provides type safety ,
Formatting options, supporting classes and objects , positional arguments.

Uzoochogu

 format

Gabriel

Disadvantages:
– not Type safe
– it is not extensible because it only supports a specific number of types.

Advantages:
– Type safe
– now extensible ( yay :D )
– readable
– easier to localize/translate

Roberto

printf

 

 

 

 

iostreams

 

 

 

 

format1

 

 

 

 

 

 

format2

 

 

 

 

 

 

 

 

 

 

Demo

Rainer D 6 P2 500x500

 

Rainer D 6 P2 500x500Modernes C++ Mentoring

  • "Fundamentals for C++ Professionals" (open)
  • "Design Patterns and Architectural Patterns with C++" (open)
  • "C++20: Get the Details" (open)
  • "Concurrency with Modern C++" (open)
  • "Generic Programming (Templates) with C++": October 2024
  • "Embedded Programming with Modern C++": October 2024
  • "Clean Code: Best Practices for Modern C++": March 2025
  • Do you want to stay informed: Subscribe.

     

    Hyper

    my answer is that the C++20 format library provides a rich set of formatting options that exceeds even that of prinf. It provides a positional arguments and is extensible to support more values and classes. It is like it was isnpired by Python str.format method.
    the C++20 format() function is a variadic template function which provides type safety, along with the performance and efficiency advantages of iostream. the format library also provides vformat(), a type-erased interface that prevents generating multiple instances of complex template function for each combination of arguments.
    the make_formate_arge() function creates a type-erased parameter stack to pass to vformat(), which does the heavy lifting of formatting the string. This is how the format() library operates so efficiently.

     

     

     

     

     

    Thanks a lot to my Patreon Supporters: Matt Braun, Roman Postanciuc, Tobias Zindl, G Prvulovic, Reinhold Dröge, Abernitzke, Frank Grimm, Sakib, Broeserl, António Pina, Sergey Agafyin, Андрей Бурмистров, Jake, GS, Lawton Shoemake, Jozo Leko, John Breland, Venkat Nandam, Jose Francisco, Douglas Tinkham, Kuchlong Kuchlong, Robert Blanch, Truels Wissneth, Mario Luoni, Friedrich Huber, lennonli, Pramod Tikare Muralidhara, Peter Ware, Daniel Hufschläger, Alessandro Pezzato, Bob Perry, Satish Vangipuram, Andi Ireland, Richard Ohnemus, Michael Dunsky, Leo Goodstadt, John Wiederhirn, Yacob Cohen-Arazi, Florian Tischler, Robin Furness, Michael Young, Holger Detering, Bernd Mühlhaus, Stephen Kelley, Kyle Dean, Tusar Palauri, Juan Dent, George Liao, Daniel Ceperley, Jon T Hess, Stephen Totten, Wolfgang Fütterer, Matthias Grün, Phillip Diekmann, Ben Atakora, Ann Shatoff, Rob North, Bhavith C Achar, Marco Parri Empoli, Philipp Lenk, Charles-Jianye Chen, Keith Jeffery, Matt Godbolt, and Honey Sukesan.

    Thanks, in particular, to Jon Hess, Lakshman, Christian Wittenhorst, Sherhy Pyton, Dendi Suhubdy, Sudhakar Belagurusamy, Richard Sargeant, Rusty Fleming, John Nebel, Mipko, Alicja Kaminska, Slavko Radman, and David Poole.

    My special thanks to Embarcadero
    My special thanks to PVS-Studio
    My special thanks to Tipi.build 
    My special thanks to Take Up Code
    My special thanks to SHAVEDYAKS

    Modernes C++ GmbH

    Modernes C++ Mentoring (English)

    Do you want to stay informed about my mentoring programs? Subscribe Here

    Rainer Grimm
    Yalovastraße 20
    72108 Rottenburg

    Mobil: +49 176 5506 5086
    Mail: schulung@ModernesCpp.de
    Mentoring: www.ModernesCpp.org

    Modernes C++ Mentoring,

     

     

    0 replies

    Leave a Reply

    Want to join the discussion?
    Feel free to contribute!

    Leave a Reply

    Your email address will not be published. Required fields are marked *