Tag: moderncpp

Using std::chrono Calendar Dates for Finance in Cpp – Daniel Hanson – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

Using std::chrono Calendar Dates for Finance in C++ - Daniel Hanson - CppCon 2022
https://github.com/CppCon/CppCon2022

Dates and date calculations might not sound exciting, but they are vitally important in financial software development, particularly in areas such as fixed income analytics, mortgage backed-securities (MBS), and interest rate derivatives. A prime example is in applying the correct day-count convention to interest rate derivative calculations, as failure to do so can result in potentially significant losses for a trading desk.

Up until C++20, C++ financial developers had to rely on an external library for dates, or write their own customized code. This has now fortunately changed with the addition of the `std::chrono` calendar date classes.

Some of the operations are not exactly trivial, however, as one needs to identify and use the appropriate tools in the library. For example, naively applying the addition assignment operator to add a period of two months to December 30 can result in an invalid date of February 30. Another possible complication is if a date generated in a payment schedule falls on a non-business day at the end of the month. Remedies in these cases are provided by using a std::chrono object that represents the last day of the month object rather than a standard date.

Handling edge cases such as these is standard fare in working with financial date calculations. Methods available in `std::chrono` to adjust for them will be presented, and then parlayed into designing C++ code to properly generate a schedule of cash flows, perform business day adjustments for weekends and end of the month, construct and interpolate a term structure of interest rates, and calculate the present value of fixed income securities such as bonds and interest rate swaps.
---

Daniel Hanson

Daniel Hanson spent 24 years in quantitative development in finance, primarily with C++ implementation of option pricing and portfolio risk models, and related library development. He subsequently held a full-time lecturer position through 2022 in the Department of Applied Mathematics at the University of Washington, teaching quantitative development courses in the Computational Finance & Risk Management (CFRM) graduate and undergraduate programs. This included intermediate and advanced classes in computational C++, and mentoring students in Google Summer of Code projects involving implementation of mathematical models in C++ and R.
---

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: , , , ,

How C++23 Changes the Way We Write Code – Timur Doumler – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

https://cppcon.org/
---

How C++23 Changes the Way We Write Code - Timur Doumler - CppCon 2022
https://github.com/CppCon/CppCon2022

C++20 was a huge release: coroutines, concepts, ranges, and modules profoundly changed the way we write code and think about C++. In comparison, C++23 is a lot smaller in scope: its primary mission is to complete C++20, to fill holes, and to fix issues. Nevertheless, some great new features made the cut this time around, both in the standard library and in the core language. This is even more remarkable considering that the entire feature design phase of C++23 took place during the COVID-19 pandemic, challenging the ISO C++ committee to completely reinvent how we work together.

This is not a firehose talk about C++23 that tries to cram as many additions and improvements as possible into one hour. Instead, we deliberately focus on just a handful of new features that are going to noticeably change and improve the experience of the everyday C++ programmer. We will talk about how `std::expected` improves error handling, the huge impact that `std::mdspan` will have on scientific computing, how deducing `this` greatly simplifies longstanding C++ idioms such as CRTP, and how `std::print` will forever change how we write "Hello, World".
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
---

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

#cppcon #programming #coding

Filed under: UncategorizedTagged with: , , , , ,

A Tour of C++ Recognised User Type Categories – Nina Ranns – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

A Tour of Cpp Recognised User Type Categories - Nina Ranns - CppCon 2022
https://github.com/CppCon/CppCon2022

What's trivial about trivial types ? What can we say about the layout of the standard layout types? What is the lifetime of an implicit-lifetime type ? How are all these types different from aggregate types and literal types, why do we need them, and when do we care ? Modern C++ offers several new classification of types to help users optimize their code. Getting familiar with them will allow you to take advantage of the special provisions the language gives you and write better code. Knowing the boundaries of those specific situations will prevent you from falling into the UB abyss. Join me as we take a tour of language recognised user types, noting their advantages and pitfalls.
---

Nina Ranns

Nina Ranns has been a member of the C++ standard committee since 2013, focusing mostly on the core part of the language, and committee secretary since 2018. Throughout her career she has worked for Siemens, Motorola, Datasift, and Symantec on everything from parts of the UMTS network to cloud based antivirus products. Currently an independent consultant with contracts for EDG, QT, and most recently Bloomberg, where she is eagerly extending her library knowledge and helping create new polymorphic-allocator friendly library types.
---

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: , , , ,

Breaking Dependencies – The Visitor Design Pattern in Cpp – Klaus Iglberger – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

Breaking Dependencies - The Visitor Design Pattern in C++ - Klaus Iglberger - CppCon 2022
https://github.com/CppCon/CppCon2022

The extensibility of code with new functionality is essential for long-term maintenance of a code base. However, when using dynamic polymorphism there is always a choice: either easily add types, or easily add operations. For instance, by means of inheritance hierarchies it's easy to add new types, but it's difficult to add new operations.
But there is a common workaround to overcome this weakness: the Visitor design pattern.

In this talk, I’ll explain the design properties of Visitor, including its benefits and shortcomings. I’ll also talk about different kinds of visitors (cyclic and acyclic) and show when to reach for a Visitor and when to avoid it. Additionally, I’ll demonstrate the different implementation strategies (classic and modern) and address their individual benefits and problems.
---

Klaus Iglberger

Klaus Iglberger is a freelance C++ trainer and consultant. He has finished his PhD in Computer Science in 2010 and since then is focused on large-scale C++ software design. He shares his expertise in popular advanced C++ courses around the world (mainly in Germany, but also in the rest of the EU and the US). Additionally, he is the initiator and lead designer of the Blaze C++ math library (https://bitbucket.org/blaze-lib/blaze/), one of the organizers of the Munich C++ user group (https://www.meetup.com/MUCplusplus/), and the organizer of the Back-to-Basics track at CppCon.
---

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: , , , ,

Quantifying Dinosaur Pee – Expressing Probabilities as Floating-Point Values in C++ – John Lakos – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

Quantifying Dinosaur Pee - Expressing Probabilities as Floating-Point Values in Cpp - John Lakos - CppCon 2022
https://github.com/CppCon/CppCon2022

Like most cppcon.digital-medium.co.uk/tag/programming/">programming languages, C++ can be used effectively for numerical calculations. Some expressions, especially those involving very low or very high probabilities, can be problematic. In particular, floating-point expressions — even those of type long double — can present representational barriers when crafted unartfully. In this lighthearted yet mathematically and computationally informative talk, we’ll begin by briefly reprising the birthday problem and, to elucidate a subtle potential numerical pitfall, together attempt to design a corresponding function that, given a non-negative integer (number of persons), returns a probability (i.e., between 0.0 and 1.0, inclusive).

We’ll then turn to the main topic of this talk, which is to answer — once and for all — four of humankind’s most pressing questions pertaining to the proportion of water on this planet that, at one time, might have been inside a dinosaur. The correct answer to each of these questions will turn out to be one of five possibilities: (a) 0, (b) almost 0, (c) in the middle, (d) almost 1, and (e) 1. The audience will be asked to predict these answers up front. We’ll then proceed to verify these answers using a variety of scientific assumptions and mathematical approaches that all lead to the same conclusions. Along the way, we’ll identify the same subtle, numerical pitfall with floating-point representations that we encountered with the birthday problem and, perhaps, even crispen our understanding of probability versus expected value.
---

John Lakos

John Lakos, author of Large-Scale C++ Software Design (Pearson, 1997), serves at Bloomberg LP in New York City as a senior architect and mentor for C++ Software Development world-wide. He is also an active voting member of the C++ Standards Committee’s Evolution Working Group. Previously, Dr. Lakos directed the design and development of infrastructure libraries for proprietary analytical financial applications at Bear Stearns. For 12 years prior, Dr. Lakos developed large frameworks and advanced ICCAD applications at Mentor Graphics, for which he holds multiple software patents. His academic credentials include a Ph.D. in Computer Science ('97) and an Sc.D. in Electrical Engineering ('89) from Columbia University. Dr. Lakos received his undergraduate degrees from MIT in Mathematics ('82) and Computer Science ('81). He is the author of the multi-volume book Large-Scale C++, the first volume of which, Volume I: Process and Architecture (Pearson, 2020), is currently available, and subsequent volumes are forthcoming. He is the coauthor of Embracing Modern C++ Safely (Pearson, 2021) along with Vittorio Romeo, Rostislav Khlebnikov, and Alisdair Meredith.
---

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: , , , ,

Cute C++ Tricks, Part 2.5 of N – Code You Should Learn From & Never Write – Daisy Hollman – CppCon22

  • Lobby
  • Tag Archives: moderncpp

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

Cute C++ Tricks, Part 2.5 of N - More Code You Should Learn From and Never Write - Daisy Hollman - CppCon 2022
https://github.com/CppCon/CppCon2022

During the COVID-19 global pandemic, as we all searched for ways to stay connected to the C++ community, these 25-line or less C++ snippets of counterintuitive C++ code called the "Cute C++ trick of the day" started to appear on Twitter. The amount of attention these tricks got was surprising, and as more were posted, it became clear that these counterintuitive snippets of C++ code offer pithy and memorable ways to teach people some intermediate or advanced aspects of C++ (that often come up in real code!).

This talk builds on part 1 (of N), presented last year at CppCon 2021. In this presentation, I will dissect a few more of the most popular "Cute C++ tricks" to a level of detail not possible on social media platforms like Twitter. I'll talk about how and why these tricks work the way they do, talk about the dark corners of C++ they touch upon, and talk about what you should actually do if you need to produce the same effect in production code. While not targeted at beginners, these tricks span the gauntlet from features that most intermediate programmers are aware of (but never thought to use in a particular way) to dark corners of the language that many of my C++ committee colleagues were surprised to learn about. Throughout it all runs a common thread: learning how to exploit your own curiosity to expand your toolbox, gain a better grasp of the fundamentals of C++, and ultimately, become a better programmer.
---

Daisy Hollman

Dr. Daisy S. Hollman began working with the C++ standards committee in 2016, where she has made contributions to a wide range of library and language features, including proposals related to executors, atomics, generic cppcon.digital-medium.co.uk/tag/programming/">programming, futures, and multidimensional arrays. Since receiving her Ph.D. in Quantum Chemistry in 2013, her research has focussed primarily on parallel and concurrent cppcon.digital-medium.co.uk/tag/programming/">programming models, though a broader focus on general accessibility of complex abstractions has become her focus in more recent years. She currently works on C++ language and library design at Google, where she continues to focus on providing broad accessibility of cppcon.digital-medium.co.uk/tag/programming/">programming models and abstractions, with a particular focus on design for diversity and inclusivity.
---

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: , , , ,

Back to Basics: Declarations in C++ – Ben Saks – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

Back to Basics: Declarations in Cpp - Ben Saks - CppCon 2022
https://github.com/CppCon/CppCon2022

While most C++ programmers have a general understanding of how to read and write declarations, some aspects of declarations can confuse even experienced C++ programmers. For example, why does

constexpr int *p1 = addr1;

require an initializer, but

const int *p2;

does not?

As another example, when you write a declaration such as T &&t_ref, how can you tell whether t_ref is an rvalue reference or a forwarding reference?

In this session, we explain what you need to know to answer these and many other questions about declarations. We begin with a detailed look at the structure of declarations. Along the way, we discuss the differences between type and non-type specifiers and how the compiler interprets them. We then show how a declaration’s context affects its meaning, such as
• how the ambiguous nature of dependent names in templates creates the need for the typename keyword to assist the compiler, and
• how a type deduction context alters the meaning of a reference declaration.

You’ll leave this session with a clearer understanding of how the compiler interprets declarations. Armed with this understanding, you’ll find it easier to write declarations that mean what you intend and to resolve compile-time error messages involving declarations.
---

Ben Saks

Ben Saks is the chief engineer of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Ben represents Saks & Associates on the ISO C++ Standards committee as well as two of the committee’s study groups: SG14 (low-latency) and SG20 (education). He has spoken at industry conferences, including the C++ and System Software Summit, the Embedded Systems Conference, NDC Techtown, and CppCon, where he’s also chair of the Embedded Track and a member of the program committee. Ben previously worked as a software engineer for Vorne Industries, where he used C++ and JavaScript to develop embedded systems that help improve manufacturing productivity in factories all over the world. He’s also a contributing author on multiple Vorne patents.
---

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: , , , ,

C++20’s [[likely]] Attribute – Optimizations, Pessimizations, and [[unlikely]] Consequences – by Amir Kirsh & Tomer Vromen – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

C++20’s [[likely]] Attribute - Optimizations, Pessimizations, and [[unlikely]] Consequences - CppCon
https://github.com/CppCon/CppCon2022

C++20 added the [[likely]] and [[unlikely]] attributes, which formalize existing compiler builtins. As users of the latest standards, we all want to use them in our code and get better performance - but should we?

In this talk we investigate what these attributes mean, the risk of using them incorrectly (and even the risk of using them correctly!) and whether they’re actually worth the effort. We will dive deep into branch prediction, optimizations and pessimizations, and the art of benchmarking. We will see that in C++ questions that seem simple to begin with do not get a simple answer, but an interesting one!

Participants of the talk will hopefully improve their knowledge of performance tuning, and how to focus efforts in things that really matter for performance.
---

Amir Kirsh

C++ lecturer at the Academic College of Tel-Aviv-Yaffo and Dev Advocate at Incredibuild. Previously the Chief Programmer at Comverse. Co-organizer of Core C++ conference and a member of the Israeli ISO C++ NB. Currently a visiting researcher at Stony Brook University, New-York.

Tomer Vromen

Software engineer at Dell Technologies, cppcon.digital-medium.co.uk/tag/programming/">programming in C++ for 10 years. Interested in algorithms, software development, and long distance running.
---

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: , , , ,

C++ Class Template Argument Deduction – History, Uses, & Enabling it for Classes – Marshall Clow

  • Lobby
  • Tag Archives: moderncpp

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

C++ Class Template Argument Deduction - History, How to Use it, and How to Enable it for Your Classes - Marshall Clow - CppCon 2022
https://github.com/CppCon/CppCon2022

In C++17, a new feature "Class Template Argument Deduction" (CTAD for short) was added to the language.

In this talk, I will show the rationale for this feature, how you can use it in your code, explain how it works and give examples of how to enable it for your classes.
I'll answer questions like:
* Why did the committee add this feature to the language?
* Why "class template argument deduction"? Why not just "template argument deduction"?
* What is a deduction guide?
* What can be done in a deduction guide?
* How do I write my own deduction guides?
* What tools are there for debugging deduction guides?

I will also talk about enhancements since C++17, and possible future directions.
---

Marshall Clow

Marshall has been coding for 40+ years; he was the lead developer on libc++ for 10 years, and the chairman of the Library working group of the C++ standards committee for 5 years. These days, he spends his time looking at "interesting problems"
---

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: , , , , ,

The Observer Design Pattern in Cpp – Mike Shah – CppCon 2022

  • Lobby
  • Tag Archives: moderncpp

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

The Observer Design Pattern in Cpp - Mike Shah - CppCon 2022
https://github.com/CppCon/CppCon2022

Games, desktop software, phone apps, and almost every software that a user interacts with has some sort of event handling system. In order to handle events, a common behavior design pattern known as the 'observer pattern' allows one or more objects to monitor if a change of state takes place in another object. In this talk, we are going to do a deep dive into the behavioral design pattern known as the observer. The pattern utilizes a Subject and Observer (or publisher and subscriber) model to notify when state has changed from the subject to one or more observers in order to help make our software more maintainable, extensible, and flexible.

I will show some examples of the observer in modern C++ as well as real world use cases of where observers are used for further study. Finally, I'll discuss the tradeoffs of the observer pattern, and discuss which scenarios you may not actually want to use the observer pattern. Attendees will leave this talk with the knowledge to go forward and implement the observer pattern, as well as how to spot the observer design pattern in projects they may already be working on!
---

Mike Shah

Mike Shah is an Associate Teaching Professor at Northeastern University in the Khoury College of Computer Sciences. His primary teaching interests are in computer systems, computer graphics, and software engineering. His research interests are related to performance engineering (dynamic analysis), software visualization, and computer graphics. Along with teaching and research work, he have juggled occasional consulting work as a 3D Senior Graphics Engineer in C++.

Mike discovered computer science at the age of 13 when googling ”how do I make games”. From that google search, Mike has worked as a freelance game developer, worked in industry for Intel, Sony Playstation, Oblong Industries, and researched at The Ohio Supercomputer Center to name a few. Mike cares about building tools to help programmers monitor and improve the performance of realtime applications– especially games. In Michael’s spare time he is a long distance runner, weight lifter, and amateur pizza maker.
__

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: , , , ,