TemplateMetaprogrammingMarius

And the Five Winners for “Template Metaprogramming with C++” are

Today, I want to present the five winners for coupons for the book “Template Metaprogramming with C++” by Marius Bancila.

 CoverBig

 

To get the book, you had to answer the following two questions by Marius Bancila:

  1. What do you find the most difficult about templates and why?
  2. What would you like to learn more about templates?

I got about 15 answers. Here are the best five. I refer in the answers to the question 1 and 2 above.

Berke

  1. I think SFINAE is the hardest. The name is a self explanation why it is hard but let me expand it. The error messages are hard to read. SFINAE`s are hard to read. It takes some time to read and understand the code.
  2.  I would like to learn more about constraints, concepts, requires expressions and fold expressions. I think these new features are very important. It can clear the most of the SFINAE code and increase readability and usability.

Michal

  1. Templates, similarly to library coding, are difficult as they have to be universal and most often independent in means they should not vary based on the parent’s state. One may need to support as many types as possible, and once shuffling text-based, number-based with their variety of forms and separate error handling and validation these may become overburdened. This burden can be additionaly weighed down
    Finally, programmers need to think about his program in high abstraction level, merged with language syntax and construction specifics. This brings a high complexity on reading, can form difficult DX (developer’s experience) by introducing cognitive load.
  2. I am fresh in the world of Cpp, especially the modern one’s so learning templates is a new road for me. They seem to be constructed similarly to C#’s generics, but I can see differences in their construction. What I think it is essential to learn from the very beginning for everyone are patterns and principles with strong introduction to abstract thinking, to develop lightweight yet functional templating abstractions, that may be universal across modern languages on the logical side.

Rahul

  1. If I come across an unfamiliar template code usage for the first time, I need to do a bit of reverse engineering to understand the working of templates involved behind the usage. In other words, translating the metaprogramming to C++ code. This is done by the compiler itself but hidden from the developers.
  2. I aim to become a quality template meta programmer whc would use the appropriate template in appropriate situations. Sometimes, developers force their way to templates which makes code difficult to understand and maintain. Hence, I would start with using concepts for typename and also before unrestricted auto placeholder. Since this field is ever growing, I have to keep on my toes and learn about new features being introduced. Especially, how templates would help in making the code faster.

José

  1. Trivial and straightforward uses are clear to understand, even to someone unfamiliar to the language. However, conditionals, SFINAE, how to declare and use dependent types, alias template etc, are a language within C++ that not only takes time to learn and understand nuisances but something one must always keep practicing, otherwise, it is somewhat easy to forget the details.
  2. I would like to learn how to deliver the features while reducing dependencies on heavy template constructs. How to simplify template calls, specially when picking up legacy codebases for modernization. How to spread newer, and simpler best practices related with templates across lots of teams in big organizations – How to hide anything more “technically-deep” so programmers unfamiliar to complex template uses can still take advantage of them without feeling discouraged by C++.

Guilherme Recchi

  1. The most difficult thing for me is to figure out how to support different kinds of template parameters being passed to your functions: depending on cv qualifiers, pointers/refs, etc. Sometimes it’s difficult to reason about and usually requires some Googling in order to properly decay them to their underlying types.
  2. Tbh, I would like to learn as much as possible as I never feel confident when I need to work with templates on my own.

 

Congratulations: Packt will contact you and send you the coupons.

 

 

 

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.

     

     

     

    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,and Matt Godbolt.

    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 *