-
0.58.5 (2025/01/30)
- Disabled code coverage in pipelines (will re-enable when performance regression(s) are investigated/fixed)
- Fixed compatibility issue by relaxing CMake version requirement to 3.22
-
0.58.2 (2025/01/13)
- Fix some doc comment typos
- Expand the coding style document
- Add
BATT_SUPPRESS_IF_GCC_VERSION(version, warning_id_str)
to<batteries/suppress.hpp>
- Fix some spurious warnings to enable gcc 13 support (not yet added to pipelines)
-
0.58.1 (2024/11/18)
- Add code coverage tools to the pipeline docker image
- Bug fixes/improvements to scripts
- Fix Conan editable mode
- Fix bugs re: multiple check failures suppress full trace when multi-threaded
- Fix bug in Optional that allows implicit conversion from primitive type to strong typedef
-
0.58.0 (2024/10/10)
- Added support for throwing out of Batteries-based code into a larger app context that uses exceptions.
batt::StatusException
- exception type that wraps abatt::Status
plus an optional extra message string; derives fromstd::runtime_error
BATT_THROW_IF_NOT_OK(expr)
- macro that accepts any expression evaluating to abatt::Status
orbatt::StatusOr<T>
; expands to statement that checks for ok and throwsbatt::StatusException
if not ok; supports stream-insertion (<<
) of extra information similar toBATT_CHECK
BATT_OK_RESULT_OR_THROW(expr)
- macro that accepts an expression that evalutes to abatt::StatusOr<T>
and expands to an expression that checks for ok (throwsbatt::StatusException
if not), plus a dereference of theStatusOr
if it is ok
- Added support for throwing out of Batteries-based code into a larger app context that uses exceptions.
-
0.57.2 (2024/10/02)
- Fixed compilation error on gcc with C++ std versions before 20 (17, gnu17).
-
0.57.1 (2024/10/01)
- Fixed #23 (bug) -
batt::seq::chain()
produces sequence that gives incorrect result forpeek()
when first sequence empty, second sequence non-empty. - Upgrade script submodule - moved test from top-level Makefile to script/conan-targets.mk; added script/run-tests.sh.
- Fixed #23 (bug) -
-
0.57.0 (2024/09/25)
- Added SSL/TLS (
https://
) support tobatt::HttpClient
- SSL context initialization can be customized by supplying a
std::function
tobatt::HttpClient::set_ssl_init_fn
. The function should have the signaturevoid(Optional<boost::asio::ssl::context>&, const HostAddress&)
, and should construct the passed optional context in-place (usingbatt::Optional::emplace
).
- SSL context initialization can be customized by supplying a
- Worked around race conditions in conan install when downloading/building new packages
- Added support in CI pipelines for uploading any packages that were built from source during
make install
to a cache artifact server. - Upgraded dependencies in the lockfile (and also added openssl, for https support).
- Added SSL/TLS (
-
0.56.2 (2024/09/10)
- Fixed race condition bugs in
batt::ReadWriteLock
that could lead to panics or deadlocks - Added
HoldOwnership
andReleaseOwnership
modes for allWatchAtomic<T>
simple modification functionsHoldOwnership
is the default; it is slightly faster and more scalable, but assumes that the caller will keep the Watch object alive until the function returnsReleaseOwnership
is slightly slower and less scalable, but is safe to call even when the modification being performed to the Watch value will cause the Watch itself to be deleted
- Added a
batt::FakeTimeService
instance tobatt::FakeExecutionContext
; added support inbatt::FakeExecutionContext::run_with_random_seed
for simulated timer expirations
- Fixed race condition bugs in
-
0.56.0 (2024/09/06)
- Renamed
batt::Grant
tobatt::SpinGrant
- Introduced new Grant implementation,
batt::ScalableGrant
- Uses explicit mutex locks and a waiter queue to scale more gracefully than the old Grant (now SpinGrant), where all contenders to claim Grant count use a single
batt::Watch
and CAS-like loops AsyncScalableGrantTest.ScalabilityBenchmark
test (newly added) demonstrates that, as expected, SpinGrant degrades linearly with the number of contenders, whereas ScalableGrant maintains a constant throughput even when faced with hundreds or thousands of Tasks competing for Grant count.
- Uses explicit mutex locks and a waiter queue to scale more gracefully than the old Grant (now SpinGrant), where all contenders to claim Grant count use a single
batt::Grant
is now a type alias tobatt::ScalableGrant
- Minor bug fixes that cause spurious failed checks when panicking on another thread
- Renamed
-
0.55.1 (2024/07/25)
- Fixed bug where printing a
batt::WaitForResource
to astd::ostream
results in a crash - Added test for
std::ostream
printing ofbatt::CountMetric
- Fixed bug where printing a
-
0.55.0 (2024/07/19)
- Added
batt::LazyLatch<T>
- likebatt::Latch<T>
but automatically initializes when value is requested, via aninit_fn
passed in at construction time.
- Added
-
0.54.0
- Added template parameter
bool kAllowAlloc
forbatt::SmallFn
, which enables falling back to dynamic (heap) allocation if a type-erased function is too large to fit in the inline small object buffer (similar tobatt::SmallVec
). - Added
batt::InstanceCounter<T>
for easy debug tracking of the number of active instances for a given type.
- Added template parameter
-
0.53.0
- Batteries now uses Conan version ranges for dependencies + lock files.
- Added
batt::StaticTypeMap<KeyTupleT, ValueT>
, to store a fixed-size collection of values indexed by distinct types.
-
0.52.5
- Added
batt::ReadWriteMutex<T>
to wrapbatt::ReadWriteLock
and an instance ofT
, using an API similar tobatt::Mutex<T>
.
- Added
-
0.52.3
- Fixed race condition bug in
WatchAtomic::poke()
/Queue<T>::poke()
that could cause the next waiter to miss the poke.
- Fixed race condition bug in
-
0.52.1
- Added a static assert to detect incorrect use of
batt::seq::map
(when the map function returns void).
- Added a static assert to detect incorrect use of
-
0.52.0
- Added
batt::HttpServer
: a basic HTTP/1.1 server implementation based onbatt::Task
, sharing common code withbatt::HttpClient
- Added
cleanup_fn
optional argument tobatt::Queue<T>::drain
- Added
batt::HttpMessageBase::close()
(inherited bybatt::HttpRequest
andbatt::HttpResponse
) - Added
batt::HttpMessageBase::invoke_stream_writer(writer_fn)
(inherited bybatt::HttpRequest
andbatt::HttpResponse
) - Moved
serialize
method frombatt::HttpRequest
tobatt::HttpMessageBase
so it can be used bybatt::HttpResponse
- Moved
RequestInfo
to top levelbatt::HttpMessageInfo
so it can be used with requests and responses
- Added
-
0.51.1
- Added
BATT_ASSERT
statements to detect attempts to access the contents of an invalidbatt::Optional<T>
.
- Added
-
0.51.0
- Added
batt::bit_count
, a portable version of the "how many 1-bits in this integer" machine instruction (POPCOUNT on Intel).
- Added
-
0.50.9
- Added better explanation of the
batt::Mutex<T>::with_lock
(doc comments). - Added a
\return
doc tag forWatchAtomic<T>::set_value
.
- Added better explanation of the
-
0.50.7
- Added
patchelf
package to Docker image for CI/CD pipelines. - Added
batt::InlineSubTask<kStackBufferSize>
(#include <batteries/async/inline_sub_task.hpp>
) for easy allocation/launching of sub-tasks using part of the stack memory of an existing task.
- Added
-
0.50.6
- Added environment variable
BATT_DEFAULT_SCHEDULER_PIN_CPU
to control whetherbatt::Runtime::default_scheduler()
pins its thread pool 1:1 to specific CPUs.
- Added environment variable
-
0.50.5
- Added
batt::ReadWriteLock
, an implementation of a fair reader/writer mutex as described in "Synchronization Without Contention" (Mellor-Crummey, Scott, 1991) - Changed the Dockerfile to install all Python packages (including Conan) in a virtual environment (/opt/venv) instead of the ambient environment.
- Upgrade the Dockerfile to install Conan version 2.0.16.
- Added
batt::WatchAtomic<T>::poll()
, which yields the current task and then reloads/returns the watch value.
- Added
-
0.50.3
- Fixed a problem with the CMakeLists.txt and conanfile.py that caused unit tests to be (re-)built when running conan install from a downstream project.
-
0.50.1
- Added
batt::AtomicCounterGauge<T>
, an atomic variable with both gauge-like (moves up and down) and counter-like (add/subtract counters are monotonically increasing) semantics.
- Added
-
0.49.2
- Added
batt::BoolStatus
(<batteries/bool_status.hpp>
), an enum that has true/false/unknown values and overloaded logical operators.
- Added
-
0.49.1
- Added to
<batteries/type_traits.hpp>
:is_any_true(expr0, expr1, expr2, ...)
: (constexpr
) Returns true (and short circuits) at the firsttrue
-valued argument; elsefalse
are_all_true(expr0, expr1, expr2, ...)
: (constexpr
) Returns false (and short circuits) at the firstfalse
-valued argument elsetrue
IsOneOf<T, M0, M1, ...>
: (inline constexpr bool
) True iffT
is exactly one of the setM0
,M1
, ...DecaysToOneOf<T, M0, M1, ...>
: (inline constexpr bool
) True iffstd::decay_t<T>
is one of the setM0
,M1
, ...
- Added to
-
0.49.0
- Added
BATT_RETURN_OK_RESULT(expr)
, which unwraps and returns expr if it evaluates to an ok status, continues without returning otherwise.
- Added
-
0.48.9/0.48.10 (2023/11/27)
- Fix conan install bug in conanfile.py: search for script/batt.py relative to the source folder, in addition to the conanfile.py folder.
-
0.48.8 (2023/11/21)
- Add
batt::Promise<T>::is_ready()
to test whether a future value or error has been set.
- Add
-
0.48.4 (2023/11/16)
batt::Status
now preserves message strings fromstd::error_code
(for the built-in error categories:std::system_category()
,std::generic_category()
,std::future_category()
, andstd::iostream_category()
).
-
0.48.3 (2023/11/15)
- Added header
operators.hpp
:BATT_OBJECT_PRINT_IMPL(inline_decl, type, fields_tuple)
- Defines
<<
to print the object to an ostream
- Defines
BATT_OBJECT_EQUALS_IMPL(inline_decl, type, fields_tuple)
- Defines
==
as conjunction of field-wise equality
- Defines
BATT_OBJECT_LESS_THAN_IMPL(inline_decl, type, fields_tuple)
- Defines
<
as a lexicographical ordering of the field orders
- Defines
BATT_EQUALITY_COMPARABLE(inline_decl, left_type, right_type)
- Defines
!=
based on==
- Defines
BATT_TOTALLY_ORDERED(inline_decl, left_type_right_type)
- Defines
>
,<=
, and>=
based on<
- Defines
- Added header
-
0.48.2 (2023/11/06)
- Added
batt::Future<T>::from_value
,batt::Future<T>::from_error
: convenient API for making completed Futures. - Print
batt::Status
asGROUP.CODE:MESSAGE
instead ofVALUE:MESSAGE
; this allows the savvy reader to convert printed Status values to, for example, errno codes by inspection.
- Added
-
0.47.0 (2023/10/17)
- Added
batt::Future<T>::and_then
for monadic future composition.
- Added
-
0.33.0 (2023/05/19)
- Added Conan options for build variants that affect ABI:
header_only
glog_support
protobuf_support
asserts_enabled
shared
- Added
<batteries/stacktrace.hpp>
, which includes boost stacktrace and suppresses spurious GCC warnings in the boost code. - Added a runtime check system to
<batteries/config.hpp>
that computes a "feature [bit-]mask" which captures the build variant; this is done for each compilation unit that includesconfig.hpp
(using static init of abool
in an anonymous namespace) and compared to a global, canonical feature mask. In this way, we can now detect bugs where different libraries were built with different Batteries feature settings and halt the program before undefined behavior ensues. - Added new macros to control optimization suppression in the code:
BATT_GCC_BEGIN_OPTIMIZE(setting)
- setting must be a string literal, e.g. "O0"BATT_GCC_END_OPTIMIZE()
- reverts the optimization level set byBATT_GCC_BEGIN_OPTIMIZE
BATT_BEGIN_NO_OPTIMIZE()
- begins a section in which optimization is completely disabledBATT_END_NO_OPTIMIZE()
- ends a section begun byBATT_BEGIN_NO_OPTIMIZE
- Enabling
BATT_ASSERT
statements can now be done independent of theNDEBUG
define, usingBATT_ASSERTS_ENABLED
, which is controlled by the Conan config via theasserts_enabled
option, which can beNone
(default),True
, orFalse
. IfBATT_ASSERTS_ENABLED
is not defined (i.e.,asserts_enabled
isNone
), then asserts are only enabled whenNDEBUG
is defined, like before. - Added support for
std::ostream operator<<
tobatt::LogLevel
(<batteries/status.hpp>
) - Fixed silent ABI breakage bug in
batt::detail::NotOkStatusWrapper
that causes aborts at runtime when some libraries are compiled withBATT_GLOG_AVAILABLE
and some without. - Fixed an overly aggressive check in
batt::Task
- Added Conan options for build variants that affect ABI:
-
0.31.3 (2023/05/03)
- Fixed bug in TakeNSource that causes hang after limit is reached (instead of returning batt::StatusCode::kEndOfStream).
-
0.31.0 (2023/05/03)
- Added
batt::SingleBufferSource
.
- Added
-
0.30.0 (2023/04/13)
- Fix #4 (Added
std::ostream& operator<<(std::ostream&, batt::Watch<T>)
) - Fix #5 (Deadlock if a failed BATT_CHECK generates another failed check when trying to print the message)
- Fix #6 (Added
batt::Watch<T>::reset()
)
- Fix #4 (Added
-
0.29.0 (2023/03/31)
- Add
batt::seq::zip
.
- Add
-
0.28.5 (2023/03/17)
- Add doc comment for
batt::getenv_as
.
- Add doc comment for
-
0.28.4 (2023/03/17)
- Added
batt::Optional::or_else(Fn)
to matchstd::optional
. - Changed
batt::require_fail_thread_default_log_level()
to returnbatt::Optional<batt::LogLevel>&
instead ofbatt::LogLevel&
, and made it default to the current global setting when it isbatt::None
.
- Added
-
0.28.3 (2023/03/13)
- Fix bug that prevented the use of
batt::Future<T>::await
.
- Fix bug that prevented the use of
-
0.27.1 (2023/03/08)
- Fixed typo in case_of.hpp doc.
- Added support for silent conversion of
batt::StatusOr<batt::NoneType>
tobatt::Status
.
-
0.27.0 (2023/03/07)
- Added
BATT_CHECK_TYPE(type, expr)
to<batteries/static_assert.hpp>
:- At runtime, evaluates to just
expr
, but adds a compile-time assertion that the type ofexpr
istype
.
- At runtime, evaluates to just
- Added
-
0.26.0 (2023/03/04)
- Added
batt::Task::DeferStart{bool}
option to suppress automatic Task starting; also:- Added member fn
batt::Task::is_started()
- Added member fn
batt::Task::start()
- Added class
batt::Task::Options
- Added member fn
- Added
-
0.25.3 (2023/03/02)
- Fixed many missing functions/operators for
batt::Optional<T&>
partial specialization.
- Fixed many missing functions/operators for
-
0.25.0 (2023/02/23)
- Added
batt::Task::await_signal
(moved from "upper layers").
- Added
-
0.24.6 (2023/02/22)
- Added support for MacOS/Clang build pipelines
- Added
batt::Task::spawn()
- Added
batt::NoDestruct<T>
-
0.23.1 (2023/02/06)
- Fixed bug in script/run-with-docker.sh
- Added xxd to docker images
-
0.22.1 (2023/01/27)
- Added
batt::DefaultInitialized
, a type that implicitly converts to any default-constructible type. - Added a
step
parameter (typebatt::TransferStep &
, batteries/async/fetch.hpp) that allows callers to determine which step failed whenbatt::transfer_chunked_data
returns an error.
- Added
-
0.21.0 (2023/01/25)
- Added
batt::register_error_category
to allow applications to specify howerror_code
values with customerror_category
objects should be converted tobatt::Status
. - Upgraded boost to 1.81.0
- Upgraded gtest to 1.13.0
- Added
-
0.20.1 (2023/01/18)
- Added
batt::transfer_chunked_data
(in batteries/async/fetch.hpp).
- Added
-
0.19.8 (2023/01/11)
- Upgrade to Conan 1.56 (from 1.53).
-
0.19.6 (2022/12/19)
- Fixed build error with
batt::to_status(std::error_code)
- Fixed build error with
-
0.19.5 (2022/12/16)
- Fixed crash bug caused by accidental implicit conversion from error_code enum values to batt::Status.
-
0.19.2 (2022/12/16)
- Fixed test regression by updating the expected error status to match the boost::system::error_code value.
-
0.19.1 (2022/12/16)
- Added accurate translation of more boost::system::error_code values into batt::Status.
-
0.19.0 (2022/12/14)
- Added
batt::Latch<T>::set_error
to explicitly set the Latch to an error status for better readability. - Added new header batteries/async/fetch.hpp with:
batt::fetch_chunk
: blocking API for no-copy input streams with an async_fetch methodbatt::BasicScopedChunk<Stream>
: automatically calls consume on fetched data at scope exit
- Added
-
0.18.1 (2022/12/09)
- Added
batt::PinnablePtr<T>
.
- Added
-
0.18.0 (2022/12/07)
- Added
batt::Channel<T>::async_read
, along with unit tests for the async methods ofbatt::Channel<T>
.
- Added
-
0.17.1 (2022/12/02)
- Added
batt::Runtime::reset()
andbatt::Runtime::is_halted()
so that downstream libraries that use a Google Test global environment to start/stop batt::Runtime can restart the default thread pool, for GTEST_REPEAT/--gtest_repeat testing.
- Added
-
0.16.2 (2022/11/30)
- Fixed a broken link in the release notes.
-
0.16.1 (2022/11/30)
- Added release notes (this document) to the doc pages.
-
0.16.0 (2022/11/30)
- Added clamp min/max functions to batt::Watch, to atomically enforce upper/lower bounds on the watched value.