BDE 3.127.0 Release

Schedule

  • The BDE team announces that the BDE 3.127.0 production release was completed on Wednesday, December 6, 2023.

BDE 3.127.0 Highlights

Forwarding Headers for bslma_allocator and bdldfp_decimal

In this release, BDE introduces Forwarding Headers for the components bslma_allocator and bdldfp_decimal. Forwarding Headers are header files that provide forward declarations for a component, but no definitions. Modeled after the standard iosfwd header that provides forward declarations for the input/output library, these headers are useful for reducing compile times when only forward declarations are needed. The forwarding headers for these components are named bslma_allocator.fwd.h and bdldfp_decimal.fwd.h, respectively.

Note

BDE and the C++ community at Bloomberg discourage forward declaring types from a different library, as this prevents that library from refactoring in the future.

We will be providing documentation for how to create forwarding headers in the near future.

As an example, the Employee class provided by the following header file depends only on the declaration of bslma::Allocator, but does not depend on its definition (e.g., bslma::Allocator is used in-name-only). So, the header file can include bslma_allocator.fwd.h instead of bslma_allocator.h:

// mypkg_employee.h

#include <bslma_allocator.fwd.h>

namespace mypgk {

                             // ==============
                             // class Employee
                             // ==============

class Employee {
    // DATA
    bsl::string d_firstName;
    bsl::string d_lastName;

  public:
    // CREATORS
    explicit Employee(bslma::Allocator *basicAllocator);

    // ...
};

} // close package namespace

Now, if the Employee(bslma::Allocator *basicAllocator) constructor is defined in the .cpp file, that file can include bslma_allocator.h to have access to the definition of bslma::Allocator, which will be required to use it in the implementation:

// mypkg_employee.cpp

#include <bslma_allocator.h>

namespace mypkg {

                             // ==============
                             // class Employee
                             // ==============

// CREATORS
Employee::Employee(bslma::Allocator *basicAllocator)
: d_firstName(basicAllocator)
, d_lastName(basicAllocator)
{
}

// ...

}  // close package namespace

BDE will provide forwarding headers on a case-by-case basis, generally for common vocabulary types.

Non-Copyable Type Support Added to bsl::function

bsl::function now supports callable objects that return a non-copyable type. This feature requires the language feature “copy elision” that was introduced in C++17.

For example:

struct NonCopyable {
    NonCopyable(const NonCopyable &) = delete;
    NonCopyable& operator=(const NonCopyable &) = delete;
};

NonCopyable Func () { return NonCopyable(); }

bsl::function<NonCopyable()> f(Func);

NonCopyable one = Func();  // call the function directly
NonCopyable two = f();     // call using bsl::function

See https://en.cppreference.com/w/cpp/language/copy_elision for more about copy-elision.

Removal of BAEL_NONE severity value

BAEL_NONE severity level value was removed from the list of the valid log severity levels. This value had no clear meaning - in some usage contexts it was equivalent to e_OFF while in some other contexts - e_TRACE. If your code still uses this value, please map it a one of the valid severity levels.

Standard Library Aliasing Policy Update

The bsl library will alias library features removed in C++20 where those features:

  1. Were previously aliased by bsl in C++17, and

  2. They continue to be provided by the compiler’s standard library implementation

New Features

  • bsl::span<char> objects now support construction from bsl::string and bsl::string_view.

  • Link-coercion symbols have been added to the BDE libraries for C++20 and C++23. These symbols prevent code compiled with different language versions from linking against BDE libraries built in C++20 or C++23 mode, which prevents silent ABI breakage.

Fixed DRQSs:

Summary

Overnight build error in balm

BDE 4 allocator changes: bdlm_metricdescriptor.t build failure

Support for the bsl::span(CONTAINER) constructor on C++03 platforms

reduce bdlf_bind.t.cpp compile warnings

remove use of tempnam

reduce nb issues 20231108

Remove unnecessary ‘volatile’ qualifier from the ‘bslmt_readerwriterlock’

Remove unnecessary ‘volatile’ qualifier from the ‘bdlat_typename’

Please add @CANONICAL_HEADER for standard C library headers (bsl_c_*.h)

reduce bsl and bdl test driver warnings for bsl and bdl

Create forwarding header for bslma_allocator

augment metrics registrar for default namespace and descriptor instance counter

balxml::TypesPrintUtil fails to print customized types as hex

BDE C++ standard coercion symbols for c++20 and up.

Protect using declaration for std::atomic_ref in apple clang++

bsl::not1 for C++03 and C++20 build compatibility

update bdlmt::TimerEventScheduler for monitoring

update bdlmt::EventScheduler for monitoring

bsl::function does not work with lambdas returning non-copyable objects

please investigate ‘maxBufferSize’ logic in bdlma_sequentialpool

BDE C++ standard coercion symbols for C++20 and up.