* 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>
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.
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* Fix is_swappable for MSVC in C++14
* MSVC 19.44, Debug build, C++20 specific format adjustment
* 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
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* 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>
* 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
* 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>
* Simplify noexcept containing ETL_NOT_USING_EXCEPTIONS
* Revert some format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
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
* 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>
* 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>
Dispatch only the argument types which are actually stated. For everything
else, don't generate the code anymore.
Detemplatize parse_format_spec().
Collapse long double and double to double on targets where they are
same size. This helps prevent duplicate code generation.