BDE 4.38.0 Release

Schedule

  • The BDE team announces that the BDE 4.38.0 production release was completed on Monday, June 1, 2026.

BDE 4.38.0 Release Highlights

C++23 Compatibility Changes

BDE 4.38.0 delivers a large set of C++23 compatibility enhancements to the bsl library. A full description of all changes is available in the BSL Support for C++23 article. The highlights are summarised below.

Ranges-Aware Construction and Insertion for bsl Containers

All bsl sequence and associative containers now support the C++23 bsl::from_range tag constructor and range-insertion methods such as append_range and insert_range, backported to C++03:

// Before: named variable required to keep the tokenizer alive
bdlb::Tokenizer tokenizer(text, " ");
bsl::vector<bsl::string_view> tokens(tokenizer.begin(), tokenizer.end());

// Now: pass directly using the from_range constructor
bsl::vector<bsl::string_view> tokens(bsl::from_range,
                                     bdlb::Tokenizer(text, " "));

Container adaptors (bsl::stack, bsl::queue, bsl::priority_queue) likewise gain from_range constructors and push_range.

Heterogeneous Erasure for Associative Containers

When a container’s comparator or hash is tagged as transparent, erase(key) now accepts any type comparable to the stored key type, eliminating unnecessary temporary constructions. For example, erasing from a bsl::set<bsl::string, bdlb::TransparentLess> supplied with a bsl::string_view no longer requires constructing a temporary bsl::string.

bsl::print and bsl::println: Backported C++23 Print Facility

<bsl_print.h> provides bsl::print and bsl::println available in all language modes back to C++03. On platforms with a C++23 standard library these delegate to the native implementation; elsewhere they are backed by BDE’s bslfmt formatter. See the <bsl_print_ostream.h> header for the separate output-stream overloads.

bsl::optional Monadic Interface

and_then, or_else, and transform enable functional-style chaining over optional values without explicit engagement checks (requires C++17 or later).

bsl::string / bsl::string_view Construction from nullptr Prohibited

Constructing a bsl::string or bsl::string_view from a null pointer literal is now a compile-time error (requires C++11), as required by C++23 (P2166). Previously such construction compiled silently but produced undefined behavior at runtime.

Because the deleted constructor takes bsl::nullptr_t, overload resolution selects it for any null pointer constant — defined by the C++ standard as an integer literal with value zero or a prvalue of type std::nullptr_t. This covers nullptr, 0, and NULL. A const char* variable is not a null pointer constant, even if its runtime value is null, and therefore does not select the deleted constructor:

bsl::string s(nullptr);    // now: compile-time error
bsl::string t(0);          // now: compile-time error
bsl::string u(NULL);       // now: compile-time error

const char* p = nullptr;
bsl::string v(p);          // unchanged: undefined behavior

New Standard Library Headers

The following headers were added to alias new C++23 standard library types:

  • <bsl_print.h> / <bsl_print_ostream.h>bsl::print, bsl::println, and vprint_* variants

  • <bsl_mdspan.h>bsl::mdspan, bsl::extents, bsl::dextents, layout policies, and bsl::default_accessor

  • <bsl_spanstream.h>bsl::spanbuf, bsl::ispanstream, bsl::ospanstream, bsl::spanstream (and w-prefixed wide variants)

  • <bsl_generator.h>bsl::generator (C++23 coroutine generator)

  • <bsl_stacktrace.h>bsl::stacktrace, bsl::stacktrace_entry, bsl::basic_stacktrace

  • <bsl_stdfloat.h>bsl::float16_t, bsl::float32_t, bsl::float64_t, bsl::float128_t, bsl::bfloat16_t

C++23 Aliases Added to Existing Headers

<bsl_algorithm.h>, <bsl_bit.h>, <bsl_functional.h>, <bsl_iosfwd.h>, <bsl_iterator.h>, <bsl_memory.h>, <bsl_numeric.h>, <bsl_ranges.h>, <bsl_type_traits.h>, and <bsl_utility.h>. These include the new ranges algorithms (fold_left, fold_right, contains, find_last, starts_with, ends_with, iota, shift_left, shift_right), ranges views (zip, adjacent, chunk, slide, stride, enumerate, join_with, cartesian_product, as_const), and utility types (bsl::out_ptr, bsl::inout_ptr, bsl::allocation_result, bsl::start_lifetime_as, bsl::bind_back, bsl::forward_like).

Other C++23 Additions

  • bsl::string::contains() / bsl::string_view::contains() — tests whether a string contains a given substring, character, or string view (backported to C++03).

  • bsl::basic_string::substr() && — rvalue overload that can move storage rather than copy (requires C++11).

  • bsl::visit() extended to accept arguments whose static type is a class publicly derived from bsl::variant, as required by C++23 (requires C++11).

bdlb::PairUtil::adaptForRanges Pipe Operator

bdlb::PairUtil::adaptForRanges now supports operator|, enabling it to be used directly as a range pipeline adaptor. Previously, the range had to be passed as an argument to adaptForRanges; it can now be piped:

bsl::map<int, int> myMap = {{1, 2}, {3, 4}};

const bsl::vector<int> expectedValues = {2, 4};

// Before (4.27+):
assert(bsl::ranges::equal(expectedValues,
                          bdlb::PairUtil::adaptForRanges(myMap) | bsl::views::values));

// Now also possible:
assert(bsl::ranges::equal(expectedValues,
                          myMap | bdlb::PairUtil::adaptForRanges | bsl::views::values));

bslma::TestAllocator Configurable Fill for Newly Allocated Memory

bslma::TestAllocator has been enhanced with the ability to fill freshly allocated memory with a user-configurable byte value. This aids in detecting use-of-uninitialized-memory bugs during testing.

Fixed Tickets

Summary

C++23 Support In BSL

C++23: Add aliases to <bsl_algorithm.h>

C++23: Add aliases to <bsl_bit.h>

C++23: Add BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY macro

C++23: Add aliases to <bsl_functional.h>

C++23: Add aliases to <bsl_ranges.h>

C++23: Add aliases to <bsl_type_traits.h>

C++23: Add aliases to <bsl_utility.h>

C++23: Add aliases to <bsl_numeric.h>

C++23: Add <bsl_generator.h> header

C++23: Add <bsl_spanstream.h> header

C++23: Add <bsl_mdspan.h> header

C++23: Add <bsl_stacktrace.h> header

C++23: Add <bsl_stdfloat.h> header

C++23: Add aliases to <bsl_iosfwd.h>

C++23: Add aliases to <bsl_iterator.h>

C++23: Add aliases to <bsl_memory.h>

C++23: Avoid deprecated UDL operator suffix syntax

C++23: BDE allocator testing in bslim_bslstandardheadertest.t.cpp

C++23: Prohibit bsl::basic_string and bsl::basic_string_view construction from nullptr

C++23: Add bsl::string::contains() and bsl::string_view::contains()

C++23: bsl::basic_string::substr() &&

C++23: Monadic operations for bsl::optional

C++23: Iterator-pair constructors for bsl::stack and bsl::queue

C++23: bsl::string ranges-aware construction and insertion

C++23: Ranges-aware construction for container adaptors

C++23: Ranges-aware construction and insertion for sequence containers

C++23: Make concepts and ranges available in bslstl

C++23: Ordered containers: Add ranges-aware construction and insertion

C++23: Unordered containers: Add ranges-aware construction and insertion

C++23: Fix in bslstl_priorityqueue.t.cpp

C++23: bsl::visit() for classes derived from bsl::variant

C++23: bsl::string range operations follow-ups

C++23: Add <bsl_print.h> header

C++23: bsl::string: enhance for ‘’sized’’ ranges

C++23: Heterogeneous erasure overloads for associative containers

C++23: std::views::zip in bslstl_ranges.h

std::ranges::iota: aliases are not found

bsl::stop_token – add callback alias template

C++23: Port additional ranges views (slide, stride, adjacent, chunk, enumerate, join_with, cartesian_product, and more)

Simplify bcec test drivers to verify aliasing

Fix use-after-free bug in bdxa_simpletask.t

Remove std type aliases from wrong BDE header

bdex_testinstreamformatter: fix bad indentation

bdlmt::EventScheduler thread safety has been weakened

TSAN race fix in bdlcc::TimeQueue

Ability to set freshly allocated memory in bslma::TestAllocator to a configurable value

Remove BOMs from BDE repo

bdlb::PairUtil::adaptForRanges – add operator| adaptor

Improve bdlt format article and bdlt_formatdoc

Fix bdld::Datum nightly build failure on clang

Correct bslalg_numericformatterutil.t.cpp failures

Correct bdlt_localtimeoffset.t.cpp compile warnings

Correct UBSan issues in bdl

Correct BDE test driver compile warnings

Assorted minor drive-by fixes

Remove bslfmt include from bsl_ostream.h

C++23: Add bsl_print_ostream.h