6177 Commits

Author SHA1 Message Date
John Wellbelove
faa4c15b49 Updated release notes 2026-07-09 10:06:17 +01:00
Roland Reichwein
1523e63e35
Support non-assignable alternatives in variant (#1496) 2026-07-08 19:48:33 +01:00
John Wellbelove
878a0ba5a2 Updated version and release notes 2026-07-08 11:08:02 +01:00
John Wellbelove
5287fe4b3b
Allow etl::vector to store pointers to functions and member functions (#1492)
* Refactored vector.h

Deleted ivectorpointer.h

* Minor changes

* Fixed code incompatible with C++03

* Clang-format changes

* Removed redundant double-qualified name

* Fixed is_is_object_pointer_v to is_object_pointer_v

* Added new test files to meson.build

* Added overflow checks to vector_ext copy and move constructors and assignments

Added assert throw tests.

* Added diagnostic pushes to eliminate GCC warning false positives

* Changed the GCC C++23 Github action to use GCC14

* Applied clang-format

* Added guard to pop_heap

* Added guard to adjust_heap

* Attempt to fix GCC diagnostic

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* clang-format

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Missing newline at end of file

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

Re-enable ranges algorithm tests

* Attempt to fix GCC diagnostic

* clang-format

* Changed gcc --version to gcc-14 --version

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-07-08 09:06:50 +01:00
Roland Reichwein
40dddd7f96
Add optional etl_profile label_flag for Bazel profile injection (#1491)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 23:41:17 +02:00
Roland Reichwein
84fca4cd62
Add missing memory functions, according the standard (#1490)
Adding:

- etl::align
- etl::assume_aligned
- etl::is_sufficiently_aligned
- etl::launder
- etl::pointer_traits
- etl::start_lifetime_as

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 20:45:47 +01:00
Roland Reichwein
dca6653b37
Add missing interfaces to etl::chrono (#1489)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 20:00:09 +01:00
Roland Reichwein
c52b2ac7b1
Fix etl::mem_cast cross-size copy constructor and assignment (#1488)
The templated cross-size copy constructor and assignment operator were
broken in two ways:

- They accessed other.buffer / rhs.buffer, which is private in a
  different mem_cast instantiation, so the cross-size overloads failed
  to compile whenever they were actually instantiated.
- They copied Size_ (the destination size) bytes from a source buffer
  that is only Other_Size bytes large, reading past the end of the
  source when the destination was larger.

Use the public data() accessor and copy Other_Size bytes. The existing
static_assert(Size >= Other_Size) guarantees the destination is big
enough.

Add test_mem_cast_copy_and_assign_from_smaller regression test.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 18:06:05 +02:00
Roland Reichwein
165674cb23
Fix etl::pearson::reset() not resetting the first-byte flag (#1487)
reset() cleared the hash array but left the `first` flag false, so a
calculator reused after reset() took the XOR update path on its next
add() instead of the initialisation path. This produced an incorrect
hash for any pearson object that was reset and reused.

Reset `first` to true in reset() so a reset calculator behaves like a
freshly constructed one.

Add test_pearson_reset regression test.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 16:41:50 +02:00
Roland Reichwein
032ec4cc80
Fix etl::bitset single-element from_string shift on empty string (#1486)
The single-element from_string overloads (char, wchar_t, char16_t,
char32_t) computed element_type(1) << (string_length - 1U) before the
copy loop. For an empty string, or when active_bits is 0, string_length
is 0, so the shift count underflows to SIZE_MAX. Shifting by more than
the element width is undefined behaviour, which also breaks constexpr
evaluation.

Guard the mask with a zero-length check so the shift is only performed
when string_length > 0. The multi-element from_string overloads were
already safe.

Add test_construct_from_empty_string regression test.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 12:40:04 +01:00
Roland Reichwein
98cb365d4c
Fix etl::histogram copy/move not preserving start_index (#1485)
The run-time-offset specialization of etl::histogram stores a start_index
member used to map keys to bins (accumulator[key - start_index]). Its copy
constructor, move constructor, copy assignment, and move assignment copied
only the accumulator and left start_index uninitialized, so a copied or
moved histogram indexed the wrong bin in operator[]/add(), causing
out-of-bounds access (undefined behavior).

All four special member functions now also copy start_index. The
compile-time-offset specialization is unaffected, as its start index is a
template constant rather than a data member.

Add regression tests covering copy/move construction and assignment.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-07-07 11:32:56 +01:00
Drew Rife
5cd2f28cd5
Refactor variant::emplace to perfect forward args instead of copy/move construct (#1494)
* refactor: emplace logic to use do_emplace for in-place construction with forwarded arguments #1493

* Add test for variant_variadic

---------

Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-07-07 09:14:48 +02:00
Roland Reichwein
a47c0aae81
Fix etl::message_timer firing following timers early on unregister (#1484)
active_list.remove(id, has_expired) adjusts the next timer's delta only
when has_expired is false. When unregistering an active, non-expired timer,
unregister_timer() incorrectly passed true, skipping that adjustment, so
every timer after the removed one in the active list fired early by the
removed timer's delta.

Pass false instead, matching the etl::callback_timer family. tick() still
passes true, since the timer has genuinely expired there. The bug affected
all four variants: message_timer, message_timer_interrupt,
message_timer_atomic and message_timer_locked. Existing tests missed it
because they only ever unregistered the tail timer, where the delta
adjustment is a no-op.

Add a regression test that unregisters a non-tail active timer and checks
the following timer still fires at its original absolute time.
2026-07-06 17:32:26 +02:00
John Wellbelove
ceb21914fb Updated release notes 20.48.0 2026-06-30 13:55:56 +01:00
John Wellbelove
5d4d6c7903 Merge branch 'master' of https://github.com/ETLCPP/etl 2026-06-30 13:50:49 +01:00
John Wellbelove
da87d97e3a Update README.md 2026-06-30 12:27:05 +01:00
John Wellbelove
f3028d22e4 Development release of 20.48.0 2026-06-30 11:33:30 +01:00
Sergei
96a111ecd9
Drop problematic T& emplace(const optional_impl& other) (#1478)
* Drop problematic `T& emplace(const optional_impl& other)`
- Ror both fundamental and non-fundamental specializations.
- This also fixes incorrect `return storage.u.value;` in the fundamental specializations.
- Simplify `emplace` overloads (drop SFINAE).
- Update test cases to:
  - verify returned reference
  - verify `nothrow`
- Add `emplace(std::initializer_list, ...)` overload for non-fundamental types.

* Fix clang-format

* Revert to idiomatic C++ `initializer_list` by-value.
2026-06-29 19:43:45 +01:00
Roland Reichwein
0663fc7078
Fix etl::unique_ptr::swap() for deleters (#1482)
* Fix etl::unique_ptr::swap() for deleters

Fixes https://github.com/ETLCPP/etl/issues/1481

* Fix etl::deque iterator swap()

Swap all members, not just the index.
2026-06-27 16:00:04 +01:00
John Wellbelove
5eed38e25a
Update README.md 2026-06-24 17:57:50 +01:00
Drew Rife
e6a7642121
Add constexpr support for delegate construction and assignment (#1476)
* feat: Add constexpr support for delegate construction and assignment in C++14 and C++20

* docs: add more docstring coverage #1473

* docs: note constexpr availability for function-pointer overloads

Update docs/callbacks/delegate.md to reflect the new ETL_CONSTEXPR14
annotations on delegate(function_ptr) and create(function_ptr), and add
a paragraph to the Constexpr section explaining which function-pointer
APIs are usable in constant expressions at C++14 vs C++20.

#1473

---------

Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-06-24 16:51:02 +01:00
Roland Reichwein
05010aebf8
Fix ranges (#1475)
* Fix etl::get to preserve reference members for tuple rvalues

The rvalue-qualified overloads of etl::get (both the index-based and
type-based forms) unconditionally applied etl::move to the stored
element. For a tuple holding a reference member (e.g. etl::tuple<int&>),
this cast the referenced object to an rvalue instead of returning the
stored lvalue reference, diverging from std::get and failing to compile
when the result was bound to a non-const lvalue reference.

Forward the element with static_cast<element_type&&> instead, so that
reference members collapse to an lvalue reference while value members are
still moved. This is required to support tuples of references such as
those produced by the zip, enumerate and adjacent views.

* Make ranges views return non-const references to make them mutable

* Support type-changing transform_view

* Fix join_with_iterator reference type to match operator*

join_with_iterator declared reference = inner_trait::reference (e.g. int&)
while operator* returns value_type by value. For prvalue-yielding inner
ranges (e.g. repeat_view from a type-changing transform) the declared
reference was inconsistent with the actual dereference. Derive value_type
from the inner iterator's dereference and set reference = value_type,
preserving by-value semantics.

Add regression test for transform|join_with with prvalue inner ranges.

* Make join_with conform to [range.join.with.iterator] using inner/pattern common reference

* Clang-format

* Fix owning_view const begin()/end() by making _r mutable so chunk_view compiles over rvalue ranges
2026-06-24 13:39:06 +01:00
Roland Reichwein
1d5e9ea67f
Remove file writing tests for etl::random (#1474)
Some ETL random tests write to files but don't CHECK() anything.

Since they are left at the file system and were only used during
development, they can be removed now.
2026-06-24 12:37:46 +01:00
Roland Reichwein
5e5012c62c
Format user defined types in format.h (#1470)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-06-24 11:27:53 +02:00
John Wellbelove
8f4373e555
Documentation updates (#1469)
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-23 18:12:58 +01:00
Roland Reichwein
d598337107
Fix code examples in documentation (#1471) 2026-06-23 18:11:17 +01:00
John Wellbelove
4e11bc9d54
SFTP the documentation to the website on push to master (#1468)
* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Workflow for deploying documentation

* Removed mention of 'SCP'

* Added final newline

* Removed old script

* Test alternative 'copy docs to website' job.

* Updated to burnett01/rsync-deployments@8.0.5 as 7.0.2 is deprecated

* Removed test branch from the 'push' list

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-23 18:04:26 +01:00
John Wellbelove
2dabc42cbb
Add etl::stable partition (#1466)
* Added two versions of etl::stable_partition

One is O(N) time , O(N) space
The other is O(Nlog(N)) time

* Added partition_move

* Updates to tests and documentation

* Review changes

* std::size -> sizeof

* etl::size -> ETL_OR_STL::size

* Changed index array typer to std::array

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-20 10:27:20 +01:00
John Wellbelove
55429eddd2
Only enable the assign and insert member functions for class ivector<… (#1467)
* Only enable the assign and insert member functions for class ivector<T*> & class ivector<const T*> when the value_type the iterator references is a pointer to T.

* Imporoved enable_if for assign and insert.

* clang-format

* std::void_t -> etl::void_t

* Made enable_if condition into a common class struct

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-20 10:26:03 +01:00
Roland Reichwein
04b7004110
Add emplace() to etl::map and further containers (#1462) 2026-06-20 10:57:06 +02:00
Timon Zijnge
6df8842a21
#1461 Invalid version detected with CMake FetchContent from URL (#1465)
* Bold project documentation link in README

* #1461 Invalid version detected when used with CMake FetchContent from URL
* Reject a .git dir that belongs to a parent project, e.g. when fetched as a URL tarball with no .git of its own
* Update documentation on including ETL in another project with CMake's FetchContent

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: tzijnge <someone@somewhere.com>
2026-06-18 11:29:38 +01:00
John Wellbelove
c6d17b3a8d
Fixes and additional metafunctions for etl::type_list (#1460)
* New metafunctions for type_list

* clang-format changes

* Corrections from review

* Removed commented out code

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-18 10:35:20 +01:00
Roland Reichwein
c32f9cc862
Fix using libc++ (#1463)
Before, libstdc++ was used in both gcc and clang builds.

Fix includes an adjustment to consider in NO_STL case.

Now build with libc++ in separate github workflows with clang.
2026-06-17 12:31:53 +01:00
Roland Reichwein
20cab32256
Make ipriority_queue non-sized base class (#1459)
* Fix iterator access algorithm.h

Move from operator[] access to operator+ and operator- to prevent
limited compatibility. This worked before for vector because of
iterators being ptrdiff_t (signed), but not for unsigned access
like size_t as in etl::queue.

* Make ipriority_queue non-sized base class

Fixes issue #1457

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-06-13 11:00:39 +02:00
Roland Reichwein
6d9ed143b2
Add etl::infinite_loop (#1458) 2026-06-12 08:04:24 +01:00
Christoph Rüthing
4f9618d8df
Make Constructors of Atomics for trivial Types constexpr (#1453)
* Bold project documentation link in README

* Add constexpr to trivial Atomics

According to https://en.cppreference.com/cpp/atomic/atomic/atomic the constructors of atomics should be constexpr. This change marks (at least for the trivial types) the constructor as constexpr.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-06-08 15:23:35 +01:00
John Wellbelove
1ca5bb012f
to string() does not handle floating point number with integer part exceeding max uint64 t (#1455)
* Added 'scientific' flag to basic_format_spec to allow forcing of scientific format for all floating point values.

* Forces floating point numbers that are larger than than the internal integral workspace types to be formatted in scientific format.

Also allows scientific format to be forced for all floating point output.
NAN and INF outputs now follow case settings, as does the new scientific exponent letter. 'e' or 'E'.

* treefmt changes

* Quick fixes

* Removed <format>

* Added tests for NAN and INF

Fixed result for -INF

* Added tests for upper and lower case scintific format.

* Changed incorrect stream header from <strstream> to <sstream>

* Update test_to_string.cpp

* Update test_to_u16string.cpp

* Update test_to_u32string.cpp

* Update test_to_u8string.cpp

* Update test_to_wstring.cpp

* clang-format updates

* clang-format updates

* Re-coded the precision calculation in add_floating_point_scientific to match add_floating_point_non_scientific

* Rename step 1

* Fix: rename docs/Messaging to docs/messaging

* Rename step 1

* Fix: rename docs/Messaging to docs/messaging

* Rename step 1

* Fix: rename docs/Messaging to docs/messaging

* Changed incorrect stream header from <strstream> to <sstream>

* Update test_to_string.cpp

* clang-format updates

# Conflicts:
#	test/test_to_string.cpp

* Remove old docs folder

* clang-format updates

# Conflicts:
#	test/test_to_string.cpp

* Re-commit missing file

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-08 14:16:52 +01:00
John Wellbelove
9b56ffe676 Fix: rename docs/Messaging to docs/messaging 2026-06-08 11:16:22 +01:00
John Wellbelove
b969b2c46c Rename step 1 2026-06-08 11:16:02 +01:00
John Wellbelove
b3ade470b0 Fix: rename docs/Messaging to docs/messaging 2026-06-08 11:05:31 +01:00
John Wellbelove
9907ab3b68 Rename step 1 2026-06-08 11:04:58 +01:00
John Wellbelove
12792e418f Fix: rename docs/Messaging to docs/messaging 2026-06-08 10:42:41 +01:00
John Wellbelove
f383184b0e Rename step 1 2026-06-08 10:42:10 +01:00
John Wellbelove
eed3d0b7b0
Hotfix/documentation updates (#1456)
* message_router and fsm documentation corrections

* message_router and fsm documentation corrections

* message_router and fsm documentation corrections

* Delete docs/Messaging/message-router.md

The folder is no longer valid.

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-06-08 08:58:47 +01:00
John Wellbelove
4a88884b39
Issue/add hugo support for documentation (#1449)
* Add ranges

* Initial Hugo setup

* Work in progress

* Added selection for local or remote site

* Updated to 'light' theme

* Changed to using Hextra Hugo theme

* Changed to using Hextra Hugo theme

* Changed to Hextra Hugo theme

* Change to Hextra Hugo theme

* Updated Hugo setup.

* Updated Hugo setup.

# Conflicts:
#	docs/releases/_index.md

* Work in progress

* Added new fonts

Added new documentation

* Latest documentation updates

* Latest documentation updates

# Conflicts:
#	docs/containers/array.md
#	docs/containers/array_view.md
#	docs/containers/array_wrapper.md
#	docs/containers/bip_buffer_spsc_atomic.md
#	docs/containers/bitset.md
#	docs/containers/indirect_vector.md
#	docs/containers/vector.md
#	docs/getting-started/compilers.md

* Added bloom_filter markdown doc

* Added more documentation

Updated CSS for light and dark modes

* Fixed some menus

Added mode documentation files

* Updated CSS rules

Added badges to home page
Added uniqur_ptr + pool tutorial

* Fixed formatting on the home page markdown

Modified light amd dark code formatting

* Updated unique_ptr-with-pool

* Added container and shared message tutorials

* Updates to documentation

* Added const_multimap

* Updated source-formatting.md

* Added initial raw text files form Web site editor

* Innore coverage build directory

* Exported raw text documentation files from the web site editor

* Hugo updates

* Added Hugo intalation and markdown descriptions

* More addition to the documentation

* Added closure.md and updates to delegate.md

* Added format.md

* Added documentation for etl::delegate_observable, etl::function, Base64 codec

* Added io_port documentation

* Added basic_format_spec

* Added documentation for string_stream and string utilities.

* Added more documentation

Updated the documentation CSS

* Added documentation for clocks, day, duration

* Added more documentation for chrono classes

Updated callouts

* More chrono documentation

* Completed chrono documentation

* Maths functions documentation

* Completed maths documentation

* Completed maths documentation

* Completed maths documentation

* Completed maths documentation

* Added multiple documentation files

* Added iterator.md

* Added debug_count.md and versions.md

* Added debug_count.md and versions.md

* Added more documentation

* More documentation

* Added some design pattern documentation

Modified some of the layout files
Modified the About documentation

* Converted more documentation pages

Modified the site CSS

* Added more documentation

Moced some documentation files to new directories

* Added more documentation

Tweaks to CSS

* Added callback_timer_deferred_locked documentation

* Added callback_timer_locked documentation

* More documentation updates

* More documentation updates

* More documentation updates

* New documentation files.

Harmonised file name format

* New documentation files.

* Multiple document updates

* Multiple document updates

* Final conversion of web pages

* Updates before PR

* Updates before PR

* Updates before PR

# Conflicts:
#	docs/blog/_index.md

* Final pre PR updates

* Updates to message framework documentation

* Renamed directory

* Fix spelling

* Added author and date to blog files

Moved documentation files merged from development

* Fixed 'Description' typo

* Fix typos

# Conflicts:
#	docs/IO/io_port.md
#	docs/containers/sets/const-multiset.md
#	docs/containers/sets/const-set.md
#	docs/maths/correlation.md
#	docs/maths/gamma.md

* Renamed two files to lower case

* Minor renaming

* Added author and date

* Updated callout on bresenham_line.md

Added support for showing the ETL version on the documentation first page, by copying the version.txt file as a hugo asset.
Updated the Python 'update_release.py' to copy 'version.txt'

* Replace space in filename with hyphen.

Added more information to hugo-commands.md

* Replace space in filename with hyphen.

Added more information to hugo-commands.md

# Conflicts:
#	docs/getting-started/view-the-docs-locally/hugo-commands.md

* Added a link to pseudo_moving_average.md

* Updated title pages for groups

* Fixed missing 404 for non-existent pages

* Fixed coordinate variable names in the 'Calculating the intersection' example

---------

Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
2026-06-06 13:12:44 +01:00
Roland Reichwein
42a21a92e8
Fix copy and move in signal.h (#1454)
* Fix copy and move in signal.h

* Delete copy and move in callback_service.h

The implicitly provided copy and move copied internal pointers
which are invalid after copying.

* Delete copy and move in delegate_service.h

The implicitly provided copy and move copied internal pointers
which are invalid after copying.
2026-06-04 22:34:59 +01:00
John Wellbelove
e379c13543 Merge branch 'serges147/master' into development
# Conflicts:
#	include/etl/intrusive_avl_tree.h
2026-06-01 11:34:59 +01:00
John Wellbelove
7e782b850d Added documentation deploy action to www.etlcpp.com 2026-06-01 11:32:10 +01:00
John Wellbelove
777fb0c199
Bold project documentation link in README 2026-06-01 10:14:41 +01:00
Roland Reichwein
8a782cc7f1
Add more constexpr to constructors (#1450)
* Add more constexpr to ctors

* Adjust operator!=() in fixed_iterator.h

Instead of taking an iterator by reference, take it by value as
done in the other operators and overloads.

* Initialize move_iterator() current member

Prevent indeterminate values

* Fix fixed_iterator::operator* return type

fixed_iterator::operator* returned value_type by value, so writes like *it = ...
modified a temporary rather than the underlying location. This broke the
iterator’s intended use (e.g., writing to a fixed register/memory location).
Now returning iterator_traits<TIterator>::reference instead (const and
non-const overloads).

* Fixed move_iterator::operator+= and operator-= return type

move_iterator::operator+= / operator-= returned by value, but RandomAccessIterator
requirements (and std::move_iterator) expect these to return move_iterator&.
Returning by value also added an unnecessary copy and could break generic code
expecting reference semantics.
2026-05-31 19:32:38 +01:00