2534 Commits

Author SHA1 Message Date
John Wellbelove
0d41528005 Added timer_node and timer_config docs
Added is_registered test to intrusive_timer
2026-10-26 23:31:51 +00:00
John Wellbelove
2aa0c4edb3 Fixed remove for timer_active_list
Moved time to nex notifications to inside the lock regions
Finished unit tests
2026-10-26 15:50:44 +00:00
John Wellbelove
f1d188e60c Updated tests
Modified node end() and 'time to next' notification callback
2026-10-25 10:55:24 +00:00
John Wellbelove
28ac16f035 Added next timer notifications 2026-10-23 18:42:35 +01:00
John Wellbelove
78bdd671fa Work in progress
test_intrusive_timer_one_shot not working yet
2026-10-23 13:08:10 +01:00
John Wellbelove
d04cc5c296 Work in progress
Timer list tests need a workaround for ownership issues.
2026-10-22 21:03:11 +01:00
John Wellbelove
b903d7759e Work in progress 2026-10-21 20:58:31 +01:00
John Wellbelove
024b2dd2c5 Work in progress 2026-10-21 18:48:15 +01:00
John Wellbelove
b9456c0b62 Work in progress 2026-10-20 20:07:29 +01:00
John Wellbelove
cf07fc69b5 Modified the timer config and node classes 2026-10-20 18:31:17 +01:00
John Wellbelove
fe1bc0b029 Initial code. Committed for reference 2026-10-20 10:36:59 +01:00
taltenbach
60ba92928e
Constrain variant value constructor to supported types (#1614)
* Add docs and tutorial for etl::intrusive_avl_tree (#1608)

* Add docs and tutorial for etl::intrusive_avl_tree

Documents the intrusive AVL tree added in PR #1425: a full API reference
page under Containers/Trees, and a tutorial demonstrating ordered access
to intrusively-linked objects with unpredictable lifetimes, including
move support and destructor-driven automatic removal from the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add complexity shortcode and document its usage

Introduces a {{< complexity >}} Hugo shortcode (with light/dark styling
for constant/logarithmic/linear/linearithmic/polynomial/exponential
classes) for rendering Big-O complexity inline, applies it throughout
the intrusive_avl_tree API reference in place of raw "O(...)" text, and
documents the Description/Complexity structure and supported classes in
DOCUMENTATION.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix issues found by @CodeRabbit

* Put complexity notes on their own lines in intrusive_avl_tree docs

Move the complexity shortcode from the inline "**Complexity:**" label
to its own line under a "**Complexity**" label. Notes that give several
alternatives (e.g. amortized vs. worst-case) now show each one on a
separate line. Update the guideline in DOCUMENTATION.md to match.

* Update complexity examples in DOCUMENTATION.md

Add the hard line break after the "**Complexity**" label in the
example, and rewrite the list of supported complexity classes in the
new two-line format, including an example with several alternatives.

* Add logarithmic complexity example to DOCUMENTATION.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Updated sponsors pages

* Refactor the documentation css to group styles for light and dark themes

* Update Codacy badge in README.md

Updated Codacy badge link to reflect new project status.

* Fix Codacy badge display

* Constrain variant value constructor to supported types

Previously, the implicit value constructor of etl::variant could
participate in overload resolution for unsupported types, potentially
causing ambiguous calls before the assertion was triggered.

The static_assert are replaced by enable_if constraints. Note the same
approach is applied to other constructors and methods for consistency.

---------

Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-14 14:07:47 +01:00
Roland Reichwein
ebd9a7026f
Make non STL builds independent of STL headers (#1621)
Fix etl::chrono floor/ceil/round/abs being declared in the wrong namespace

The duration overloads of floor, ceil, round and abs were defined in
namespace etl rather than etl::chrono, so qualified calls such as
etl::chrono::floor<seconds>(ms) only found the time_point overload and
failed to compile. Moved them into namespace chrono next to
duration_cast and removed the old etl-scope definitions, which also
fixes the unqualified calls made from time_point.h.

Fix comment about rounding behavior

Use cmath functions from std namespace

GCC 16 doesn't support them in the global namespace anymore.
2026-10-14 14:04:49 +01:00
John Wellbelove
4038d89b7a Fix missing closing 'fi' 2026-10-14 13:24:03 +01:00
Roland Reichwein
d87cbd37f4
Add future.h (#1618) 2026-10-13 12:42:15 +02:00
fhgffy
41bfe65dda
Fix callbacks for Boolean byte-stream writes (#1615)
* Add docs and tutorial for etl::intrusive_avl_tree (#1608)

* Add docs and tutorial for etl::intrusive_avl_tree

Documents the intrusive AVL tree added in PR #1425: a full API reference
page under Containers/Trees, and a tutorial demonstrating ordered access
to intrusively-linked objects with unpredictable lifetimes, including
move support and destructor-driven automatic removal from the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add complexity shortcode and document its usage

Introduces a {{< complexity >}} Hugo shortcode (with light/dark styling
for constant/logarithmic/linear/linearithmic/polynomial/exponential
classes) for rendering Big-O complexity inline, applies it throughout
the intrusive_avl_tree API reference in place of raw "O(...)" text, and
documents the Description/Complexity structure and supported classes in
DOCUMENTATION.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix issues found by @CodeRabbit

* Put complexity notes on their own lines in intrusive_avl_tree docs

Move the complexity shortcode from the inline "**Complexity:**" label
to its own line under a "**Complexity**" label. Notes that give several
alternatives (e.g. amortized vs. worst-case) now show each one on a
separate line. Update the guideline in DOCUMENTATION.md to match.

* Update complexity examples in DOCUMENTATION.md

Add the hard line break after the "**Complexity**" label in the
example, and rewrite the list of supported complexity classes in the
new two-line format, including an example with several alternatives.

* Add logarithmic complexity example to DOCUMENTATION.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Updated sponsors pages

* Refactor the documentation css to group styles for light and dark themes

* Update Codacy badge in README.md

Updated Codacy badge link to reflect new project status.

* Fix Codacy badge display

* Fix callbacks for Boolean byte-stream writes

Advance Boolean writes through the existing callback path and test checked
and unchecked writes, including rejected writes at full capacity.

---------

Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 18:42:06 +01:00
John Wellbelove
c98000a41a
Removed ETL_USE_TYPE_TRAITS_BUILTINS macro (#1616)
* Removed ETL_USE_TYPE_TRAITS_BUILTINS macro

* Added ETL_DISABLE_BUILTIN_FUNCTIONS to allow tests to to be run without using builtins

* clang-format updates

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 18:41:26 +01:00
Mike Bloom
45a1f58d7e
Deque check index operator (#1617)
* Add docs and tutorial for etl::intrusive_avl_tree (#1608)

* Add docs and tutorial for etl::intrusive_avl_tree

Documents the intrusive AVL tree added in PR #1425: a full API reference
page under Containers/Trees, and a tutorial demonstrating ordered access
to intrusively-linked objects with unpredictable lifetimes, including
move support and destructor-driven automatic removal from the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add complexity shortcode and document its usage

Introduces a {{< complexity >}} Hugo shortcode (with light/dark styling
for constant/logarithmic/linear/linearithmic/polynomial/exponential
classes) for rendering Big-O complexity inline, applies it throughout
the intrusive_avl_tree API reference in place of raw "O(...)" text, and
documents the Description/Complexity structure and supported classes in
DOCUMENTATION.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix issues found by @CodeRabbit

* Put complexity notes on their own lines in intrusive_avl_tree docs

Move the complexity shortcode from the inline "**Complexity:**" label
to its own line under a "**Complexity**" label. Notes that give several
alternatives (e.g. amortized vs. worst-case) now show each one on a
separate line. Update the guideline in DOCUMENTATION.md to match.

* Update complexity examples in DOCUMENTATION.md

Add the hard line break after the "**Complexity**" label in the
example, and rewrite the list of supported complexity classes in the
new two-line format, including an example with several alternatives.

* Add logarithmic complexity example to DOCUMENTATION.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Updated sponsors pages

* Refactor the documentation css to group styles for light and dark themes

* Update Codacy badge in README.md

Updated Codacy badge link to reflect new project status.

* Fix Codacy badge display

* refresh codacy integration status

* deque check index operator

* Revert format

* Update documentation

* Change word 'array' to 'deque'

* Add checked index for circular buffer

* Fix doc

---------

Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 18:40:56 +01:00
John Wellbelove
1bd1072303
Reduce the compiled code size for etl::variant (#1623)
* Replaced pointer table with a recursive visitor call to reduce compiled code size.

* Removed the 32 type limit for visitor and operator visits

Deleted variant_select_do_operator and variant_select_do_visitor headers

* Restored CMakeLists.txt

Applied clang-format

* Updated documentation

Added guards to 'single index' do_operator_at and do_visitor_at

* Unified 'if (Index == index())' order

* Merged new tests from PR #1625

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 18:40:19 +01:00
Wadi
18fb69edd4
Share one dispatch for variant assign and construct (#1620)
* Add docs and tutorial for etl::intrusive_avl_tree (#1608)

* Add docs and tutorial for etl::intrusive_avl_tree

Documents the intrusive AVL tree added in PR #1425: a full API reference
page under Containers/Trees, and a tutorial demonstrating ordered access
to intrusively-linked objects with unpredictable lifetimes, including
move support and destructor-driven automatic removal from the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add complexity shortcode and document its usage

Introduces a {{< complexity >}} Hugo shortcode (with light/dark styling
for constant/logarithmic/linear/linearithmic/polynomial/exponential
classes) for rendering Big-O complexity inline, applies it throughout
the intrusive_avl_tree API reference in place of raw "O(...)" text, and
documents the Description/Complexity structure and supported classes in
DOCUMENTATION.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix issues found by @CodeRabbit

* Put complexity notes on their own lines in intrusive_avl_tree docs

Move the complexity shortcode from the inline "**Complexity:**" label
to its own line under a "**Complexity**" label. Notes that give several
alternatives (e.g. amortized vs. worst-case) now show each one on a
separate line. Update the guideline in DOCUMENTATION.md to match.

* Update complexity examples in DOCUMENTATION.md

Add the hard line break after the "**Complexity**" label in the
example, and rewrite the list of supported complexity classes in the
new two-line format, including an example with several alternatives.

* Add logarithmic complexity example to DOCUMENTATION.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Updated sponsors pages

* Refactor the documentation css to group styles for light and dark themes

* Update Codacy badge in README.md

Updated Codacy badge link to reflect new project status.

* Fix Codacy badge display

* refresh codacy integration status

* Share one dispatch for variant assign and construct

Since #1514, variant copy and move assignment dispatched on the
alternative up to three times: assign when the indices match, otherwise
destroy and construct. Assigning or constructing the source alternative
now shares a single dispatch, which recovers about half of the flash
growth reported in #1619 while keeping the std::variant assignment
semantics.

Add tests for move assignment between alternatives, assignment between
alternatives on the trivially destructible path, destruction of the
previous alternative, and a throwing copy leaving the variant valueless.

---------

Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 14:35:20 +01:00
John Wellbelove
88c1b34411
Feature/to string float uses double math (#1610)
* Added overloaded etl::floor() and etl::ceil()

Added tests for float, double, long double

* Documented functions from math.h

* Added more math wrappers.

Move wrappers to clib namespace

* Cleanup of duplicated code.

* clang-format

* Code review updates

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-10-12 09:36:21 +01:00
John Wellbelove
a2da3ed940
Optimise cyclic value (#1607)
* Updated ignore for hard link for CLion

* Initial working version

* Optimised advance template call

* Further optimsed advance

Updated docs and tests

* Moved comparison operators out of the class.

* Implement spaceship operator <=> for No-STL case (#1604)

This was disabled explicitly in recent commit
232c948674cff1b4b72c2d6b3acfa7342d096dd1 to prevent using
the <compare> header from STL.

Now, re-enabling by implementing an ETL version of it in compare.h

* Sponsorship message updates

* Fix duplicated check runs

* Refactored the advance function to fix issues with signed unsigned mod operations.

* clang-format

* Updated documentation for cyclic_value

* Modified code comments

* Fixed a logic issue in advance() where a less than maximum step from the minimum value for a cyclic value covering the full type's range would take the wrong logical path (Step would roll over), although calculating the correct result.

This could be cofusing to someone debugging cyclc_value.

* Added runtime ans static asserts for reverse ordered limts.

* clang-format

* Spelling fix 'fast' -> 'last'

* Code review updates

* clang-format

* Code review updates

* Code review updates

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-10-09 17:39:04 +01:00
Roland Reichwein
b0548949df
Fix circular reference in callback_timer_* (#1611)
* Add docs and tutorial for etl::intrusive_avl_tree (#1608)

* Add docs and tutorial for etl::intrusive_avl_tree

Documents the intrusive AVL tree added in PR #1425: a full API reference
page under Containers/Trees, and a tutorial demonstrating ordered access
to intrusively-linked objects with unpredictable lifetimes, including
move support and destructor-driven automatic removal from the tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add complexity shortcode and document its usage

Introduces a {{< complexity >}} Hugo shortcode (with light/dark styling
for constant/logarithmic/linear/linearithmic/polynomial/exponential
classes) for rendering Big-O complexity inline, applies it throughout
the intrusive_avl_tree API reference in place of raw "O(...)" text, and
documents the Description/Complexity structure and supported classes in
DOCUMENTATION.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix issues found by @CodeRabbit

* Put complexity notes on their own lines in intrusive_avl_tree docs

Move the complexity shortcode from the inline "**Complexity:**" label
to its own line under a "**Complexity**" label. Notes that give several
alternatives (e.g. amortized vs. worst-case) now show each one on a
separate line. Update the guideline in DOCUMENTATION.md to match.

* Update complexity examples in DOCUMENTATION.md

Add the hard line break after the "**Complexity**" label in the
example, and rewrite the list of supported complexity classes in the
new two-line format, including an example with several alternatives.

* Add logarithmic complexity example to DOCUMENTATION.md

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>

* Updated sponsors pages

* Refactor the documentation css to group styles for light and dark themes

* Fix circular reference in callback_timer_*

Fixes #967

* Unify timer tick() ordering and detect duplicate inserts

Address review feedback on #1611.

Replace the is_active() guard with a consistent tick() ordering across
all timer controllers: a repeating timer is now reinserted before its
callback is invoked or its message is sent, matching etl::callback_timer.
A callback that restarts the timer then replaces the existing entry
instead of causing a second insert. Applied to message_timer_atomic,
message_timer_interrupt and message_timer_locked as well, which are
affected in the same way.

Reject an insert of a timer that is already in the active list, rather
than linking it to itself, and record that it happened. The regression
tests now assert duplicate_insert_detected() instead of relying on the
resulting circular reference hanging the test.

---------

Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-09-30 08:27:23 +01:00
Roland Reichwein
7e328341ae
Add be_uint24_t etc. to unaligned_type.h (#1592)
* Add be_uint24_t etc. to unaligned_type.h

A typical use case is to endian convert 24, 40, 48 bits etc.

This change generalizes the pre-existing types in unaligned_type.h
to those odd sizes.

* Add documentation for odd sized unaligned_type specializations
2026-09-30 08:26:46 +01:00
Drew Rife
d9a9488582
Add referenced clamped values with shared ranges (#1597)
* Support runtime floating-point clamped_value before C++20

* Add referenced clamped values with shared ranges
2026-09-26 10:45:48 +01:00
Roland Reichwein
2e2c5d0199
Implement spaceship operator <=> for No-STL case (#1604)
This was disabled explicitly in recent commit
232c948674cff1b4b72c2d6b3acfa7342d096dd1 to prevent using
the <compare> header from STL.

Now, re-enabling by implementing an ETL version of it in compare.h
2026-09-17 12:38:18 +02:00
Marco Nilsson
eb793d2b82
Help the compiler optimize unaligned_type. (#1598)
* Help the compiler optimize unaligned_type.

This fixes a regression in 266b0f99 when the type was made constexpr. When
switching to a loop to construct the value the compiler was unable to detect
what was going on. We now unroll the loop at compile time into what's
essentially a hand rolled shift and OR operation which the compiler detects
and replaces with a byte swap. Tested on gcc (x86+arm) and clang (x86).

Introduce a static value_from which can be used to convert a value from an
existing buffer. There were previously three options for this, all bad or
awkward in different ways:

- val = etl::be_uint32_t(address)
Copies to temporary storage.

- val = *reinterpret_cast<const etl::be_uint32_t*>(address);
Unreadable.

- etl::be_uint32_t::copy_store_to_value(address, output);
Requires an output parameter.

The new addition is:
- val = etl::be_uint32_t::value_from(address);

Additionally, update the documentation with value_from and the missing,
existing constructors.

* Please clang-format.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-09-13 10:33:42 +01:00
Hossein
232c948674
Exclude operator <=> from chrono when STL not available (#1602)
* Exclude operator <=> from chrono when STL not available

* apply the fix to tests

* chore: rerun pipeline
2026-09-12 10:22:39 +01:00
Drew Rife
ffea27142a
Support runtime floating-point clamped_value before C++20 (#1595) 2026-09-08 19:45:31 +01:00
John Wellbelove
2696828f27 Updated release notes
Removed redundant ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) from clamped_value.h
2026-09-08 15:37:23 +01:00
Drew Rife
11623e6862
Implement clamped_value utility (#1565)
* feat: add clamped_value utility

* style: format clamped_value include list

* feat: enhance clamped_value with runtime bounds and comparison operators and DRY up the implementation

* refactor: call set in runtime ctor

instead of duplicated the clamping logic

* Add C++20 floating-point clamped_value support

* Document and stress clamped_value edge cases

* Change ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) to ETL_NOEXCEPT

* Change ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) to ETL_NOEXCEPT

* Revert changes

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-09-08 10:21:33 +01:00
Marco Nilsson
d06cd9f303
Allow expected to be constructed from a convertible value or expected (#1587) 2026-09-07 16:23:20 +02:00
John Wellbelove
75c07eca54
Absolute and casting updates (#1583) 2026-09-03 14:38:51 +02:00
Björn Schäpers
a547336322
Set default compare for iconst_map (#1560)
This is consistent with (i)flat_map, and allows to just write iconst_map<K, V>.

Add tests, also fix iconst_set.
2026-09-03 13:27:56 +02:00
Roland Reichwein
e25a44195c
Fix size type of string_view (#1586)
Fixes #1577

Rename variables to align to snake_case convention
2026-09-03 12:36:00 +02:00
Roland Reichwein
ed5219283b
Detect builtins (#1581)
Even without ETL_USE_TYPE_TRAITS_BUILTINS in the profile, we get
compiler builtins detected. Makes detection more consistent now.

Previously, some type trait builtins were detected automatically,
and some others needed to be activated via ETL_USE_TYPE_TRAITS_BUILTINS
in the profile explicitly.

Replaces: #1174

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-09-02 08:58:40 +01:00
Roland Reichwein
c896d2d7dd
Support variable number of arguments to inject at runtime (#1580)
Further, switching internal member from array_view to span to
be closer to standard, and more constexpr friendly.

Also adjusting to C++11 template syntax.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-09-01 19:16:24 +01:00
Roland Reichwein
06e54f6b23
Add missing type traits (#1573)
etl::is_scoped_enum
etl::is_trivially_default_constructible
etl::is_trivially_move_constructible
etl::is_trivially_move_assignable
etl::is_trivially_assignable
etl::is_layout_compatible
etl::is_pointer_interconvertible_base_of

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-08-31 19:09:16 +01:00
Roland Reichwein
fa238db580
Fix sanitizer builds (#1579)
Besides, remove unused ASAN_OPTIONS from github workflows.

Further, activate sanitizers for C++23 workflows, at the places
where we also activated -O3 optimization. Not activating everywhere
for CI efficiency reasons for now.

Note that the sanitizers are activated on clang C++23 workflows
only, since there is a remaining issue with GCC in delegate_cpp11.
2026-08-31 19:08:25 +01:00
Roland Reichwein
fe4db13587
Make etl::variant trivially copyable (#1574) 2026-08-28 12:49:01 +02:00
Sergei
49a9ebde78
Fixed building and unit tests run under XCode 2027 Beta 6 (#1572)
* Update _index.md

* Update _index.md

* Cherry pick the Docker fixes for PowerPC (#1563)

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>

* Fixed building and unit tests run under XCode 2027 Beta 6 (AppleClang 21.0.0.21000333):
- Compilation failures:
  - `etl::ideque::iterator::operator[]` index type should be `difference_type` (instead of `size_t`).
  - random-access `etl::poly_span::iterator` is missing `operator[]`.
- Unit tests failures of `test_multimap` suit:
  - fixed `equal_range`-related tests to properly verify result range (via new `Check_Equal` overload helper).
  - fixed `find`-related tests to not depend on particular order of `second` values (via new `Check_ContainsPair` helper). See note 1,2) at [cppreference](https://cppreference.com/cpp/container/multimap/find) about order.

* PR review fixes.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-08-28 10:21:00 +01:00
Roland Reichwein
74a95cf360
For optional monadic operations, add docs, tests, and complete type (#1568) 2026-08-27 13:17:43 +02:00
Roland Reichwein
c6c1ee1b28
Add missing etl::ranges::distance overload (#1569)
* Update _index.md

* Update _index.md

* Cherry pick the Docker fixes for PowerPC (#1563)

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>

* Add missing etl::ranges::distance overload

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-08-26 20:16:54 +01:00
davmf
f7520ad0bd
Topic/optional monadic operations (#1501)
* Topic/optional monadic operations

* topic/optional-monadic-operations:
	- added and_then, or_else, and transform to etl::optional with unit tests
	- added is_optional to optional.h, used in and_then and or_else to ensure that the returned type is an optional
	- implemented as ref-qualified overloads with C++11 compatible trailing return types, following the etl::expected implementation

* Convert to C++11 style type traits

* Coderabbit changes

Constrain transform before forming etl::optional<U>.
Remove references from monadic result types.

* clang-format updates

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-08-25 09:29:01 +01:00
Roland Reichwein
01a07a1728
Fix guards in array.h and test/test_array.h (#1566)
Follow-up for https://github.com/ETLCPP/etl/pull/1553 where this
change was intended but missed
2026-08-24 15:16:17 +02:00
Roland Reichwein
fa3ac28f55
Add etl::is_standard_layout and other type traits according to std (#1545)
* Update _index.md

* Update _index.md

* Cherry pick the Docker fixes for PowerPC (#1563)

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>

* Add etl::is_standard_layout and further type traits

Added type traits:

* etl::is_standard_layout
* etl::is_null_pointer
* etl::is_union
* etl::is_scalar
* etl::is_empty
* etl::is_polymorphic
* etl::is_abstract
* etl::is_final
* etl::is_aggregate
* etl::is_destructible
* etl::is_nothrow_destructible
* etl::has_virtual_destructor
* etl::is_swappable
* etl::is_swappable_with
* etl::is_nothrow_swappable
* etl::is_nothrow_swappable_with
* etl::has_unique_object_representation
* etl::is_bounded_array
* etl::is_unbounded_array
* etl::is_trivial

Document etl::is_pod

Note that etl::swap needed adjustment to enable nothrow detection via
SFINAE constraints. This change closes in to the standard.

* Fix preprocessor directive formatting in header

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
2026-08-24 13:11:11 +01:00
rleigh-electradx
25e2d6e8a3
Adopt the Library Fundamentals TS make_array design for the sequence factories (#1553)
* Adopt the Library Fundamentals TS make_array design for the sequence factories

make_array, make_deque, make_vector, make_list, make_forward_list and
make_indirect_vector now follow the Library Fundamentals TS
std::experimental::make_array design: a defaulted leading template
parameter selects the element type explicitly, falling back to the
decayed common type of the arguments when it is not supplied. A shared
trait (etl::private_make::element_type) performs the selection lazily,
so common_type is not instantiated when the element type is explicit.

This fixes the explicit-element-type calling style for the four
common-type factories, where make_vector<char>(lvalue) never compiled:
the explicit argument pinned the first pack parameter to char, making
it a char&& that no lvalue can bind to. It also gives make_array and
make_deque the deduced form (e.g. make_array(1, 2L) is array<long, 2>)
for free. All arguments are converted with static_cast, as in the
make_array const-lvalue fix, so const-qualified lvalues and narrowing
initialisers work in both forms.

Intentional behaviour change: an explicit element type now converts
every argument instead of pinning only the first. make_vector<char>(0,
1, ...) previously produced vector<int> - the explicit char affected
only the first argument and the element type was still the common type
- and now produces vector<char>. test_make_vector documented the old
behaviour and has been updated.

The keyed set and map factories are unchanged: their key/mapped types
are separate mandatory template parameters ahead of a fully-deduced
pack, so the explicit-type style already works, and retrofitting
deduction there would interact with the defaulted comparator/hash
parameters.

Adds explicit-element-type tests for the four common-type factories
(const/non-const lvalues plus narrowing initialisers) and
deduced-element-type tests for make_array and make_deque, and updates
the four documented signatures.

* Address review comments on the make_xxx factory design

- Forward same-type arguments in the make_xxx factories instead of
  casting them. static_cast produced a prvalue that, before C++17, had
  to be materialised through the move constructor, rejecting
  copyable-but-non-movable element types. The new
  private_make::convert helper forwards arguments that already have
  the element type and static_casts the rest.
- Drop ETL_NOEXCEPT from make_array: conversions can throw, and the
  other factories do not declare it.
- Remove the redundant etl::decay in element_type<void, ...>;
  etl::common_type already decays its arguments.
- Stop leaking the etl::private_make implementation namespace into the
  documented factory signatures.

* Add a test for make_array with an explicit element type and no arguments

etl::make_array<int>() produces an empty etl::array<int, 0> and now has
a regression test. A call with neither an element type nor arguments
remains ill-formed, matching the Library Fundamentals TS: there is
nothing to deduce the element type from. The array documentation now
states this explicitly.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
2026-08-24 08:53:25 +01:00
Drew Rife
ffd64f374b
circular_buffer: add initialization and assignment overloads (#1556)
* feat(circular_buffer): add initialization and assignment overloads

* fix(circular_buffer): handle self-referential assignment

* docs: document constructors and assign methods

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-08-22 20:10:38 +01:00
Mike Bloom
1a72c88d47
string_view: clamp n in remove_prefix and remove_suffix (#1513)
* remove_prefix, premove_suffix, clamp n to size()

* Add function documentation

* Add ETL_ASSERT

* Remove ETL_NOEXCEPT_IF

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-08-22 20:09:07 +01:00
Roland Reichwein
22fc884d45
Various cleanup (#1562)
* Fix wrong templating

* Fix stray double parens

* Documentation cleanup: Some key/value actually are value only
2026-08-22 17:47:16 +02:00