San Diego C++ Meetup #41

Super fun evening in San Diego, America’s finest city with the finest programming language (C++, if you had any doubts).

We learned tons of stuff and we are ready to Rock’n Roll using C++ at work and … home!

What did we discuss tonight?
1. Goals we would like to achieve in San Diego C++ Meetup. We would like to make sure members learn new fun constructs in C++.
2. C++ Quiz – few fun questions.
3. Template Function specialization (Beginners-Intermediate).
4. Correct way to printf() – Using std::string_view with printf (Beginners).

San Diego C++ Meetup #40

Yet another fun evening in San Diego, America’s finest city with the finest programming language.

We discussed:

  1. Welcome slides – goals we would like to achieve in San Diego C++ Meetup
  2. C++ Quiz – few fun questions
  3. Going over C++ Stackoverflow posts
  4. unique_ptr, shared_ptr and std::initializer_list<>

San Diego C++ Meetup #39 Featuring Nick Ristuccia from JFrog and the Conan team!

From the Command Line, to Make, to CMake, to Conan By Nick Ristuccia from JFrog!

This session examines the layers of tooling used to produce C/C++ applications and make developers’ lives easier. Surveys say a major pain point facing C/C++ developers is long build times. One way to save time is to only re-build an artifact when a change occurs. Although the command line offers the precision of specifying what to build, doing this and tracking changes manually can quickly become a daunting and error-prone proposition. Make as a build system allows developers to specify and execute command-line statements depending on what file changes are detected. However, these statements may be particular to one compiler or operating system. CMake provides the missing flexibility for a makefile file. One CMake file can generate what’s needed for a variety of build systems, compilers, and operating systems. Another major pain point facing C/C++ developers is managing all the libraries needed by an application. Libraries provide the functionality programs need. But it gets tricky when libraries depend on other libraries that depend on other libraries in a spaghetti-like formation. The goal of Conan as a package manager is to alleviate this burden. ConanCenter, for example, features over 1000 recipes. The promise of a recipe is to untangle the spaghetti and list the dependencies for a given library.

Nick started in the video games industry, developing titles for console and mobile. Disappointed by the oppressive corporate feel of traditional technical training, Nick’s passion is to create more engaging and powerful learning experiences through game-based learning and other playful techniques. As a Curriculum Developer at Oracle, he focused on Java programming and certification. As a Developer Advocate at JFrog, his focus is on C++, Conan, and other JFrog technologies.

Recording:

San Diego C++ Meetup #38 Featuring Amir Kirsh from Incredibuild

Meetup session May 24 20212

Six ways for implementing max: a walk through API design, dangling references and C++20 constraints

Abstract:
API design in C++ is harder than in other languages, as the lifetime of the arguments and return value shall be considered carefully. While it gives programmers the full power in expressing their intent, it raises all sorts of concerns that should be considered. In this talk we would analyze a very simple function: max, we would see that selecting the proper API is not as simple as it may seem and discuss several alternatives. The discussion would take us through lvalue, rvalue and forwarding references, the rules of moving from a local, variadic templates design, the differences between returning auto and decltype(auto) and C++20 constraints.

Bio:
Amir Kirsh is a C++ lecturer at the Academic College of Tel-Aviv-Yaffo and Dev Advocate at Incredibuild. He is also the Co-organizer of Core C++ conference and a member of the Israeli ISO C++ NB.

Meeting event: https://www.meetup.com/San-Diego-CPP/events/285561768/

Recording:

My Best C++11, 14 and 17 Features

From the 37th San Diego C++ Meetup:

Recently I was hosted twice in cppcast podcast with Rob and Jason. I mentioned how using C++17 makes it easy to develop Modern C++ code. I will go over various features that are proven to work well. We built a software with no memory issues, no UBs etc… – the name of the talk is: “My best C++11,14 and 17 features that helped me write a better code”. (Beginners to Intermediate)

Yacob (Kobi) Cohen-Arazi

36th San Diego C++ Meetup

As always good times at the SDCPPM (also on Twitter)! Learned something new last night and met great people! Thanks again for organizing this Kobi!

For those new to this Meetup: we meet once a month for few hours to discuss C++ features, techniques, questions asked no the net, and more. Sometimes we have guest speakers give presentations on various topics (Conan Package Manager, C++20 Concepts to name a few). Join us! Join to listen in, chat and exchange your experience coding in C++, or be a speaker and teach us something cool! All backgrounds and experience levels welcome!

Agenda

  1. Welcome slides – goals we would like to achieve in San Diego C++ Meetup
  2. C++ quiz
  3. Welcome slides – goals we would like to achieve in San Diego C++ Meetup
  4. C++ quiz (Beginners to Intermediate)
  5. Supporting creators – introducing Patreon (All levels)
  6. Book of the Month – Practical C++ Design(2nd edition), From Programming to Architecture By Adam B. Singer (All levels)
  7. Stackoverflow discussion – Is there a way to pass auto as an argument in C++? (Beginners to Intermediate)
  8. r/cpp_questions – One function – multiple datatypes? (Beginners)
  9. Discuss few slides from walletfox website (Beginners to Intermediate)
  10. My best C++11,14 and 17 features that helped me write a better code (Beginners to Intermediate)

32nd San Diego C++ Meetup

Agenda:

1. Welcome slides – goals we would like to achieve in San Diego C++ Meetup
2. C++ quiz
3. Do you know what your std::remove(_if) does?
4. Stackoverflow questions and discussions
4a. How does the C++ compiler evaluate recursive constexpr functions so quickly?
4b. How to check if int32_t number can fit in int8_t and int16_t?
5. Quora question discussion – Arrays, references and pointers
6. Book – Large-Scale C++ Volume I: Process and Architecture by John Lakos
7. Discuss few slides from walletfox website
8. Talk – My Quest for a Quick QuickSort

Event link on Meetup.


= delete; // not just for special member functions

During the 29th San Diego C++ Meetup fellow C++ enthusiast and contributor to my blog, Kobi, brought up something interesting about deleted functions and I wanted to share this little gem with you…

To my surprise the = delete; postfix can be applied not only to special member functions like constructors or assignment operators, but to any free standing or member function!

Why would you want such sorcery you ask? Imagine you have a function like this:

void foo(void*) {}

On its own foo can be called with a pointer to any type without the need for an explicit cast:

foo(new int); // LEGAL C++

If we want to disable the implicit pointer conversions we can do so by deleting all other overloads:

template<typename T> void foo(T*) = delete;

Or the short and sweet C++20 syntax:

void foo(auto*) = delete;

To cast a wider net and delete all overloads regardless of the type and number of parameters:

template<typename ...Ts> void foo(Ts&&...) = delete;

Kobi found this on stack overflow of course 🙂


Example program:
delete.cpp


San Diego C++ Meetup

San Diego C++ Meetup 25th meeting featuring JFrog and Conan!

https://www.meetup.com/San-Diego-CPP/
https://www.meetup.com/San-Diego-CPP/events/277115020/

Agenda

Welcome slides – goals we would like to achieve in San Diego C++ Meetup
This meeting – Hosting JFrog: Conan Package Manager for C++ in Practice

If time permits:
* Shout Out to a great C++ blog – “Vorbrodt’s C++ Blog”
* 3 cppquiz questions
* 2 years of San Diego C++ Books recommendations – a recap!
* An additional New book for this month – “Ace the Trading Systems Developer Interview” With an example of one of the questions

Featuring:
* Conan Package Manager for C++ in Practice

The Conan package manager for C++ is useful in both simple and advanced development environments. Join the Conan team to see it in action, with a simple demo using OSS libraries and tools from ConanCenter, and a more complete demo showing how to create and upload a package including different binaries for different platforms to a private repository. Also, learn about many other unique and innovative advanced Conan features along the way.

Jerry Wiltse Bio: Jerry is a member of the Conan development team, and has been dedicated to build engineering for C and C++ since 2016. He is an avid open-source enthusiast but also deeply focused on enterprise development environments. He is also the narrator and creator of the Conan learning track on the JFrog Academy.