The primary etl::iterator_traits template previously required all five
nested typedefs (iterator_category, value_type, difference_type,
pointer, reference) to exist, causing hard compilation errors with
iterators like std::common_iterator or ranges::common_iterator.
Changes:
1. Make primary template SFINAE-friendly: split into an empty primary
template and a void_t-guarded partial specialization that only
activates when all nested typedefs are present.
2. Add explicit std::common_iterator specialization (C++20/STL): a
partial specialization that delegates to
std::iterator_traits<std::common_iterator<I,S>>.
3. Fall through to std::iterator_traits: the empty primary template
inherits from std::iterator_traits<TIterator> when building with
STL and C++20, so any iterator with a std::iterator_traits
specialization works automatically.
4. Remove iterator_traits dependency from etl::vector: assign() now
uses decltype(*first) for the type-compatibility static assert,
and insert() uses ptrdiff_t directly instead of querying
iterator_traits<TIterator>::difference_type.
format.h:
- Fix float zero-padding ({:010f}): output sign first, then zero-fill,
then the unsigned formatted value, matching std::format behavior.
- Fix nested replacement fields ({:{}d}): consume the value's auto-index
in parse_format_spec before parsing nested width/precision fields, so
auto-indexing order matches the C++ standard.
- Fix {:#o} with value 0: produce "0" instead of "00" by skipping the
octal prefix when the value is zero.
- Fix format_floating_default overflow for extreme doubles (DBL_MIN,
DBL_MAX): fall back to scientific notation for values >= 1e18 or
tiny positives < 1e-6, delegating to format_floating_e.
- Fix format_floating_e precision loss: replace iterative multiply-by-10
normalization loop with O(1) log10/pow/floor computation.
- Add resolve_nested_replacements helper to extract width/precision
from format args at formatting time.
test_format.cpp:
- Add tests for float zero-padding, nested replacement width, octal
alternate form with zero, float sign/width/alignment, negative floats,
scientific notation for large/small values, default-to-scientific
switch, positive zero, brace escaping, and integer limits.
format.h + platform.h:
- log10l fix for different toolchain support:
Define ETL_FORMAT_NO_LONG_DOUBLE_MATH in the profile if libm doesn't
provide log10l. This is identified by linker error missing this symbol.
It was identified with the llvm/clang cross toolchain for ARM.
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* added Pico and additional Teensy defines
* fix format
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: SamHalvoe <SamHalvoe@users.noreply.github.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Add test/run-clang-tidy.sh
Also, add .clang-tidy configuration file.
In test/syntax_check/CMakeLists.txt, make ETL headers non-system headers.
Added .github/workflow/clang-tidy.yaml. Does not break the build for now
on clang-tidy findings/warnings.
Fix syntax issues
Those issues were uncovered by making ETL headers
non-system headers in test/syntax_checks/CMakeLists.txt
* Fix macro syntax
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Fix the case of using STL without pthreads but with mutexes
On non-POSIX targets in STL mode, std::mutex is included from
mutex.h but will probably miss pthreads. Instead, other
implementations might be detected and used in mutex.h.
Therefore, adding ETL_NO_STD_MUTEX as a profile option for ETL.
Further, removing unnecessary includes from queue headers.
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Apply the rule of zero for `etl::optional` type.
Correct move behavior of `TestDataM` - it should preserve `valid` value.
Implemented overloads of `etl::make_optional` free function.
Extend optional moveable tests
- fundamental vs non-fundamental
- move construct/assign from valueless
- Verify nothrow of `etl::swap` for `etl::optional`.
* coderabbitai review fixes.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Removing private class members, code unused by ETL in "private"
namespaces, code unreachable via preprocessor guards (C++11 inside
C++03).
For code still to be kept, even though unused at first sight, add
tests.
Ubuntu 26.04 is not available in github workflows directly and won't be soon.
But ubuntu-26.04 is available as docker container. So use it for running
C++26 workflows which were disabled previously.
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Remove unused reinstall-cmake.sh
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Activate -O3 in CI builds for C++23
For good coverage of potential warnings triggered by -O3, activate
it for:
* .github/workflows/clang-c++23.yml
* .github/workflows/gcc-c++23.yml
So additionally necessary CPU resources are limited.
* Use Ubuntu-24.04 to test C++23
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Add concept invocable and further missing concepts to concepts.h
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Keep comparison and swap free functions out of the global namespace and
let ADL do its thing.
* Apply the same global to etl namespace move on overlooked functions
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Add begin() and end() to etl::expected
* Adding error_or() to etl::expected
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Fix missing tuple_size
In case of certain clang versions, a wrong combination of activated
and deactivated template forward declarations and specializations
were provided.
This led to redefinition errors and specialization errors.
Now aligning those combinations, and providing definitions from
<utility> from std in the STL using case.
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Swap can be part of the etl namespace and let ADL do its thing
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix operator| conflict with std::ranges (#1395)
* Move operators for etl::unique_ptr to etl namespace
This is in accordance with the operators of std::unique_ptr. Also,
it doesn't pollute the global namespace, and also works together
with ADL, finding the operators in the etl namespace now.
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>