Tag: cpp23

Functional Composable Operations with Unix-Style Pipes in C++ – Ankur Satle – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

Functional Composable Operations with Unix-Style Pipes in C++ - Ankur Satle - CppCon 2022
https://github.com/CppCon/CppCon2022

Let's write C++ code like this shaking off all the verbosity and with 100% domain code and ~0% syntax! Do we really need to explicitly state whether a function is a continuation or a transform?

return get_env("KafkaConsumerConfigFile")
| get_file_contents
| make_client
| connect
| subscribe;
Unix commands seamlessly compose, piping into each other to form a clear train of operations in one line! Similarly in C++, we moved away from non-composable, multi-step processing of ranges using algorithm. We embraced the composable ranges using pipes. This reduced time & space complexity, improved performance, provided clarity & reduced cognitive load when working with ranges.

But, when NOT dealing with std::ranges, can one work with such easy composability? Why not pipe operations to work with application/business entities! YES, of course, I say! Let's pipe application logic operations & get declarative! HOW HARD COULD IT BE!

With just C++11, we achieve piping operations for any generic T & a Callable. We address Error handling, Resource management, Customizations and Variations like chaining functions taking more than 1 argument or invoking a member function operation instead of free function. Supporting C++20, we make sure our pipe implementation does NOT interfere with std::ranges operations.

Finally, we address the proposed C++23 Monadic interface functions (and_then, transform, or_else) of std::optional and present how we can implement the same without having to explicitly state the verbose and_then, transform, or_else to work with optional. We encounter a surprise on the way & correct overload resolution by employing a concept.

We also discuss critique & compromises of this approach.
---

Ankur Satle

Ankur is an avid (natural) language learner, but C++ is his mother tongue!
His mantra is: "Effective, Efficient & Elegant". He leverages the power of the small to build large-scale systems. As Smart Data Platform Architect at EXFO, he builds High-performance, Scalable, Telecom Products for 4G/5G Core. He loves working in constrained environments.
He was the Organizer & Host of CppIndiaCon, since inception. His dream came true when he hosted the AMA with Bjarne Stroustrup!
He is the Core Organizer at CppIndia, India's C++ User Group, the most active C++ user group.
He has presented at CppCon 2020 & CppCon 2021, CppIndiaCon 2021 & CppIndiaCon 2022
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , , , ,

C++23 – What’s In It For You? – Marc Gregoire – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

C++23 - What's In It For You? - Marc Gregoire - CppCon 2022
https://github.com/CppCon/CppCon2022

C++23, the next release of the C++ standard, is scheduled to be released in 2023. The update introduces new features to the core language and to the Standard Library. If you want to stay up to date with the latest features that are upcoming with this new release, then this session is for you.

The session includes core language topics such as consteval if statements, multidimensional subscript operators, decay copy, unreachable code, and more. New Standard Library features that will be shown include monadic operations for std::optional, std::flat_map, std::flat_set, a stacktrace library, changes to the ranges library, improvements to std::format, std::expected, and many more.

The session will include references to other sessions at CppCon, if applicable, for more deep-dive information on any particular topic.
---

Marc Gregoire

MARC GREGOIRE is a software project manager and software architect from Belgium. He graduated from the University of Leuven, Belgium, with a degree in "Burgerlijk ingenieur in de computer wetenschappen" (equivalent to a master of science in engineering in computer science). The year after, he received an advanced master’s degree in artificial intelligence, cum laude, at the same university. After his studies, Marc started working for a software consultancy company called Ordina Belgium. As a consultant, he worked for Siemens and Nokia Siemens Networks on critical 2G and 3G software running on Solaris for telecom operators. This required working in international teams stretching from South America and the United States to Europe, the Middle East, Africa, and Asia. Now, Marc is a software architect at Nikon Metrology (www.nikonmetrology.com), a division of Nikon and a leading provider of precision optical instruments, X-ray machines, and metrology solutions for X-ray, CT, and 3-D geometric inspection.

His main expertise is C/C++, specifically Microsoft VC++ and the MFC framework. He has experience in developing C++ programs running 24/7 on Windows and Linux platforms: for example, KNX/EIB home automation software. In addition to C/C++, Marc also likes C#.

Since April 2007, he has received the annual Microsoft MVP (Most Valuable Professional) award for his Visual C++ expertise.

Marc is the founder of the Belgian C++ Users Group (www.becpp.org), author of “Professional C++” 2nd, 3rd, 4th, and 5th Editions (Wiley/Wrox), co-author of “C++ Standard Library Quick Reference” 1st and 2nd editions (Apress), a technical editor for numerous books for several publishers, and a regular speaker at the CppCon C++ conference. He maintains a blog at www.nuonsoft.com/blog/ and is passionate about traveling and gastronomic restaurants.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

What’s New in C++23 – Sy Brand – CppCon 2022

https://cppcon.org/
---

What’s New in C++23 - Sy Brand - CppCon 2022
https://github.com/CppCon/CppCon2022

C++23 comes with a host of language and library features to simplify your code, make it more expressive, and give you more power to play with. With the help of my cats, I’ll walk you through the majority of upcoming features, showing you how they can work together and what benefits you’ll gain from upgrading when the time comes.
---

Sy Brand

Sy Brand is Microsoft’s C++ Developer Advocate. Their background is in compilers and debuggers for embedded accelerators, but they’re also interested in generic library design, metaprogramming, functional-style C++, undefined behaviour, and making our communities more welcoming and inclusive.
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #coding

Filed under: UncategorizedTagged with: , , , , , ,