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, andvprint_*variants<bsl_mdspan.h>—bsl::mdspan,bsl::extents,bsl::dextents, layout policies, andbsl::default_accessor<bsl_spanstream.h>—bsl::spanbuf,bsl::ispanstream,bsl::ospanstream,bsl::spanstream(andw-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 frombsl::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 |
C++23: Add aliases to |
C++23: Add |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Add |
C++23: Add |
C++23: Add |
C++23: Add |
C++23: Add |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Add aliases to |
C++23: Avoid deprecated UDL operator suffix syntax |
C++23: BDE allocator testing in |
C++23: Prohibit |
C++23: Add |
C++23: |
C++23: Monadic operations for |
C++23: Iterator-pair constructors for |
C++23: |
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 |
C++23: Ordered containers: Add ranges-aware construction and insertion |
C++23: Unordered containers: Add ranges-aware construction and insertion |
C++23: Fix in |
C++23: |
C++23: |
C++23: Add |
C++23: |
C++23: Heterogeneous erasure overloads for associative containers |
C++23: |
|
|
C++23: Port additional ranges views ( |
Simplify |
Fix use-after-free bug in |
Remove |
|
|
TSAN race fix in |
Ability to set freshly allocated memory in |
Remove BOMs from BDE repo |
|
Improve |
Fix |
Correct |
Correct |
Correct UBSan issues in |
Correct BDE test driver compile warnings |
Assorted minor drive-by fixes |
Remove |
C++23: Add |