Do we really need another Pointer Class?

Ansel Sermersheim, Barbara Geller

60 minute session
intermediate
15:30-16:30, Wednesday, 28th June 2023

The Standard Library contains a variety of smart pointer classes. Most of these classes were originally developed for the Boost libraries and as they gained popularity they were standardized and added in C++11. In order to efficiently implement smart pointers, move semantics had to be added at the same time.

New functionality for using smart pointers, like std::make_unique was added in C++14. Support for accessing memory as a range was added in C++20. What is significant is there have not been any new smart pointer classes added since C++11. So are we missing any valuable smart pointer classes which should be part of the standard?

The majority of the smart pointer classes in our library were outdated and did not leverage the current existing STL pointer classes. In this talk we will explain why our pointer classes were completely redesigned and then subsequently moved to a new library.

During the process of refactoring our pointer classes we discovered the base widget class was managing too much data. We implemented a new controller class which is now responsible for ownership and reference counting. This required using a different category of smart pointer which is not currently available in the standard library.

This presentation will include a brief introduction to smart pointers, outline why a non-standard smart pointer was needed, and discuss the implementation.

pointers
memory management
lifetime
ownership

Ansel Sermersheim

I am an independent consultant specializing in the development of the CopperSpice project, promoting open source, and educational trainings. I have been working as a programmer for over twenty years. My degree is in Computer Science from Cal Poly San Luis Obispo.

Co-founder of CopperSpice, a C++ GUI library Co-founder of DoxyPress, a C++ application for generating documentation

Developer of the BSD open source libraries: CsLibGuarded, CsPaint, CsSignal, and CsString.

I have programmed in C++, C, Lisp, Java, and Perl, with extensive knowledge in TCP/IP and multithreaded design. I am an avid follower of the C++ standard.

Speaker at CppCon 2015, CppNow 2016, CppNow 2017, CppCon 2017, CppCon 2018, emBO++ 2019, CppCon 2019, CppCon 2020, MeetingC++ 2019, code::dive 2019, CppOnSea 2021, and numerous ACCU meetings in the SF Bay Area, Amsterdam, Munich, and London.

Barbara Geller

I am a GUI application and library developer, educator, and author of a C++ development blog. The focus of my career involves the development of CopperSpice and DoxyPress, consulting, product management, and C++ videos. My degree is in Electrical Engineering from Cal Poly Pomona with additional studies towards a masters in Computer Science.

Previous consulting projects involved software design and development of custom GUI applications for job costing, medical billing, construction, and the ground transportation industry.

Co-founder of CopperSpice, a C++ GUI library Co-founder of DoxyPress, a C++ application for generating documentation

Developer of the Diamond Editor, a cross-platform editor for programmers, using the CopperSpice libraries. Developer of the BSD open source libraries: CsPaint, CsSignal, CsString.

I have programmed in C++, Qt, Visual Objects, Clipper, PHP, and Java with extensive knowledge in GUI applications.

Speaker at CppCon 2015, CppNow 2016, CppNow 2017, CppCon 2017, CppCon 2018, emBO++ 2019, CppCon 2019, CppCon 2020, MeetingC++ 2019, code::dive 2019, CppOnSea 2021, and numerous ACCU meetings in the SF Bay Area, Amsterdam, Munich, and London.