By Blog Staff | Jun 24, 2026 03:07 PM | Tags: None

xie-library.pngRegistration is now open for CppCon 2026! The conference starts on September 12 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2026!

Implement the C++ Standard Library: Design, Optimisations, Testing while Implementing Libc++

by Hui Xie

Summary of the talk:

This presentation covers various practical examples in the designs, optimisations and testing in libc++, a standard library implementation.

In space optimisation section, it presents various examples of using compact type, reusing tail padding bytes, reusing unused bits in existing bytes, in various standard types: std::stop_token , std::expected , std::optional , std::variant , std::ranges library and std::move_only_function .

In time optimisations section, it presents examples of how we optimise std::atomic<T>::wait 's waiting strategy, how we optimised algorithms for segmented iterators, and also how we keep in mind optimisations by leaving the door open for future optimisations. At the same time, compilation time is also important so it also contains examples how unnecessary template instantiations can be avoided.

Finally, this talk covers the unit tests of libc++, including the high test coverage of standard spec, the technique we share tests between runtime and constexpr, negative testing and so on.