* Print test names at test time (#1343)
* Fix initializer_list use in algorithm.h
Needs to be conditional.
* Move definition of data() in iterator.h
Needs to be defined earlier.
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* Print test names at test time (#1343)
* Rename 'leaf' to 'child' in intrusive_links.h
Recent versions of the Tasking TriCore compiler treat
'leaf' as a reserved C++ keyword, causing compilation failures in ETL.
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Maksim Danilov <maksim.danilov@accenture.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Previously, generator code under include/etl/generators needed to be
synchronized with the generated files under include/etl explicitly.
Leading to errors in the CI checks if forgotten.
This change separates out the generated parts to cpp03 specific
snippets. This way, most code under include/etl is now directly editable,
with only some pre-C++11 code separated out to
include/etl/generators/*_cpp03_generator.h which still needs to be
re-generated on respective changes. But in many cases, this is not necessary.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Remove python3-cogapp from Dockerfile
Removed python3-cogapp from the Dockerfile installation.
* Update .devcontainer/Dockerfile
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Change base image and update Python package installation
* Change container to use cpp devcontainer version 2
* Point to specific version of the devcontainer
* Update devcontainer to use debian snapshot for reproducability
* Fetch sources via https
* Make devcontainer more robust for debian_snapshot
* Make fetch non-https for snapshot
* Install CMake from apt
* Update devcontainers to remove CMake version
* Change Clang version from 22 to 21
* Apply suggestion from @rolandreichweinbmw
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix compilation with -Wsign-conversion
For tests with GCC and Clang
Fixes https://github.com/ETLCPP/etl/issues/632
* Fix support of negative Id in type_lookup.h: type_from_id
* Fix element access arithmetic in atomic_gcc_sync.h fetch_add/fetch_sub
* Fix rounded_integral_division.h: divide_round_half_odd(): direction is always 1
* Add a inplace_function constructor with a nullptr argument
* Add unit test for nullptr construction
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* add bounds and empty checks to containers
* address code rabbit review
* correct C++11 constexpr error
* rename new constexpr macro and make it global
* rename queue specializations' exceptions
* change front() implementation in locked queue specializations
* refactor usage of CONSTEXPR and NO_EXCEPT
* expand intrusive queue tests
* introduce lock guards on locked queues
* Print test names at test time (#1343)
* revert mutex and return changes on locking queues
* finish reverting the locked queues
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Bug fixes in variant_variadic.h
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix namespace issue of floor/round in to_string_helper
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Restrict etl::atomic for general types
Needs adding is_copy_assignable and is_move_assignable, and
adjustments to is_trivially_copyable and is_assignable
* Resolve mutable T value vs. volatile qualified methods
* Remove volatile method overloads
They are deprecated in C++20 because they don't work as users expect anyway.
MSVC hinted for this.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add ranges
* Print test names at test time (#1343)
* Fix conflit commit errors
* Cast return value of operator* to value_type
Fixed warning on VS2022
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Mark uninitialized use from std library
Similar to other cases, adds compiler pragmas against warnings
caused by std library in optimized builds of tests
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* manchester
* Added manchester code and test
* manchester
* Formatting and added missing file
* manchester
* Some functions can only be constexpr since C++14
* manchester
* Manchester decode and some refactoring
* manchester
* Added some missing typenames
* manchester
* constexpr void function not allowed in C++11
* manchester
* condition on static_assert tests
* manchester
* revert CMakeLists.txt
* Using ETL_STATIC_ASSERT
* Some cleanup
* manchester
* Added static_assert message
* manchester
* Added compile time tests
* manchester
* Added invert manchester
* Some refactoring
* manchester
* Disable test for now
* Move ETL_NODISCARD before static
* manchester
* Test for valid_span
* manchester
* Remove redundant (?) storage specifiers for template specializations. Storage specifier already given in base template
* manchester
* refactoring to get rid of specialized template functions in template class
* manchester
* cleanup
* manchester
* Added documentation comments
* Some refactoring
* manchester
* introducing namespace detail_manchester
* manchester
* Some refactoring
* Update tests
* manchester
* Some refactoring
* Removed possible undefined behavior by refactoring encode_span
* constexpr version of encode_span
* Static assertion for rare case where code doesn't work because CHAR_BIT is not the same as the number of bits in uint_least8_t
* manchester
* renamed valid to is_valid
* manchester
* renamed is_valid_span to is_valid
* Using etl exceptions in ETL_ASSERT
* manchester
* Removed _fast functions
* merged encode_in_place with encode and decode_in_place with decode
* removed _span to create normal overloads of encode and decode for span
* Some renaming and minor refactoring
* manchester
* Fix build issues
* manchester
* Conditionally compile manchester_decoded
* Update test_manchester.cpp
Removed redundant semicolon
* #1258 Manchester coding
* Formatting
* consistency: hex literals with lower case 0x
* #1258 Manchester coding
* Moved copyright to top of file
* Make constexpr encode/decode span functions equal for little and big endian platforms
* #1258 Manchester coding
* Added missing include
* Added missing 8bit/64bit guards
* Fixed is_valid for big endian platforms
* #1258 Manchester coding
* private memcpy alias
* #1258 Manchester coding
* Review comments
* #1258 Manchester coding
* Cleanup
* Fix build error
* #1258 Manchester coding
* Add manchester documentation
* #1258 Manchester coding
* Preparation for GitHub pages
* #1324 Manchester documentation
* Some small fixes
* Print test names at test time (#1343)
* IGN-280 biphasic amplitude as float
* Add big-endian devcontainer
* manchester
* fixed the configuration to work with GitHub Codespaces. The changes use cross-compilation with QEMU emulation instead of trying to use a native s390x container.
* manchester
* Made manchester work for big-endian
* Some updates to the container
* Manchester big-endian support
* Cleanup
* Manchester big-endian support
* add sourcedirectory
* Enable running with ctest
* Manchester big-endian support
* Update documentation
* Manchester big-endian support
* QA
* Manchester big-endian support
* QA
* Enable testing with ctest with cross-compiler (#5)
* Enable testing with ctest and with cross-compiler
* Clean up includes in manchester.h
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
* Print test names at test time (#1343)
* Adjustments in tuple.h from review
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix ETL_HAS_CONSTEXPR_ENDIANESS in unaligned_type.h
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix etl::optional for deleted copy constructors
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix span size type
size() returned a signed value while declared (unsigned) size_t.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Limit clock duration to milliseconds type on narrow int type
On AVR, for 16 bit int types, nano and micro are not provided.
Now, consistently use them only conditionally.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Add permutation functions
* Refactor permutation to use etl::less
* Add test for next_permutation where begin == end
* Update code to avoid multiple bind1st objects in loop
* Remove duplicate is_partitioned test case
Removed the duplicate is_partitioned test case from the test suite.
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Print test names at test time (#1343)
* Fix comment in queue::pop
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Added missing files from VS2022 project
* Added global data() overloads to complement etl::size()
* Added C++03 compatible implementation of etl::is_convertible
* Updated etl::span to more closely align with std::span
* Fix etl::rotate (#1327)
Per the C++ standard, std::rotate returns first + (last - middle):
* When first == middle, return last
* When middle == last, return first
* Fix greater_equal and less_equal (#1331)
* Align comparison operators (#1330)
In functional.h, the comparison operators for equal_to and not_equal_to
mismatch between the actual comparison execution and the type inference
for the return type. This change adjusts it by using the same operator==()
in the return type inference as used in the comparison execution.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add missing tests (#1321)
* Add missing tests
* Typo fixes
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add ETL_FORMAT_NO_FLOATING_POINT control macro for etl::format (#1329)
When ETL_FORMAT_NO_FLOATING_POINT is defined, all floating-point formatting support (float, double, long double) is excluded from etl::format. This reduces code size on targets that do not require floating-point formatting.
Guarded sections:
- #include <cmath>
- float/double/long double in supported_format_types variant
- float/double/long double constructors in basic_format_arg
- format_floating_* functions and format_aligned_floating
- formatter<float>, formatter<double>, formatter<long double>
- Floating-point test cases in test_format.cpp
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
# Conflicts:
# include/etl/platform.h
* Manchester documentation (#1325)
* manchester
* Added manchester code and test
* manchester
* Formatting and added missing file
* manchester
* Some functions can only be constexpr since C++14
* manchester
* Manchester decode and some refactoring
* manchester
* Added some missing typenames
* manchester
* constexpr void function not allowed in C++11
* manchester
* condition on static_assert tests
* manchester
* revert CMakeLists.txt
* Using ETL_STATIC_ASSERT
* Some cleanup
* manchester
* Added static_assert message
* manchester
* Added compile time tests
* manchester
* Added invert manchester
* Some refactoring
* manchester
* Disable test for now
* Move ETL_NODISCARD before static
* manchester
* Test for valid_span
* manchester
* Remove redundant (?) storage specifiers for template specializations. Storage specifier already given in base template
* manchester
* refactoring to get rid of specialized template functions in template class
* manchester
* cleanup
* manchester
* Added documentation comments
* Some refactoring
* manchester
* introducing namespace detail_manchester
* manchester
* Some refactoring
* Update tests
* manchester
* Some refactoring
* Removed possible undefined behavior by refactoring encode_span
* constexpr version of encode_span
* Static assertion for rare case where code doesn't work because CHAR_BIT is not the same as the number of bits in uint_least8_t
* manchester
* renamed valid to is_valid
* manchester
* renamed is_valid_span to is_valid
* Using etl exceptions in ETL_ASSERT
* manchester
* Removed _fast functions
* merged encode_in_place with encode and decode_in_place with decode
* removed _span to create normal overloads of encode and decode for span
* Some renaming and minor refactoring
* manchester
* Fix build issues
* manchester
* Conditionally compile manchester_decoded
* Update test_manchester.cpp
Removed redundant semicolon
* #1258 Manchester coding
* Formatting
* consistency: hex literals with lower case 0x
* #1258 Manchester coding
* Moved copyright to top of file
* Make constexpr encode/decode span functions equal for little and big endian platforms
* #1258 Manchester coding
* Added missing include
* Added missing 8bit/64bit guards
* Fixed is_valid for big endian platforms
* #1258 Manchester coding
* private memcpy alias
* #1258 Manchester coding
* Review comments
* #1258 Manchester coding
* Cleanup
* Fix build error
* #1258 Manchester coding
* Add manchester documentation
* #1258 Manchester coding
* Preparation for GitHub pages
* #1324 Manchester documentation
* Some small fixes
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
* Moved and split has_size_and_data in span.h to has_size & has_data in type_traits.h
* Removed has_size_and_data traits, and move to type_traits.h
Added ETL_ASSERT for for fixed extent constructors from iterator range and begin/size
* Added macro ETL_NOEXCEPT_IF that takes a compile time boolean expression
* Changed two fixed span constructors to ETL_CONSTEXPR14 due to ETL_ASSERT in the constructor bodies
Added ETL_NOEXCEPT_IF for simpler boolean conditions
Added tests for construction from mismatched sizes
* Added definition for ETL_NOEXCEPT_IF in no C++11 path
* Changes to disable construction from rvalue temporaries
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Niu Zhihong <zhihong@nzhnb.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: Timon Zijnge <47081647+tzijnge@users.noreply.github.com>
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
* Updated message handling to be worst case O(logN)
* Copied optimised message handling from etl::fsm
* Updated fsm generator
* Updated message_router generator
* Added optimised accepts() member function
* Modified comment, as the FSM doesn't support a successor
* Updated version and release notes
* Hotfix/etl multiset iterator invalidation during erase leads to incorrect sorted order in depth first traversal (#1317)
* Fixed issue for both multiset and multimap
* Added std::is_sorted checks to all map/set tests
* Updated with coderabbit suggestions
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* Updated release notes and version
* Changed std::is_same to etl::is_same in struct type_list_is_unique (#1320)
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* Updated release notes and version
* Fix etl::rotate (#1327)
Per the C++ standard, std::rotate returns first + (last - middle):
* When first == middle, return last
* When middle == last, return first
* Added missing files from VS2022 project
* Fix greater_equal and less_equal (#1331)
* Align comparison operators (#1330)
In functional.h, the comparison operators for equal_to and not_equal_to
mismatch between the actual comparison execution and the type inference
for the return type. This change adjusts it by using the same operator==()
in the return type inference as used in the comparison execution.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add missing tests (#1321)
* Add missing tests
* Typo fixes
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add ETL_FORMAT_NO_FLOATING_POINT control macro for etl::format (#1329)
When ETL_FORMAT_NO_FLOATING_POINT is defined, all floating-point formatting support (float, double, long double) is excluded from etl::format. This reduces code size on targets that do not require floating-point formatting.
Guarded sections:
- #include <cmath>
- float/double/long double in supported_format_types variant
- float/double/long double constructors in basic_format_arg
- format_floating_* functions and format_aligned_floating
- formatter<float>, formatter<double>, formatter<long double>
- Floating-point test cases in test_format.cpp
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Manchester documentation (#1325)
* manchester
* Added manchester code and test
* manchester
* Formatting and added missing file
* manchester
* Some functions can only be constexpr since C++14
* manchester
* Manchester decode and some refactoring
* manchester
* Added some missing typenames
* manchester
* constexpr void function not allowed in C++11
* manchester
* condition on static_assert tests
* manchester
* revert CMakeLists.txt
* Using ETL_STATIC_ASSERT
* Some cleanup
* manchester
* Added static_assert message
* manchester
* Added compile time tests
* manchester
* Added invert manchester
* Some refactoring
* manchester
* Disable test for now
* Move ETL_NODISCARD before static
* manchester
* Test for valid_span
* manchester
* Remove redundant (?) storage specifiers for template specializations. Storage specifier already given in base template
* manchester
* refactoring to get rid of specialized template functions in template class
* manchester
* cleanup
* manchester
* Added documentation comments
* Some refactoring
* manchester
* introducing namespace detail_manchester
* manchester
* Some refactoring
* Update tests
* manchester
* Some refactoring
* Removed possible undefined behavior by refactoring encode_span
* constexpr version of encode_span
* Static assertion for rare case where code doesn't work because CHAR_BIT is not the same as the number of bits in uint_least8_t
* manchester
* renamed valid to is_valid
* manchester
* renamed is_valid_span to is_valid
* Using etl exceptions in ETL_ASSERT
* manchester
* Removed _fast functions
* merged encode_in_place with encode and decode_in_place with decode
* removed _span to create normal overloads of encode and decode for span
* Some renaming and minor refactoring
* manchester
* Fix build issues
* manchester
* Conditionally compile manchester_decoded
* Update test_manchester.cpp
Removed redundant semicolon
* #1258 Manchester coding
* Formatting
* consistency: hex literals with lower case 0x
* #1258 Manchester coding
* Moved copyright to top of file
* Make constexpr encode/decode span functions equal for little and big endian platforms
* #1258 Manchester coding
* Added missing include
* Added missing 8bit/64bit guards
* Fixed is_valid for big endian platforms
* #1258 Manchester coding
* private memcpy alias
* #1258 Manchester coding
* Review comments
* #1258 Manchester coding
* Cleanup
* Fix build error
* #1258 Manchester coding
* Add manchester documentation
* #1258 Manchester coding
* Preparation for GitHub pages
* #1324 Manchester documentation
* Some small fixes
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
* Changes from review of algorithm.h on development branch (#1340)
* Add missing constexpr in algorithm.h
* Fix call of nth_element
2nd argument (nth) was missing
* Replace partition point with O(log(N)) algorithm
The C++ standard defines O(log(N)) calls of predicate as the
complexity of partition_point(). The old algorithm was linear.
* Use predicate in calculation of is_permutation consistently
In case of predicate not equal_to, the calculation previously
returned wron results
* Omit swap in selection_sort if iterators are equal
* Use difference_type in rotate_general() instead of int
* Typo fix in algorithm.h
* Simplifications in algorithm.h
Application of plain refactoring by keeping semantics
* Guard against past-end iterator in etl::rotate()
And fix scope of rotate_right_by_one for etl::rotate()
* Support empty ranges in selection_sort
* Add tests for swap_ranges
* Add tests for binary_search
* Add tests for find_end
* Add tests for accumulate
* Add tests for move_s
* Added tests for is_heap and sort_heap
* Remove early exit for empty input
* Add adjacent_find
* Add unique
* Add unique_copy
* Add merge
* Add inplace_merge
* Add partial_sort
* Add partial_sort_copy
* copilot review change
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Niu Zhihong <zhihong@nzhnb.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: Timon Zijnge <47081647+tzijnge@users.noreply.github.com>
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
absolute_unsigned() already handled that case correctly. Now adding this
check to absolute() also. It can be caught at compile time now, if in a
constexpr context. Also separating integral and non-integral versions
via enable_if.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add missing constexpr in algorithm.h
* Fix call of nth_element
2nd argument (nth) was missing
* Replace partition point with O(log(N)) algorithm
The C++ standard defines O(log(N)) calls of predicate as the
complexity of partition_point(). The old algorithm was linear.
* Use predicate in calculation of is_permutation consistently
In case of predicate not equal_to, the calculation previously
returned wron results
* Omit swap in selection_sort if iterators are equal
* Use difference_type in rotate_general() instead of int
* Typo fix in algorithm.h
* Simplifications in algorithm.h
Application of plain refactoring by keeping semantics
* Guard against past-end iterator in etl::rotate()
And fix scope of rotate_right_by_one for etl::rotate()
* Support empty ranges in selection_sort
* Add tests for swap_ranges
* Add tests for binary_search
* Add tests for find_end
* Add tests for accumulate
* Add tests for move_s
* Added tests for is_heap and sort_heap
* Remove early exit for empty input
* Add adjacent_find
* Add unique
* Add unique_copy
* Add merge
* Add inplace_merge
* Add partial_sort
* Add partial_sort_copy
* manchester
* Added manchester code and test
* manchester
* Formatting and added missing file
* manchester
* Some functions can only be constexpr since C++14
* manchester
* Manchester decode and some refactoring
* manchester
* Added some missing typenames
* manchester
* constexpr void function not allowed in C++11
* manchester
* condition on static_assert tests
* manchester
* revert CMakeLists.txt
* Using ETL_STATIC_ASSERT
* Some cleanup
* manchester
* Added static_assert message
* manchester
* Added compile time tests
* manchester
* Added invert manchester
* Some refactoring
* manchester
* Disable test for now
* Move ETL_NODISCARD before static
* manchester
* Test for valid_span
* manchester
* Remove redundant (?) storage specifiers for template specializations. Storage specifier already given in base template
* manchester
* refactoring to get rid of specialized template functions in template class
* manchester
* cleanup
* manchester
* Added documentation comments
* Some refactoring
* manchester
* introducing namespace detail_manchester
* manchester
* Some refactoring
* Update tests
* manchester
* Some refactoring
* Removed possible undefined behavior by refactoring encode_span
* constexpr version of encode_span
* Static assertion for rare case where code doesn't work because CHAR_BIT is not the same as the number of bits in uint_least8_t
* manchester
* renamed valid to is_valid
* manchester
* renamed is_valid_span to is_valid
* Using etl exceptions in ETL_ASSERT
* manchester
* Removed _fast functions
* merged encode_in_place with encode and decode_in_place with decode
* removed _span to create normal overloads of encode and decode for span
* Some renaming and minor refactoring
* manchester
* Fix build issues
* manchester
* Conditionally compile manchester_decoded
* Update test_manchester.cpp
Removed redundant semicolon
* #1258 Manchester coding
* Formatting
* consistency: hex literals with lower case 0x
* #1258 Manchester coding
* Moved copyright to top of file
* Make constexpr encode/decode span functions equal for little and big endian platforms
* #1258 Manchester coding
* Added missing include
* Added missing 8bit/64bit guards
* Fixed is_valid for big endian platforms
* #1258 Manchester coding
* private memcpy alias
* #1258 Manchester coding
* Review comments
* #1258 Manchester coding
* Cleanup
* Fix build error
* #1258 Manchester coding
* Add manchester documentation
* #1258 Manchester coding
* Preparation for GitHub pages
* #1324 Manchester documentation
* Some small fixes
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
When ETL_FORMAT_NO_FLOATING_POINT is defined, all floating-point formatting support (float, double, long double) is excluded from etl::format. This reduces code size on targets that do not require floating-point formatting.
Guarded sections:
- #include <cmath>
- float/double/long double in supported_format_types variant
- float/double/long double constructors in basic_format_arg
- format_floating_* functions and format_aligned_floating
- formatter<float>, formatter<double>, formatter<long double>
- Floating-point test cases in test_format.cpp
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
In functional.h, the comparison operators for equal_to and not_equal_to
mismatch between the actual comparison execution and the type inference
for the return type. This change adjusts it by using the same operator==()
in the return type inference as used in the comparison execution.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fixed issue for both multiset and multimap
* Added std::is_sorted checks to all map/set tests
* Updated with coderabbit suggestions
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* manchester
* Added manchester code and test
* manchester
* Formatting and added missing file
* manchester
* Some functions can only be constexpr since C++14
* manchester
* Manchester decode and some refactoring
* manchester
* Added some missing typenames
* manchester
* constexpr void function not allowed in C++11
* manchester
* condition on static_assert tests
* manchester
* revert CMakeLists.txt
* Using ETL_STATIC_ASSERT
* Some cleanup
* manchester
* Added static_assert message
* manchester
* Added compile time tests
* manchester
* Added invert manchester
* Some refactoring
* manchester
* Disable test for now
* Move ETL_NODISCARD before static
* manchester
* Test for valid_span
* manchester
* Remove redundant (?) storage specifiers for template specializations. Storage specifier already given in base template
* manchester
* refactoring to get rid of specialized template functions in template class
* manchester
* cleanup
* manchester
* Added documentation comments
* Some refactoring
* manchester
* introducing namespace detail_manchester
* manchester
* Some refactoring
* Update tests
* manchester
* Some refactoring
* Removed possible undefined behavior by refactoring encode_span
* constexpr version of encode_span
* Static assertion for rare case where code doesn't work because CHAR_BIT is not the same as the number of bits in uint_least8_t
* manchester
* renamed valid to is_valid
* manchester
* renamed is_valid_span to is_valid
* Using etl exceptions in ETL_ASSERT
* manchester
* Removed _fast functions
* merged encode_in_place with encode and decode_in_place with decode
* removed _span to create normal overloads of encode and decode for span
* Some renaming and minor refactoring
* manchester
* Fix build issues
* manchester
* Conditionally compile manchester_decoded
* Update test_manchester.cpp
Removed redundant semicolon
* #1258 Manchester coding
* Formatting
* consistency: hex literals with lower case 0x
* #1258 Manchester coding
* Moved copyright to top of file
* Make constexpr encode/decode span functions equal for little and big endian platforms
* #1258 Manchester coding
* Added missing include
* Added missing 8bit/64bit guards
* Fixed is_valid for big endian platforms
* #1258 Manchester coding
* private memcpy alias
* #1258 Manchester coding
* Review comments
* #1258 Manchester coding
* Cleanup
* Fix build error
---------
Co-authored-by: Timon Zijnge <timon.zijnge@imec.nl>
* Added compare_message_id
* Added new C++11 and up message routing code using a sorted type_list
* Renamed compare_message)id to compare_message_id_less
* Added documenation for compare_message_id_less
Added static asserts for message type template parameters
* Added optimisation for contiguous message IDs
Added more Doxygen documentation
* Added etl::type_list_all_of, etl::type_list_any_of, and etl::type_list_none_of
* Added etl::type_list_is_unique
* Added common definitions to all router types
* Added static_asserts to check message types
* Added etl::type_list to etl::nth_type
* Added missing 'typename' to type_list nth_type
* Added type_list_is_empty
* indentation fix
* Renamed type_list_prepend & type_list_append to type_list_push_front & type_list_push_back respectively
* Added tests for make_index_sequence & make_index_sequence_with_offset
* Add more features to etl::type_list (#1307)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Added etl::type_list to etl::observer
* Added etl::type_list to etl::nth_type
* Added missing 'typename' to type_list nth_type
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added type_list definitions for nth_type and observer
* Added etl::type_list to etl::variant
* Updated comments
* Addedetl::type~_list to message_router, observer, visitor
# Conflicts:
# include/etl/observer.h
# test/vs2022/etl.vcxproj.filters
* Added member type_list type to tuple
* Work in progress
* Copy changes from other source
* Removed unused tests
* Fix iter_swap namespace
* Add type_list functionality to etl::variant using etl::variant_from_type_list
* Add type_list functionality to etl::message_packet using etl::message_packet_from_type_list
* Add type_list functionality to etl::message_router using etl::message_router_from_type_list
* Add type_list functionality to etl::observer using etl::observer_from_type_list
* Add type_list functionality to etl::tuple using etl::tuple_from_type_list
* Allow etl::make_index_sequence to be created from an etl::type_list
* Add type_list functionality to etl::visitor using etl::visitor_from_type_list
* Fix iter_swap namespace
* Allow creation of a message_packet with no message types
* Allow creation of a message_router with no message types
* Updated VS2022 project files
* Added missing test files CMakeLists.txt
* Fix C++03 compatibility
Fixed unused aregument warnings
* Synced message_packet generator to updated code
* Synced message_router generator to updated code
* Synced message_router generator to updated code
# Conflicts:
# include/etl/generators/message_router_generator.h
# include/etl/message_router.h
* Fixed missing zero message specialisation for <= C++14
* Fixed missing zero message specialisation for <= C++14
* Fix year_month arithmetic and correct chrono API behavior (#1257)
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Restore default constructor behavior for chrono calender
* Suppress warnings from std in optimized builds (#1259)
When testing with ./run-tests.sh 23 3 10, some warnings from
std surfaced which resulted in build errors.
* Add template deduction guide for span from vector (#1264)
* Create span from vector deduction
* Use ivector for deduction. Add vector_ext to test
* Add vector pointer to test
* Finish tests
* Initialize pdata_ext and others
* Document how to implement platform specifics (#1262)
Some interfaces need to be implemented in every project
or platform using the ETL:
* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::as_bytes for etl::span<const T> (#1266)
A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove some UB in test_vector_non_trivial.cpp (#1268)
Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Update C++26 deprecated constructs to ensure future standard compliance (#1267)
* Update C++26 deprecated constructs to ensure future standard compliance
I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.
* Some additional is_trivial related changes not found directly when compiling tests in C++26
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix return value of get_token_list (#1271)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::tuple template signature error in pair assignment operator (#1265)
* Fix etl::tuple template signature error in pair assignment operator
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator
* Added tests for etl::tuple assignment from pair
---------
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove advance() on static spans (#1281)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Remove advance() on static spans
Since the size of a static span is constant, we can't reasonably
advance() on it.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add missing includes (#1286)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add missing includes
Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Move comparison operators of etl::expected to namespace etl (#1287)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Move comparison operators of etl::expected to namespace etl
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Make typed_storage constructor constexpr (#1291)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Make typed_storage constructor constexpr
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add basic_format_arg constructor for ibasic_string (#1288)
* Allow string as format arg
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added test string escaped
* Add temporary string test
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* QR Code for Github
* Added etl::visitor_from_type_list
* accepts(id) for empty router passes on to a sucessor
* Fixed incorrect comment from 'tuple' to 'message_router'
* PR review changes
* PR review changes
* Fixed internal constexptr flag in message_packet
* Fixed unused variable in unti test
* Added new type_list features
Added make_index_sequence_with_offset
* Renamed type_list_select_from_sequence to type_list_select_from_index_sequence
* Replaced type_list_size<TTypeList>::value with TTypeList::size internally for better clarity.
* Added etl::type_list_remove, etl::type_list_remove_if, etl::type_list_unique, etl::type_list_pop_front, etl::type_list_pop_back
* Add ref-qualifiers to basic_format_spec (#1292)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* feat: use ref-qualifiers for basic_format_spec
Converted the l-value methods to ref-qualified and also added r-value ref-qualified methods.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add support for size_t and unsigned long to etl::format (#1290)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add support for size_t and unsigned long to etl::format
* Document list of supported types in etl::supported_format_types
* Add further types and tests for etl::format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Deduce underlying storage size when constructing string_ext from char[]. (#1269)
* Deduce underlying storage size when constructing string_ext from char[].
This removes the need for passing sizeof(storage) to the constructor.
* Add array constructors for the other string types.
- u16string_ext
- u32string_ext
- u8string_ext
- wstring_ext
* Add additional constructors to match existing API.
* Fix inconsistent test argument order.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Added etl::type_list_all_of, etl::type_list_any_of, and etl::type_list_none_of
* Added etl::type_list_is_unique
* Added type_list_is_empty
* indentation fix
* Fix merge error
* Renamed type_list_prepend & type_list_append to type_list_push_front & type_list_push_back respectively
* Added tests for make_index_sequence & make_index_sequence_with_offset
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Added etl::type_list_indices_of_type which create an etl::index_sequence of all of the indexes of a specified type in an etl::type_list
* Updated comments
* Resolve coderabbit review issues
Added index_sequence utility to support type_list utilities. Added additional index_sequence utilities for completeness
* Added etl::index_sequence_cat, etl::index_sequence_pop_front, etl::index_sequence_pop_back, etl::index_sequence_at
* Fix 'unused variable' error in index_sequence tests
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: Drew Rife <drew.rife95@gmail.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
* Moved O(1)/O(logN) index search test to get_dispatch_index_from_message_id
Updated message_router generator
* Fixed C++03 compatibilty
* Replaced is_base_of with is_message
* Missing 'return' in chrono example
* Fixed doxygen comments
* Check message inherits from etl::message<>
* Copilot & coderabbit review changes
Check for no duplicated message IDs
Added diagnostic disable
Make Message_Id_Start an etl::message_id_t type
* Synchronised message_router_generator.h
* Modified the "All message IDs must be unique" static_assert to directly use the index_sequence of message IDs
Added addition index_sequence utilities to support this change.
* Changed Router1 definition to use unordered message ids to check message sorting in message_router
* Added has_message_id and compare_message_id_less to message.h
* Moved member type definitions to a traits class
message_packet, message_types, sorted_message_types
* Sync message_router_generator to changes
* Fixed C++03 compatibility
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: Drew Rife <drew.rife95@gmail.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
When a type occured multiple times in a variant, comparison operator
asserted before.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove call to initialise() in constructors.
The constructor execution flows were:
constructor
initialise()
assign()
append_impl()
initialise() does:
- Set current_size to 0
- Null terminate the buffer
- Clear truncation flag
append_impl() does:
- Assign truncation flag
- Set current size to source size
- Copy and null terminate the buffer
All the hard work done by initialise() is immediately overwritten. Removing the
call to initialise() saves 6-8 bytes of flash per constructor invocation when
targeting Cortex M33 with -Os.
* Avoid calling templated assign(iter, iter) with C strings.
Call the single pointer version of assign which ends up in the non-templated
append_impl. This calls the C lib's strlen and memmove rather than etl::strlen
which is a hand rolled loop.
This also reduces the risk of instantiating the iterator version of assign() if
it's not used elsewhere.
* Dispatch pointer iterators to non-template append_impl core.
When append_impl is called with pointer iterators (e.g. begin()/end()), SFINAE
routes them to a non-template core that takes a pointer and length. This
avoids duplicating the function body for each pointer type instantiation,
reducing flash usage on ARM Cortex-M by ~836 bytes at -Os.
* Revert make_string changes.
The original implementation used a bounded strlen which avoided OOB array access.
* Treat start, free_space and count as size_t to avoid casts.
* Ensure that append start is within the buffer.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Added etl::type_list to etl::observer
* Added etl::type_list to etl::nth_type
* Added missing 'typename' to type_list nth_type
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added type_list definitions for nth_type and observer
* Added etl::type_list to etl::variant
* Updated comments
* Addedetl::type~_list to message_router, observer, visitor
# Conflicts:
# include/etl/observer.h
# test/vs2022/etl.vcxproj.filters
* Added member type_list type to tuple
* Work in progress
* Copy changes from other source
* Removed unused tests
* Fix iter_swap namespace
* Add type_list functionality to etl::variant using etl::variant_from_type_list
* Add type_list functionality to etl::message_packet using etl::message_packet_from_type_list
* Add type_list functionality to etl::message_router using etl::message_router_from_type_list
* Add type_list functionality to etl::observer using etl::observer_from_type_list
* Add type_list functionality to etl::tuple using etl::tuple_from_type_list
* Allow etl::make_index_sequence to be created from an etl::type_list
* Add type_list functionality to etl::visitor using etl::visitor_from_type_list
* Fix iter_swap namespace
* Allow creation of a message_packet with no message types
* Allow creation of a message_router with no message types
* Updated VS2022 project files
* Added missing test files CMakeLists.txt
* Fix C++03 compatibility
Fixed unused aregument warnings
* Synced message_packet generator to updated code
* Synced message_router generator to updated code
* Synced message_router generator to updated code
# Conflicts:
# include/etl/generators/message_router_generator.h
# include/etl/message_router.h
* Fixed missing zero message specialisation for <= C++14
* Fixed missing zero message specialisation for <= C++14
* Fix year_month arithmetic and correct chrono API behavior (#1257)
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Restore default constructor behavior for chrono calender
* Suppress warnings from std in optimized builds (#1259)
When testing with ./run-tests.sh 23 3 10, some warnings from
std surfaced which resulted in build errors.
* Add template deduction guide for span from vector (#1264)
* Create span from vector deduction
* Use ivector for deduction. Add vector_ext to test
* Add vector pointer to test
* Finish tests
* Initialize pdata_ext and others
* Document how to implement platform specifics (#1262)
Some interfaces need to be implemented in every project
or platform using the ETL:
* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::as_bytes for etl::span<const T> (#1266)
A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove some UB in test_vector_non_trivial.cpp (#1268)
Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Update C++26 deprecated constructs to ensure future standard compliance (#1267)
* Update C++26 deprecated constructs to ensure future standard compliance
I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.
* Some additional is_trivial related changes not found directly when compiling tests in C++26
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix return value of get_token_list (#1271)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::tuple template signature error in pair assignment operator (#1265)
* Fix etl::tuple template signature error in pair assignment operator
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator
* Added tests for etl::tuple assignment from pair
---------
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove advance() on static spans (#1281)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Remove advance() on static spans
Since the size of a static span is constant, we can't reasonably
advance() on it.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add missing includes (#1286)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add missing includes
Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Move comparison operators of etl::expected to namespace etl (#1287)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Move comparison operators of etl::expected to namespace etl
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Make typed_storage constructor constexpr (#1291)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Make typed_storage constructor constexpr
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add basic_format_arg constructor for ibasic_string (#1288)
* Allow string as format arg
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added test string escaped
* Add temporary string test
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* QR Code for Github
* Added etl::visitor_from_type_list
* accepts(id) for empty router passes on to a sucessor
* Fixed incorrect comment from 'tuple' to 'message_router'
* PR review changes
* PR review changes
* Fixed internal constexptr flag in message_packet
* Fixed unused variable in unti test
* Added new type_list features
Added make_index_sequence_with_offset
* Renamed type_list_select_from_sequence to type_list_select_from_index_sequence
* Replaced type_list_size<TTypeList>::value with TTypeList::size internally for better clarity.
* Added etl::type_list_remove, etl::type_list_remove_if, etl::type_list_unique, etl::type_list_pop_front, etl::type_list_pop_back
* Add ref-qualifiers to basic_format_spec (#1292)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* feat: use ref-qualifiers for basic_format_spec
Converted the l-value methods to ref-qualified and also added r-value ref-qualified methods.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add support for size_t and unsigned long to etl::format (#1290)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add support for size_t and unsigned long to etl::format
* Document list of supported types in etl::supported_format_types
* Add further types and tests for etl::format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Deduce underlying storage size when constructing string_ext from char[]. (#1269)
* Deduce underlying storage size when constructing string_ext from char[].
This removes the need for passing sizeof(storage) to the constructor.
* Add array constructors for the other string types.
- u16string_ext
- u32string_ext
- u8string_ext
- wstring_ext
* Add additional constructors to match existing API.
* Fix inconsistent test argument order.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Added etl::type_list_all_of, etl::type_list_any_of, and etl::type_list_none_of
* Added etl::type_list_is_unique
* Added type_list_is_empty
* indentation fix
* Fix merge error
* Renamed type_list_prepend & type_list_append to type_list_push_front & type_list_push_back respectively
* Added tests for make_index_sequence & make_index_sequence_with_offset
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Resolve coderabbit review issues
* Added etl::type_list_indices_of_type which create an etl::index_sequence of all of the indexes of a specified type in an etl::type_list
* Updated comments
* Resolve coderabbit review issues
Added index_sequence utility to support type_list utilities. Added additional index_sequence utilities for completeness
* Added etl::index_sequence_cat, etl::index_sequence_pop_front, etl::index_sequence_pop_back, etl::index_sequence_at
* Fix 'unused variable' error in index_sequence tests
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: Drew Rife <drew.rife95@gmail.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add constexpr to array comparison operators
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Added etl::type_list to etl::observer
* Added etl::type_list to etl::nth_type
* Added missing 'typename' to type_list nth_type
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added type_list definitions for nth_type and observer
* Added etl::type_list to etl::variant
* Updated comments
* Addedetl::type~_list to message_router, observer, visitor
# Conflicts:
# include/etl/observer.h
# test/vs2022/etl.vcxproj.filters
* Added member type_list type to tuple
* Work in progress
* Copy changes from other source
* Removed unused tests
* Fix iter_swap namespace
* Add type_list functionality to etl::variant using etl::variant_from_type_list
* Add type_list functionality to etl::message_packet using etl::message_packet_from_type_list
* Add type_list functionality to etl::message_router using etl::message_router_from_type_list
* Add type_list functionality to etl::observer using etl::observer_from_type_list
* Add type_list functionality to etl::tuple using etl::tuple_from_type_list
* Allow etl::make_index_sequence to be created from an etl::type_list
* Add type_list functionality to etl::visitor using etl::visitor_from_type_list
* Fix iter_swap namespace
* Allow creation of a message_packet with no message types
* Allow creation of a message_router with no message types
* Updated VS2022 project files
* Added missing test files CMakeLists.txt
* Fix C++03 compatibility
Fixed unused aregument warnings
* Synced message_packet generator to updated code
* Synced message_router generator to updated code
* Synced message_router generator to updated code
# Conflicts:
# include/etl/generators/message_router_generator.h
# include/etl/message_router.h
* Fixed missing zero message specialisation for <= C++14
* Fixed missing zero message specialisation for <= C++14
* Fix year_month arithmetic and correct chrono API behavior (#1257)
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Restore default constructor behavior for chrono calender
* Suppress warnings from std in optimized builds (#1259)
When testing with ./run-tests.sh 23 3 10, some warnings from
std surfaced which resulted in build errors.
* Add template deduction guide for span from vector (#1264)
* Create span from vector deduction
* Use ivector for deduction. Add vector_ext to test
* Add vector pointer to test
* Finish tests
* Initialize pdata_ext and others
* Document how to implement platform specifics (#1262)
Some interfaces need to be implemented in every project
or platform using the ETL:
* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::as_bytes for etl::span<const T> (#1266)
A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove some UB in test_vector_non_trivial.cpp (#1268)
Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Update C++26 deprecated constructs to ensure future standard compliance (#1267)
* Update C++26 deprecated constructs to ensure future standard compliance
I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.
* Some additional is_trivial related changes not found directly when compiling tests in C++26
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix return value of get_token_list (#1271)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Fix etl::tuple template signature error in pair assignment operator (#1265)
* Fix etl::tuple template signature error in pair assignment operator
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator
* Added tests for etl::tuple assignment from pair
---------
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove advance() on static spans (#1281)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Remove advance() on static spans
Since the size of a static span is constant, we can't reasonably
advance() on it.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add missing includes (#1286)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add missing includes
Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Move comparison operators of etl::expected to namespace etl (#1287)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Move comparison operators of etl::expected to namespace etl
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Make typed_storage constructor constexpr (#1291)
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Make typed_storage constructor constexpr
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Add basic_format_arg constructor for ibasic_string (#1288)
* Allow string as format arg
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added test string escaped
* Add temporary string test
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* QR Code for Github
* Added etl::visitor_from_type_list
* accepts(id) for empty router passes on to a sucessor
* Fixed incorrect comment from 'tuple' to 'message_router'
* PR review changes
* PR review changes
* Fixed internal constexptr flag in message_packet
* Fixed unused variable in unti test
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Bo Rydberg <2945606+bolry@users.noreply.github.com>
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: Mike Bloom <91038685+mike919192@users.noreply.github.com>
Co-authored-by: taltenbach <92919739+taltenbach@users.noreply.github.com>
Co-authored-by: Bryton Flecker <fleckerbr@gmail.com>
Co-authored-by: Bryton Flecker <bflecker@swe.com>
* Fixed tree node rotate
Improved tree node rotate tests to test all links.
* Removed trailing whitespace
* Removed trailing whitespace
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
* Deduce underlying storage size when constructing string_ext from char[].
This removes the need for passing sizeof(storage) to the constructor.
* Add array constructors for the other string types.
- u16string_ext
- u32string_ext
- u8string_ext
- wstring_ext
* Add additional constructors to match existing API.
* Fix inconsistent test argument order.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add support for size_t and unsigned long to etl::format
* Document list of supported types in etl::supported_format_types
* Add further types and tests for etl::format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* feat: use ref-qualifiers for basic_format_spec
Converted the l-value methods to ref-qualified and also added r-value ref-qualified methods.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Deduce underlying storage size when constructing string_ext from char[].
This removes the need for passing sizeof(storage) to the constructor.
* Add array constructors for the other string types.
- u16string_ext
- u32string_ext
- u8string_ext
- wstring_ext
* Add additional constructors to match existing API.
* Fix inconsistent test argument order.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add support for size_t and unsigned long to etl::format
* Document list of supported types in etl::supported_format_types
* Add further types and tests for etl::format
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* feat: use ref-qualifiers for basic_format_spec
Converted the l-value methods to ref-qualified and also added r-value ref-qualified methods.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Allow string as format arg
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added test string escaped
* Add temporary string test
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Make typed_storage constructor constexpr
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Move comparison operators of etl::expected to namespace etl
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add missing includes
Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Remove advance() on static spans
Since the size of a static span is constant, we can't reasonably
advance() on it.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Fix etl::tuple template signature error in pair assignment operator
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator
* Added tests for etl::tuple assignment from pair
---------
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Update C++26 deprecated constructs to ensure future standard compliance
I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.
* Some additional is_trivial related changes not found directly when compiling tests in C++26
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Some interfaces need to be implemented in every project
or platform using the ETL:
* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Create span from vector deduction
* Use ivector for deduction. Add vector_ext to test
* Add vector pointer to test
* Finish tests
* Initialize pdata_ext and others
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Restore default constructor behavior for chrono calender
* Allow string as format arg
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Added test string escaped
* Add temporary string test
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Make typed_storage constructor constexpr
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Move comparison operators of etl::expected to namespace etl
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Add missing includes
Before this change, the includes needed to be done explicitly by
files using basic_string_stream.h, and be included first. This
was error prone, especially if includes are reordered (e.g. via
the currently defined clang-format rules).
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update CONTRIBUTING.md
Updated the instructions for contributing.
* Fix for issue 1276 "Data corruption in the etl::bip_buffer_spsc_atomic" (#1277)
* Reproduce data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Fix data corruption bug in the `etl::bip_buffer_spsc_atomic`.
* Remove advance() on static spans
Since the size of a static span is constant, we can't reasonably
advance() on it.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: Sergei <sergej.shirokov@gmail.com>
* Fix etl::tuple template signature error in pair assignment operator
* Remove AppVeyor build status badge
Removed AppVeyor build status badge from README.
* Update README.md
* Update etl::tuple to explicitly use etl::pair or std::pair in assignment operator
* Added tests for etl::tuple assignment from pair
---------
Co-authored-by: Bryton Flecker <bflecker@swe.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Update C++26 deprecated constructs to ensure future standard compliance
I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications.
* Some additional is_trivial related changes not found directly when compiling tests in C++26
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Some of the tests' UB are detectable by Gcc15 and thus give a compile error due to warnings-as-error flag.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
A missing 'const' in the etl::as_bytes implementation was causing a
compile-time error when etl::as_bytes was called on a span of const
values.
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Some interfaces need to be implemented in every project
or platform using the ETL:
* etl_get_high_resolution_clock
* etl_get_system_clock
* etl_get_steady_clock
* etl_putchar
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Create span from vector deduction
* Use ivector for deduction. Add vector_ext to test
* Add vector pointer to test
* Finish tests
* Initialize pdata_ext and others
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Fix & add more tests for year_month arithmetic
* Minor addtions to previous commit
* More missing values to be uninitialized
* Update the default constructors to = default and correct default constructor tests accordingly
* Restore default constructor behavior for chrono calender
* Imported inplace_function and invoke functionality from original branch
* Fixed spelling mistake
* Update test/CMakeLists.txt
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update test/test_inplace_function.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Moved member type function_ptr to private section
* Updated comments in inplace_function.h
* Updated action workflows to be triggered on a pull-request based on development branch
* Added suggested changes from PR reviews
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
* Make code base with tests compile under gcc-14
* Update buffer_descriptors.h
Following the same style as non-tests headers have. E.g., include/etl/intrusive_list.h & include/etl/intrusive_forward_list.h
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Check in indirect_vector::emplace_back if the vector is full, when push pop checks are requested
* Add extra checks to indirect_vector
* Fix emplace in indirect_vector not taking const_iterator
* Fix usage of ipool::create<T> in indirect_vector, so that there are no intermitten objects created
---------
Co-authored-by: Béla Iványi <bela.ivanyi@idata.hu>
* Synchronize on C++ 17 for "Windows - STL" and "Windows - No STL"
MSVC C++20 handles char* differently on iteration
* Add etl::format
This adds etl::format, guided by std::format, avoiding dynamic memory
allocation
* Spare more Resources for non-verbose Errors
At the moment we only remove the __FILE__ in case ETL_VERBOSE_ERRORS is
not set. However, we also want to remove the error text which can
consume quite some resources and without the file name the line number
is also not very useful.
* Introduce separate ETL_MINIMAL_ERRORS to keep backwards compatability
To not break runtime backwards compatability, instead of removing the
text in case of ETL_VERBOSE_ERRORS not defined, we introduce a second
flag ETL_MINIMAL_ERRORS which is mutually exclusive. The semantic is as
follows:
- ETL_VERBOSE_ERRORS: We use verbose text, file names and line numbers.
- ETL_MINIMAL_ERRORS: We do not use anything.
- ETL_VERBOSE_ERRORS and ETL_MINIMAL_ERRORS: Issue an error.
- non defined: We use terse text without file names nor line numbers.
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* topic/expected-monadic-operations:
- added and_then, or_else, transform, and transform_error with simple tests
* topic/expected-monadic-operation:
- added void TValue specialization operations
- updated unit tests to include expected<void, TError>
- added is_expected to expected.h, used in and_then to ensure that the returned type is an expected
* topic/expected-monadic-operations:
- made implementation c++11 compatible
* topic/expected-monadic-operations:
- started addressing coderabbit feedback
* topic/expected-monadic-operations:
- adapted invoke to etl
- reworked return type deduction
- filled in or_else unit tests to be more complete
- still need to add invoke unit tests
* topic/expected-monadic-operations:
-c++14 compliance
* topic/expected-monadic-operations:
- completed coderabbit suggestions
* topic/expected-monadic-operations:
- formatting in invoke and expected
- added test suite for invoke
* topic/expected-monadic-operations:
- fixed missing moves for const TValue&& and const TError&&
* topic/expected-monadic-operations:
- made everything c++11 compatible, very verbose as a result
* topic/expected-monadic-operations:
- fixed code rabbit rewivew for move semantics in const && overloads
* topic/expected-monadic-operations:
- moved around a move
* topic/expected-monadic-operations:
- added etl:: to invoke_result calls that were missing it
* topic/expected-monadic-operations:
- formatting
* topic/expected-monadic-operations:
- added invoke for void f() calls for consistency
* topic/expected-monadic-operations:
- reworked entire thing to be able to handle expected<T,E> to expected<void,E> without even more code duplication
* topic/expected-monadic-operations:
- added trailing return type to maintain c++11 compatibility
* topic/expected-monadic-operations:
- fixed mismatch between deduced type and return for a few functions
* topic/expected-monadic-operations:
- replaced calls to get<TError> and get<TValue> with get<Error_Type> and get<Value_Type>
---------
Co-authored-by: Jon Whitfield <jon@volumetrix.com>
* Add ability to derive etl::exception from std::exception
* Only add test for exception std base when using STL
* Use ETL_NOEXCEPT macro to define a function as noexcept
* Rename macro to keep in line with common style
* Add using_std_exception to etl::traits
---------
Co-authored-by: Béla Iványi <bela.ivanyi@idata.hu>
* Fix optimized tests by suppressing warning from STL
* Fix uninitialized buffer in hash for month_weekday
* Fix overlapping memcpy with memmove
* Fix random out of bounds index in __builtin_memmove
Suppressing compiler warning
* Fix array bounds warnings from static casts in message_router
In compiled code, casting to wrong message types is generated,
even though the code paths are supposed to be never taken due to runtime
msg id checks. Therefore, the warnings can be suppressed.
* Fix syntax errors in base64 decoder tests
* Fix test failure in test_rounded_integral_division.cpp when optimized
When building tests optimized, test_round_to_half_even_signed_limits
fails due to the fact that
etl::absolute(std::numeric_limits<int32_t>::min()) < 0
* Fix typo for remainder in rounded_integral_division.h
* Use etl::make_unsigned instead of std::make_unsigned
* Fix divide_round_half_down and divide_round_half_odd
* Fix typo for remainder in rounded_integral_division.h
* Use etl::make_unsigned instead of std::make_unsigned
* Fix divide_round_half_down and divide_round_half_odd
* Added mechanism to catch reentrant calls to methods that could change states in FSM/HFSM
* Added missing include for HFSM unit tests
* Fixed error text spacing
* Disabled move/copy semantics for reentrancy guard
* Updated FSM generator
* Made move semantics only available for C++11 and higher
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Previous changes were wrongfully made in fsm.h and type_traits.h
instead of in their generator counterparts.
Add CI check to ensure generated files are in sync.
* Add checks to vector and fix test failures
* Add tests to vector
* Add tests to external buffer and non trivial
* All tests should be implemented
* Add checks to vector_pointer and vector_pointer_ext
* Get bad iterators from a second vector
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Introduce Cast to void for Condition of Assert
Currently, in case we use a parameter of a function _only_ inside of an
ETL_ASSERT and the ETL configuration disables the ETL_ASSERT, we get a
compiler warning about an unused parameter. Therefore, this change casts
the condition of ETL_ASSERT to void.
* Use sizeof to avoid evaluation of Expression
In case we disable ASSERTs in e.g. non debug builds, we want to expand
it to "nothing", similar to how the std assert works. Introducing a cast
to void on the conidition would still evaluate it and potentially cause
side-effects. Therefore, we use the sizeof operator to ensure the
expression is not evaluated in case ASSERTs are disabled.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Allow easy Creation of Generic Exceptions with just a Text
Today when using ETL_ASSERT you need to pass a concrete exception type.
However, it can be quite unhandy to define a custom exception type for
each assert, therefore we want to also allow to simply use the generic
etl::exception type and directly provide the message.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Enforce Semicolon after ETL_ASSERT
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* debug assert POC
* Swith to ETL_CONSTEXPR14
* Finish TODO checks
* First and last can be equal
* Add ETL_DEBUG_THROW_EXCEPTIONS
* Try allowing c++11 constexpr
* Add macro for throwing from c++11 constexpr
* Remove braces
* Add extra asserts in size_t overload functions
* Fill out debug asserts
* Line up comments
* Regression fix: Support zero arguments emplace() in etl::optional (#1183)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Support zero arguments emplace() in etl::optional
For non-fundamental types, a recent change in etl::optional was
introduced that doesn't support zero arguments emplace() anymore.
This change fixes it and adds the respective test.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
* Fix etl::typed_storage by supporting omitted destructors (#1182)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Fix etl::typed_storage by supporting omitted destructors
In a recent change to alignment.h, the etl::typed_storage was
changed in a way that in case of an already constructed object,
the object is created via assignment.
However, this contradicts the original use case that led to
etl::typed_storage in the first place:
https://github.com/ETLCPP/etl/pull/1023
The goal is to omit destructors (and at the same time support
classes with deleted assignment operators), so they can be optimized out
at link time.
This change reverts commit ac7b268 to restore the original
functionality and changes the test to reflect the original
use case.
* Fix missing create() in non-C++11 typed_storage_ext constructor
* Typo fix
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* removed navis file from project
* Updated version and release notes
* Removed forced unsigned int cast in type_def bit-shift operators (#1178)
* Removed UB in type_def bit-shift operators
* Changed shift operators to allow both signed and unsigned operands for shifts
This allows the library user to explicitly use unsigned values to avoid UB
* Fixed constexpr errors for CPP11
* Changed is_arithmetic checks to use is_integral since valid shifts require integral operands
* Removed need for CPP11 since changes are CPP03 compatible
* Delete project navis files
* Add force CI check on piull requests
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Re architect the extra checks
* Add CHECK_EXTRA
* Fix newline at end of file
* The check index macro also needs to be defined to throw
* Remove ETL_VERBOSE_ERRORS macros
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: David Ockey <2897027+ockeydockey@users.noreply.github.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
* debug assert POC
* Swith to ETL_CONSTEXPR14
* Finish TODO checks
* First and last can be equal
* Add ETL_DEBUG_THROW_EXCEPTIONS
* Try allowing c++11 constexpr
* Add macro for throwing from c++11 constexpr
* Remove braces
* Add extra asserts in size_t overload functions
* Fill out debug asserts
* Line up comments
* Fixed ability to populate 16-bit strings with 8-bit data
* Added more unit tests
* Fixed C++11 build errors
* Changed testing to accommodate C++11 better
* Cleaned up comments
* Cleaned up tests to be more consistent
* Make template matches mutually exclusive to prevent ambiguous behavior
* Added changes to u32 and wchar strings
* Changed const range tests to use const string
* Added support for transitions on state enter for HFSM
* Fixed unit test build error
* Comment clean-up
* Changed FSM so that self-transitions can also transition "on enter"
* Fixing C++03 build error for clang
* Add checks to vector and fix test failures
* Add tests to vector
* Add tests to external buffer and non trivial
* All tests should be implemented
* Add checks to vector_pointer and vector_pointer_ext
* Get bad iterators from a second vector
* Add checks to vector and fix test failures
* Add tests to vector
* Add tests to external buffer and non trivial
* All tests should be implemented
* Add checks to vector_pointer and vector_pointer_ext
* Get bad iterators from a second vector
* Add checks to vector and fix test failures
* Add tests to vector
* Add tests to external buffer and non trivial
* All tests should be implemented
* Add checks to vector_pointer and vector_pointer_ext
* Get bad iterators from a second vector
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Introduce Cast to void for Condition of Assert
Currently, in case we use a parameter of a function _only_ inside of an
ETL_ASSERT and the ETL configuration disables the ETL_ASSERT, we get a
compiler warning about an unused parameter. Therefore, this change casts
the condition of ETL_ASSERT to void.
* Use sizeof to avoid evaluation of Expression
In case we disable ASSERTs in e.g. non debug builds, we want to expand
it to "nothing", similar to how the std assert works. Introducing a cast
to void on the conidition would still evaluate it and potentially cause
side-effects. Therefore, we use the sizeof operator to ensure the
expression is not evaluated in case ASSERTs are disabled.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Allow easy Creation of Generic Exceptions with just a Text
Today when using ETL_ASSERT you need to pass a concrete exception type.
However, it can be quite unhandy to define a custom exception type for
each assert, therefore we want to also allow to simply use the generic
etl::exception type and directly provide the message.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Enforce Semicolon after ETL_ASSERT
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Marco Nilsson <marco@zyax.se>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Regression fix: Support zero arguments emplace() in etl::optional (#1183)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Support zero arguments emplace() in etl::optional
For non-fundamental types, a recent change in etl::optional was
introduced that doesn't support zero arguments emplace() anymore.
This change fixes it and adds the respective test.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
* Fix etl::typed_storage by supporting omitted destructors (#1182)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Fix etl::typed_storage by supporting omitted destructors
In a recent change to alignment.h, the etl::typed_storage was
changed in a way that in case of an already constructed object,
the object is created via assignment.
However, this contradicts the original use case that led to
etl::typed_storage in the first place:
https://github.com/ETLCPP/etl/pull/1023
The goal is to omit destructors (and at the same time support
classes with deleted assignment operators), so they can be optimized out
at link time.
This change reverts commit ac7b268 to restore the original
functionality and changes the test to reflect the original
use case.
* Fix missing create() in non-C++11 typed_storage_ext constructor
* Typo fix
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* removed navis file from project
* Updated version and release notes
* Removed forced unsigned int cast in type_def bit-shift operators (#1178)
* Removed UB in type_def bit-shift operators
* Changed shift operators to allow both signed and unsigned operands for shifts
This allows the library user to explicitly use unsigned values to avoid UB
* Fixed constexpr errors for CPP11
* Changed is_arithmetic checks to use is_integral since valid shifts require integral operands
* Removed need for CPP11 since changes are CPP03 compatible
* Delete project navis files
* Add force CI check on piull requests
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Re architect the extra checks
* Add CHECK_EXTRA
* Fix newline at end of file
* The check index macro also needs to be defined to throw
* Remove ETL_VERBOSE_ERRORS macros
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: David Ockey <2897027+ockeydockey@users.noreply.github.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
* debug assert POC
* Swith to ETL_CONSTEXPR14
* Finish TODO checks
* First and last can be equal
* Add ETL_DEBUG_THROW_EXCEPTIONS
* Try allowing c++11 constexpr
* Add macro for throwing from c++11 constexpr
* Remove braces
* Add extra asserts in size_t overload functions
* Fill out debug asserts
* Line up comments
* Regression fix: Support zero arguments emplace() in etl::optional (#1183)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Support zero arguments emplace() in etl::optional
For non-fundamental types, a recent change in etl::optional was
introduced that doesn't support zero arguments emplace() anymore.
This change fixes it and adds the respective test.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
* Fix etl::typed_storage by supporting omitted destructors (#1182)
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Fix etl::typed_storage by supporting omitted destructors
In a recent change to alignment.h, the etl::typed_storage was
changed in a way that in case of an already constructed object,
the object is created via assignment.
However, this contradicts the original use case that led to
etl::typed_storage in the first place:
https://github.com/ETLCPP/etl/pull/1023
The goal is to omit destructors (and at the same time support
classes with deleted assignment operators), so they can be optimized out
at link time.
This change reverts commit ac7b268 to restore the original
functionality and changes the test to reflect the original
use case.
* Fix missing create() in non-C++11 typed_storage_ext constructor
* Typo fix
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* removed navis file from project
* Updated version and release notes
* Removed forced unsigned int cast in type_def bit-shift operators (#1178)
* Removed UB in type_def bit-shift operators
* Changed shift operators to allow both signed and unsigned operands for shifts
This allows the library user to explicitly use unsigned values to avoid UB
* Fixed constexpr errors for CPP11
* Changed is_arithmetic checks to use is_integral since valid shifts require integral operands
* Removed need for CPP11 since changes are CPP03 compatible
* Delete project navis files
* Add force CI check on piull requests
* Removed ETL_NOEXCEPT from delegate operator(), call_if(), and call_or()
Removed ETL_NOEXCEPT from closureoperator(), call_if(), and call_or()
* Updated version and release notes
* Updated version and release notes
* Remove noexcept from delegate method stubs. (#1185)
In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
* Updated version and release notes
* Re architect the extra checks
* Add CHECK_EXTRA
* Fix newline at end of file
* The check index macro also needs to be defined to throw
* Remove ETL_VERBOSE_ERRORS macros
---------
Co-authored-by: Roland Reichwein <Roland.Reichwein@bmw.de>
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: David Ockey <2897027+ockeydockey@users.noreply.github.com>
Co-authored-by: Marco Nilsson <marco@zyax.se>
* Guards around usage of std::initializer_list in optional.h
In optional.h, ETL_HAS_INITIALIZER_LIST is being used to
guard against cases where std::initializer_list is not available.
But not consistently. This changes fixes it by adding it in the
remaining places.
* Fixed #undef in optional.h
Instead of undefining ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14,
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL was undefined twice
(one of the misspelled).
* Fix comment typos
* Guards around usage of std::initializer_list in optional.h
In optional.h, ETL_HAS_INITIALIZER_LIST is being used to
guard against cases where std::initializer_list is not available.
But not consistently. This changes fixes it by adding it in the
remaining places.
* Fixed #undef in optional.h
Instead of undefining ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14,
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL was undefined twice
(one of the misspelled).
* Fix comment typos
* Guards around usage of std::initializer_list in optional.h
In optional.h, ETL_HAS_INITIALIZER_LIST is being used to
guard against cases where std::initializer_list is not available.
But not consistently. This changes fixes it by adding it in the
remaining places.
* Fixed #undef in optional.h
Instead of undefining ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14,
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL was undefined twice
(one of the misspelled).
* Fix comment typos
* Guards around usage of std::initializer_list in optional.h
In optional.h, ETL_HAS_INITIALIZER_LIST is being used to
guard against cases where std::initializer_list is not available.
But not consistently. This changes fixes it by adding it in the
remaining places.
* Fixed #undef in optional.h
Instead of undefining ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP14,
ETL_OPTIONAL_ENABLE_CONSTEXPR_BOOL_RETURN_CPP20_STL was undefined twice
(one of the misspelled).
* Fix comment typos
* Removed UB in type_def bit-shift operators
* Changed shift operators to allow both signed and unsigned operands for shifts
This allows the library user to explicitly use unsigned values to avoid UB
* Fixed constexpr errors for CPP11
* Changed is_arithmetic checks to use is_integral since valid shifts require integral operands
* Removed need for CPP11 since changes are CPP03 compatible
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Fix etl::typed_storage by supporting omitted destructors
In a recent change to alignment.h, the etl::typed_storage was
changed in a way that in case of an already constructed object,
the object is created via assignment.
However, this contradicts the original use case that led to
etl::typed_storage in the first place:
https://github.com/ETLCPP/etl/pull/1023
The goal is to omit destructors (and at the same time support
classes with deleted assignment operators), so they can be optimized out
at link time.
This change reverts commit ac7b268 to restore the original
functionality and changes the test to reflect the original
use case.
* Fix missing create() in non-C++11 typed_storage_ext constructor
* Typo fix
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Support zero arguments emplace() in etl::optional
For non-fundamental types, a recent change in etl::optional was
introduced that doesn't support zero arguments emplace() anymore.
This change fixes it and adds the respective test.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
* Removed UB in type_def bit-shift operators
* Changed shift operators to allow both signed and unsigned operands for shifts
This allows the library user to explicitly use unsigned values to avoid UB
* Fixed constexpr errors for CPP11
* Changed is_arithmetic checks to use is_integral since valid shifts require integral operands
* Removed need for CPP11 since changes are CPP03 compatible
* debug assert POC
* Swith to ETL_CONSTEXPR14
* Finish TODO checks
* First and last can be equal
* Add ETL_DEBUG_THROW_EXCEPTIONS
* Try allowing c++11 constexpr
* Add macro for throwing from c++11 constexpr
* Remove braces
* Add extra asserts in size_t overload functions
* Fill out debug asserts
* Line up comments
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Fix etl::typed_storage by supporting omitted destructors
In a recent change to alignment.h, the etl::typed_storage was
changed in a way that in case of an already constructed object,
the object is created via assignment.
However, this contradicts the original use case that led to
etl::typed_storage in the first place:
https://github.com/ETLCPP/etl/pull/1023
The goal is to omit destructors (and at the same time support
classes with deleted assignment operators), so they can be optimized out
at link time.
This change reverts commit ac7b268 to restore the original
functionality and changes the test to reflect the original
use case.
* Fix missing create() in non-C++11 typed_storage_ext constructor
* Typo fix
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Added coderabbitai configuration
* Added builtin mem function tests
* Modified etl::typed_storage
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Added ETL_NOEXCEPT and ETL_NOEXCEPT_IF_NO_THROW
* Added etl::typed_storage_ext and swap for same
* Added etl::typed_storage_ext and swap for same
# Conflicts:
# include/etl/alignment.h
* Added release notes
* Fixes to GCC -O2 errors
* Changed char* parameters to value_type* parameters
* Fixed compilation issues for const containers unit tests
* Added automatic selection of __builtin_memxxx functions for GCC and clang
* Added enhanced coderabbit configuration
* Updated version and release notes
* Disabled constexpr const container tests for C++11
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Attempted fixes for MacOS compilation
* Updated version and release notes
* feat: removed unreachable break statements (#1169)
* Updated version and release notes
* Modified etl::typed_storage
# Conflicts:
# include/etl/alignment.h
* Support zero arguments emplace() in etl::optional
For non-fundamental types, a recent change in etl::optional was
introduced that doesn't support zero arguments emplace() anymore.
This change fixes it and adds the respective test.
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: Drew Rife <darife@jlg.com>
* Make all call interfaces in etl::delegate conditionally noexcept
This covers the case when the invoked code can throw.
For operator(), this was already implemented. Do similarly for the
other call interfaces.
* Make all call interfaces in etl::closure conditionally noexcept
Similar to etl::delegate, the contained delegate might be
throwing. Apply the same solution as in etl::delegate to make
the call interfaces conditionally noexcept.
* Added coderabbitai configuration
* Made all 'noexcept' statements use ETL_NOEXCEPT macro
---------
Co-authored-by: John Wellbelove <john.wellbelove@asterconsulting.co.uk>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Refactored callback_timer_locked to allow base class extention of tick method
* Implement callback timer deferred with priority option
---------
Co-authored-by: Mario Luzeiro <mluzeiro@gliderbits.com>
* Reproduce bug in the `void etl::unlink(first, last)` for bidirectional links.
- correct `test_unlink_range_bidirectional_link` unit test according to the documentation - now this test fails.
- enhance `test_intrusive_list::test_splice_range_self` unit test to verify also `etl_previous` links after splicing lists - now unit test crashes.
* Fix bug in the `void etl::unlink(first, last)` for bidirectional links.
- `test_unlink_range_bidirectional_link` unit test now is green.
- `test_intrusive_list::test_splice_range_self` is not crashing anymore and green.
zephyr_link_interface() does not work as intended because the
implementation in zephyr/cmake/modules/extensions.cmake:
function(zephyr_link_interface interface)
target_link_libraries(${interface} INTERFACE zephyr_interface)
endfunction()
is backwards, i.e., target_link_libraries(etl INTERFACE zephyr_interface)
vs. target_link_libraries(zephyr_interface INTERFACE etl).
The workaround results in the following CMake code being executed:
target_link_libraries(zephyr_interface INTERFACE etl::etl)
* Fix bitset_new test: bitset is implemented as little endian container
* Fix test_bsd_checksum.cpp: endian test was only implemented for little endian
* Fix endianness test
* Fix endian in crc tests
* Fix test_fnv_1
* Fix test_hash
* Fix test_jenkins
* Fix test_memory
* Fix pearson test
* Fix test_xor_rotate_checksum
* Fix murmur test
For non-GCC-compilers, the template keyword is being used in
parameter_pack.h for referring to a template template member.
However, clang 19 and 20 don't accept this.
It should be verified which compiler really needs the template
keyword here at all. If not, the if-branch can be removed.
Removed redundant ETL_USING_WIDE_CHARACTERS
Added using_libc_wchar_h to ETL traits
#1127 type_traits.h and C++03
Changed many instances of mem_copy to mem_move
For non-GCC-compilers, the template keyword is being used in
parameter_pack.h for referring to a template template member.
However, clang 19 and 20 don't accept this.
It should be verified which compiler really needs the template
keyword here at all. If not, the if-branch can be removed.
* Refactored callback_timer_locked to allow base class extention of tick method
* Implement callback timer deferred with priority option
---------
Co-authored-by: Mario Luzeiro <mluzeiro@gliderbits.com>
* Add unit tests for bit_stream
* Include issue number in test name
* Included issue number in test name
---------
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add Zephyr build system module.yml (#1074)
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Add full West support for ETL (#1075)
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
* Add IWYU pragmas to private headers which provide library symbols
This prevents warnings in clang compiler and IWYU tool
https://clangd.llvm.org/guides/include-cleaner#iwyu-pragmashttps://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export
---------
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <marshmilo100@gmail.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add Zephyr build system module.yml (#1074)
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Add full West support for ETL (#1075)
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
* Add IWYU pragmas to private headers which provide library symbols
This prevents warnings in clang compiler and IWYU tool
https://clangd.llvm.org/guides/include-cleaner#iwyu-pragmashttps://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export
---------
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <marshmilo100@gmail.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add Zephyr build system module.yml (#1074)
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Add full West support for ETL (#1075)
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
* refactor: use etl::clamp for clamping the set value
---------
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <marshmilo100@gmail.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Add Zephyr build system module.yml (#1074)
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Add full West support for ETL (#1075)
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
* Fixed compilation errors in algorithm.h in C++03 and compiler warnings in gcc older than 4.6
---------
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <marshmilo100@gmail.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
* Various Cleanup
Remove remove() by pointer because erase() can be used for that
Fix signed distance handling, with added check for order
Add missing file ID
Fix File IDs
Added test for algorithm.h
* Improve types
# Conflicts:
# include/etl/file_error_numbers.h
* Various Cleanup
Remove remove() by pointer because erase() can be used for that
Fix signed distance handling, with added check for order
Add missing file ID
Fix File IDs
Added test for algorithm.h
* Improve types
* Add Zephyr build system module.yml (#1074)
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Support const pointers to etl::is_aligned()
---------
Co-authored-by: Zach Van Camp <marshmilo100@gmail.com>
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
# Conflicts:
# zephyr/module.yml
This will allow ETL to be included via west in a zephyr build without any additional wrappers or external kconfigs.
Signed-off-by: Zach Van Camp <zach.vancamp@etcconnect.com>
Co-authored-by: Zach Van Camp <zach.vancamp@etcconnect.com>
The Zephyr build system requires that modules have a `module.yml` file to specify where the module cmake and kconfig files are located.
These can also be explicitly set as "external" meaning that they do not exist within the module tree, itself. These build file can still be specified elsewhere via cmake variables, explained more in-depth here: https://docs.zephyrproject.org/latest/develop/modules.html#modules-module-ext-root
This change makes it such that ETL can be included more easily in zephyr projects running on embedded systems. A similar change can be observed in the public nanopb repository, where the repo only requires its own `zephyr/module.yml` file to be found by the zephyr build system, but the kconfig and cmake additions can exist outside of the library repository.
* Implement << operator for std basic_ostream and etl string_view
* Implement << operator for std basic_ostream and etl ibasic_string. Still working through tests
* Should be all tests
* Fix comment
* etl::span: Add advance(), copy(), reinterpret_as()
* Added further tests for span::reinterpret_as
* Fix size of unaligned_type on Windows
Multiple inheritance leads to additional 1 byte for the second base class.
Fixing it by not inheriting but aggregating via typedef.
* Add enable_if restriction for span constructor from c array
* Try to simplify enable if
* Revert "Try to simplify enable if"
This reverts commit b133835f8cfe43e75478f2a8df06ad5265b7f163.
* Implement << operator for std basic_ostream and etl string_view
* Implement << operator for std basic_ostream and etl ibasic_string. Still working through tests
* Should be all tests
* Fix comment
* Implement << operator for std basic_ostream and etl string_view
* Implement << operator for std basic_ostream and etl ibasic_string. Still working through tests
* Should be all tests
* Fix comment
* etl::span: Add advance(), copy(), reinterpret_as()
* Added further tests for span::reinterpret_as
* Fix size of unaligned_type on Windows
Multiple inheritance leads to additional 1 byte for the second base class.
Fixing it by not inheriting but aggregating via typedef.
* etl::span: Add advance(), copy(), reinterpret_as()
* Added further tests for span::reinterpret_as
* Fix size of unaligned_type on Windows
Multiple inheritance leads to additional 1 byte for the second base class.
Fixing it by not inheriting but aggregating via typedef.
* Refactored callback_timer_locked to allow base class extention of tick method
* Implement callback timer deferred with priority option
---------
Co-authored-by: Mario Luzeiro <mluzeiro@gliderbits.com>
* Making crc constexpr for c++14. Allows compile time CRC computation.
* Fix syntax when using c++03 or `ETL_FORCE_NO_ADVANCED_CPP`
* Remove use of `ETL_FORCE_NO_ADVANCED_CPP` option since it is no longer used.
---------
Co-authored-by: Zach O'Brien <zach.obrien@tortugaagtech.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
There are few build and test failures on arm64 platform
with "narrowing conversion" errors. This is due to the char
datatype implementation differences between different platforms
and gcc versions. This commit replaces the char datatype with
the explicit datatype that works across all the platforms.
* Add contains() method to etl::unordered_map and etl::unordered_set
* Add contains() method to etl::unordered_multiset and etl::unordered_multimap
Use predefined variables in UT
Move contains() method to correct place in etl::unordered_set
* Fix contains() parameter type
There are few build and test failures on arm64 platform
with "narrowing conversion" errors. This is due to the char
datatype implementation differences between different platforms
and gcc versions. This commit replaces the char datatype with
the explicit datatype that works across all the platforms.
* etl/delegate: fix accident creation of a delegate to an rvalue delegate when copying/assigning from delegate with mismatching signature
* etl/type_traits: fix etl::is_base_of for the case when TDerived is final
* add etl::is_delegate
* add changes related to etl::is_delegate to c++03 implementation
* add etl::is_delegate_v<T>
* Render include paths relative
By removing `etl/` from include paths (in `#include` statements), the path to the directory `include/` doesn't need to be provided to the preprocessor as an include path if the files in `include/etl/` are included by other means.
This has no disadvantages.
Actually the form `#include "..."` is intended to be used for relative paths in the first place.
This is relevant if one wants to include the source files from `include/etl` only indirectly.
For example we use special generated header files which wrap the include statement of the vanilla header files with diagnostic commands.
Those commands allow to disable diagnostic for ETL's files and re-enable them after the file inclusion.
Wrapper files are generated for every non-private header file.
We provide the directory with the wrapper files as include path to the preprocessor instead of the normal `include/` directory.
Thus include statements like `#include "etl/private/..."` are invalid in that case.
* Remove "etl/" from include paths in all files in `include/`.
33 findings in 4 files of 375.
See 936961949172bca5ba1418054a055e05ecb6d1d4 for explanation.
* Add an etl::nullptr_t type
* etlcpp/etl issue #921 (etl::unique_ptr reset): add etl::unique_ptr(...)::reset(ETL_NULLPTR)
Remove default argument for the normal reset method of etl::unique_ptr (sorry, didn't notice 😬)
Silence the unused argument warning
Fix operator =(nullptr)
Replace the nullptr_t enum with a class which acts more similar to C++11 nullptr
* Add member pointer support and delete the addressof operator
* "Delete" etl::addressof(ETL_NULLPTR)
* Ensure compatibility with C++98
* ACTUALLY ensure compatibility with C++98
I'm stupid :/
* Correct definition according to cppreference
* Fix run-tests.sh script
- Fix ordering of parameters in help info
- Change spaces to tabs in indentation of methods (unique usage of indentation)
- Fix check for number of parameters to avoid empty string as default parameter value
* Fix incorrect comparison
* Fix doc comment for pool::allocate() (#914)
* Fixes compiler detection with Wunder
---------
Co-authored-by: Michael K <130953568+kmichaelk@users.noreply.github.com>
Co-authored-by: Rafael Laya <rafaellaya@meta.com>
* fix c++20-compat false positive
* move the c++20 compat warning suppression to a separate header
* fix GCC/clang in private/diagnostic_cxx_20_compat_push.h
---------
Co-authored-by: Jan Dorniak <jdorniak@ultima-automatyka.pl>
* etl/type_traits.h: Add support for type_identity
* test/test_type_traits.cpp: Add a test for etl::type_identity (type_identity_test_add(1.5f, 2) == 3.5f)
* Update test_type_traits.cpp
Use CHECK_CLOSE instead of CHECK for equality
The documentation comment for `exception::line_number()` in
`include/etl/exception.h` states falsely that the return type for
the function is a `const char*`.
It should state that the return type is `numeric_type`,
which is an `int`.
So change the documentation comment to reflect that the return type is
an `int`.
By removing `etl/` from include paths (in `#include` statements), the path to the directory `include/` doesn't need to be provided to the preprocessor as an include path if the files in `include/etl/` are included by other means.
This has no disadvantages.
Actually the form `#include "..."` is intended to be used for relative paths in the first place.
This is relevant if one wants to include the source files from `include/etl` only indirectly.
For example we use special generated header files which wrap the include statement of the vanilla header files with diagnostic commands.
Those commands allow to disable diagnostic for ETL's files and re-enable them after the file inclusion.
Wrapper files are generated for every non-private header file.
We provide the directory with the wrapper files as include path to the preprocessor instead of the normal `include/` directory.
Thus include statements like `#include "etl/private/..."` are invalid in that case.
* Add eq and ne operators
* Add three-way comparison to compare utils.
* Three-way comparison test now using own test data.
* Rename test struct for three-way comparison test.
* Quick fix for pre c++20 aggregate initialization.
---------
Co-authored-by: grigorev <grigorev@protei.ru>
* Add eq and ne operators
* Add three-way comparison to compare utils.
* Three-way comparison test now using own test data.
* Rename test struct for three-way comparison test.
---------
Co-authored-by: grigorev <grigorev@protei.ru>
The const variables "left" and "right" are const default initialized.
The C++ standard states the following:
"A class type T is const-default-constructible if default-initialization
of T would invoke a user-provided constructor of T."
Since the "left_soec" and "right_spec" structs are PODs they are not
initialized per default. Due to the "constness" the variable can not be
modified later one, therefore the POD is in a state in which it is not
useful at all.
Since the mentioned structs are empty there would be no problem
in this case. This is an issue in the C++ standard (CWG Issue 253).
Some compilers already handle this issue with their own solution
despite the fact, that the standard did not provide a solution yet.
For some exotic compilers (e.g. Tasking for TriCore) the include of
the "string_stream" header caused compilation errors:
"const variable "etl::left" requires an initializer -- class "etl::private_basic_format_spec::left_spec" has no user-provided default constructor"
References:
https://en.cppreference.com/w/cpp/language/default_initializationhttps://cplusplus.github.io/CWG/issues/253.htmlhttps://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-constructor-to-default-construct-ahttps://stackoverflow.com/questions/24943665/why-is-a-constructor-necessary-in-a-const-member-struct
* #850 Fixed names according to Arduino's guidelines
* #850 Fixed names according to Arduino's guidelines
* Add support for in-place instantiation of a shared message in the message pool
---------
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Utilized a spell checking tool to identify and correct spelling
throughout all files in the code base.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
* In subspan function, add static checks on extents
* Change to ETL_STATIC_ASSERT. Add static assert for first and last functions
* Add static assert to pre c++11 subspan
* Change extent to Extent to better match existing code
* Fixed set_full error when inserting existing item.
* Added test inserting existing value to full set
* Added test inserting existing value to full flat_set and reference_flat_set
* Fixed unordered_set_full error when inserting existing item.
Updated CI scripts
#786 u8string
#783 Cannot insert existing value to full set
#781 etl::multi_span::iterator::operator *() fails if first span is empty
#780 endian enum_type produces useless-cast warnings
#779 hash.h: warnings produced with -Wfloat-equal
added check for GNUC >= 11 for -Wstringop-overread ignore pragma since it isn't introduced until gcc/g++-11
Co-authored-by: Josh <joshua.martens@magna.com>
Review the C++ code in these directories. The code must not use
STL containers but must instead rely on Embedded Template Library
(ETL) for data structures and algorithms.
When answering questions, provide accurate and concise information based on the ETL documentation and codebase. If you don't know the answer, just say "I don't know". Do not make up answers.
When providing code examples, ensure they are relevant to the ETL and follow its conventions.
Always be polite and professional in your responses.
Header files should start with the ETL's standard MIT comment block.
Header files should have include guards in the format '#ifndef ETL_<FILENAME>>_INCLUDED #define ETL_<FILENAME>_INCLUDED#endif'
Headers should be organized in the following order
- The first header include should be '#include "platform.h"'
- Headers from the ETL
- Headers from the path 'private/**'
- C++ standard library headers
- C standard library headers
Pay extra attention to the following
- Buffer overflows
- Memory leaks
- Undefined behavior
Check that the following conventions are used
- Variable names should be in `snake_case`
- Macro constants should be `ALL_CAPS_WITH_UNDERSCORES`
- Macro constants should be prefixed with 'ETL_'
- Function, class, and type names should be `snake_case`
- enum members should be `Caps_Snake_Case`
Please keep your outputs short and to the point, unless otherwise asked
- Keep your responses short, describe small issues in a few sentences
- Don't output tips, analysis chains or anything else with a collapsible view
- Don't output `comment summaries` or `fix prompts for AIs`
- If the highlighted issue is complex, don't suggest a solution
- Don't use emojis
- path:"include/etl/atomic/*.h"
instructions:|
Review the C++ code in these directories. The code must not use
STL containers but must instead rely on Embedded Template Library
(ETL) for data structures and algorithms.
When answering questions, provide accurate and concise information based on the ETL documentation and codebase. If you don't know the answer, just say "I don't know". Do not make up answers.
When providing code examples, ensure they are relevant to the ETL and follow its conventions.
Always be polite and professional in your responses.
Header files should start with the ETL's standard MIT comment block.
Header files are allowed to not have include guards
Headers should be organized in the following order
- Headers from the ETL
- Headers from the path 'private/**'
- C++ standard library headers
- C standard library headers
Pay extra attention to the following
- Buffer overflows
- Memory leaks
- Undefined behavior
Check that the following conventions are used
- Variable names should be in `snake_case`
- Macro constants should be `ALL_CAPS_WITH_UNDERSCORES`
- Macro constants should be prefixed with 'ETL_'
- Function, class, and type names should be `snake_case`
- enum members should be `Caps_Snake_Case`
Please keep your outputs short and to the point, unless otherwise asked
- Keep your responses short, describe small issues in a few sentences
- Don't output tips, analysis chains or anything else with a collapsible view
- Don't output `comment summaries` or `fix prompts for AIs`
- If the highlighted issue is complex, don't suggest a solution
- Don't use emojis
- path:"include/etl/atomic/*.h"
instructions:|
Review the C++ code in these directories. The code must not use
STL containers but must instead rely on Embedded Template Library
(ETL) for data structures and algorithms.
When answering questions, provide accurate and concise information based on the ETL documentation and codebase. If you don't know the answer, just say "I don't know". Do not make up answers.
When providing code examples, ensure they are relevant to the ETL and follow its conventions.
Always be polite and professional in your responses.
Header files should start with the ETL's standard MIT comment block.
Header files are allowed to not have include guards
Headers should be organized in the following order
- Headers from the ETL
- Headers from the path 'private/**'
- C++ standard library headers
- C standard library headers
Pay extra attention to the following
- Buffer overflows
- Memory leaks
- Undefined behavior
Check that the following conventions are used
- Variable names should be in `snake_case`
- Macro constants should be `ALL_CAPS_WITH_UNDERSCORES`
- Macro constants should be prefixed with 'ETL_'
- Function, class, and type names should be `snake_case`
- enum members should be `Caps_Snake_Case`
Please keep your outputs short and to the point, unless otherwise asked
- Keep your responses short, describe small issues in a few sentences
- Don't output tips, analysis chains or anything else with a collapsible view
- Don't output `comment summaries` or `fix prompts for AIs`
- If the highlighted issue is complex, don't suggest a solution
- Don't use emojis
- path:"include/etl/mutex/*.h"
instructions:|
Review the C++ code in these directories. The code must not use
STL containers but must instead rely on Embedded Template Library
(ETL) for data structures and algorithms.
When answering questions, provide accurate and concise information based on the ETL documentation and codebase. If you don't know the answer, just say "I don't know". Do not make up answers.
When providing code examples, ensure they are relevant to the ETL and follow its conventions.
Always be polite and professional in your responses.
Header files should start with the ETL's standard MIT comment block.
Header files are allowed to not have include guards
Headers should be organized in the following order
- Headers from the ETL
- Headers from the path 'private/**'
- C++ standard library headers
- C standard library headers
Pay extra attention to the following
- Buffer overflows
- Memory leaks
- Undefined behavior
Check that the following conventions are used
- Variable names should be in `snake_case`
- Macro constants should be `ALL_CAPS_WITH_UNDERSCORES`
- Macro constants should be prefixed with 'ETL_'
- Function, class, and type names should be `snake_case`
- enum members should be `Caps_Snake_Case`
Please keep your outputs short and to the point, unless otherwise asked
- Keep your responses short, describe small issues in a few sentences
- Don't output tips, analysis chains or anything else with a collapsible view
- Don't output `comment summaries` or `fix prompts for AIs`
- If the highlighted issue is complex, don't suggest a solution
echo"ERROR: Failed to rename installer script for checksum. File '${TMP_DIR}/${DERIVED_CMAKE_BINARY_FILENAME}' does not exist after move."
exit1
fi
# 7. Verify checksum
echo"--- Verifying Checksum ---"
echo"Checksum file is: ${TMP_DIR}/${CMAKE_CHECKSUM_FILE_LOCAL_NAME}"
echo"Binary file to check is: ${TMP_DIR}/${DERIVED_CMAKE_BINARY_FILENAME}"
# Ensure the checksum file actually contains an entry for our binary
# This is important because the SHA-256.txt file contains checksums for *all* release assets
echo"Checking if checksum file contains entry for '${DERIVED_CMAKE_BINARY_FILENAME}'..."
if ! grep -q "${DERIVED_CMAKE_BINARY_FILENAME}""${TMP_DIR}/${CMAKE_CHECKSUM_FILE_LOCAL_NAME}";then
echo"ERROR: The downloaded checksum file '${CMAKE_CHECKSUM_FILE_LOCAL_NAME}' does NOT contain an entry for '${DERIVED_CMAKE_BINARY_FILENAME}'."
echo"This strongly suggests that the CMAKE_VERSION ('${CMAKE_VERSION}') or ARCH ('${ARCH}') is incorrect, or the specified version does not provide a .sh installer for this architecture."
echo"Please verify the version and available files at https://github.com/Kitware/CMake/releases/tag/v${CMAKE_VERSION}"
exit1
fi
echo"Checksum file contains an entry for '${DERIVED_CMAKE_BINARY_FILENAME}'."
# Perform the checksum. We need to be in the directory where the files are.
echo"Changing directory to ${TMP_DIR} for checksum verification."
cd"${TMP_DIR}"# <<<<<<< IMPORTANT: sha256sum -c needs to find files
echo"Verifying checksum of '${DERIVED_CMAKE_BINARY_FILENAME}' using '${CMAKE_CHECKSUM_FILE_LOCAL_NAME}'..."
# The --ignore-missing flag is good, as the .txt file has many checksums.
# The --strict flag would cause it to error if there are improperly formatted lines.
# We rely on the grep check above to ensure our specific file is mentioned.
if sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_FILE_LOCAL_NAME}";then
echo"Checksum verification successful for '${DERIVED_CMAKE_BINARY_FILENAME}'."
else
SHA_EXIT_CODE=$?
echo"ERROR: Checksum verification FAILED for '${DERIVED_CMAKE_BINARY_FILENAME}' with exit code ${SHA_EXIT_CODE}."
# Cleanup trap will show file contents.
exit1# Critical failure
fi
echo"--- End of Verifying Checksum ---"
echo# Newline for readability
# 8. Install CMake
echo"--- Installing CMake ---"
echo"Making the CMake installer script '${DERIVED_CMAKE_BINARY_FILENAME}' executable..."
chmod +x "${DERIVED_CMAKE_BINARY_FILENAME}"# Still in TMP_DIR
Thanks for considering a contribution! Here’s what you need to know before opening a pull request:
- If you are adding or modifying a feature, add *new* unit tests that test that feature.
- If you are fixing a bug, add a unit test that *fails* before the bug fix is implemented.
- Do not initiate a pull request until all of the units tests pass. See below for information on project files and test scripts.
- Branches should be based on the branch `master`. If `development` has pending updates, I’ll rebase the PR against it before pulling..
- For formatting help, you can use clang-format, or the convenience wrapper treefmt. See also [docs/source-formatting.md](docs/source-formatting.md)
There is a project file for VS2022 for C++14, 17, 20, 23, and bash scripts that run the tests for C++11, 14, 17, 20, 23 under Linux with GCC and Clang.
There are syntax-only check bash scripts that cover C++03, 11, 14, 17, 20, 23 under Linux with GCC and Clang.
If you are thinking of adding a new feature then raise this on the GitHub Issues page for discussion as the maintainers and user of the ETL may have questions or suggestions.
It is possible that the maintainer of the ETL or another contributor is already working on the same or a related feature.
Take a look through our current issues and see if anything sparks your interest!
C++ is a great language to use for embedded applications and templates are a powerful aspect. The standard library can offer a great deal of well tested functionality, but there are some parts of the standard library that do not fit well with deterministic behaviour and limited resource requirements. These limitations usually preclude the use of dynamically allocated memory and containers with open ended sizes.
C++ is a powerful language for embedded systems development, with templates offering a great deal of flexibility and type safety. While the C++ Standard Library provides a wealth of well-tested functionality, it’s often not well suited to environments with strict deterministic behavior and limited resources.
What is needed is a template library where the user can declare the size, or maximum size of any object upfront. Most embedded compilers do not currently support the standard beyond C++ 03, therefore excluding the programmer from using the enhanced features of the later library.
In many embedded applications, dynamic memory allocation is discouraged or outright prohibited, making standard STL containers and many other components impractical or unusable.
This is what the ETL attempts to achieve.
What’s needed is a template library specifically designed for embedded systems — one that allows developers to define fixed or maximum sizes for containers and other objects at compile time. Additionally, since many embedded toolchains still lack full support for standards beyond C++03, it's valuable to have access to a library that backports select features from later versions of the C++ Standard Library.
## Summary
## About the ETL
The ETL is not designed to completely replace the STL, but complement it.
Its design objective covers three areas.
The Embedded Template Library (ETL) is not intended as a full replacement for the C++ Standard Template Library (STL), but rather as a complementary solution tailored specifically for embedded systems.
- Create a set of containers where the size or maximum size is determined at compile time. These containers are direct equivalents of those supplied in the STL.
- Be compatible with C++ 03 but implement as many of the C++ 11/14/17/20 additions as possible.
- Add other useful components that are not present in the standard library.
Its design goals include:
The embedded template library has been designed for lower resource embedded applications.
It contains a set of containers, algorithms and utilities, some of which emulate parts of the STL.
There is no dynamic memory allocation. The library makes no use of the heap. All of the containers have a fixed capacity allowing all memory allocation to be determined at compile time.
The library is intended for any compiler that supports C++98/03/11/14/17/20.
- Providing a set of containers with fixed or maximum sizes defined at compile-time.
## Main features
- Offering APIs that closely resemble those of the STL, enabling familiar and consistent usage.
- Cross platform. This library is not specific to any processor type.
- No dynamic memory allocation
- No RTTI required
- Very little use of virtual functions. They are used only when they are absolutely necessary for the required functionality
- A set of fixed capacity containers. (array, bitset, deque, forward_list, list, queue, stack, vector, map, set, etc.)
- As the storage for all of the container types is allocated as a contiguous block, they are extremely cache friendly
- Templated compile time constants
- Templated design pattern base classes (Visitor, Observer)
- Reverse engineered C++ 0x11 features (type traits, algorithms, containers etc.)
- Type-safe enumerations
- Type-safe typedefs
- 8, 16, 32 & 64 bit CRC calculations
- Checksums & hash functions
- Variants (a type that can store many types in a type-safe interface)
- Choice of asserts, exceptions, error handler or no checks on errors
- Unit tested (currently over 6480 tests), using VS2019, GCC 8.1.0, , GCC 9.3.0, Clang 9.0.0 & 10.0.0
- Many utilities for template support.
- Easy to read and documented source.
- Free email support
- Maintaining compatibility with C++98 while implementing many features introduced in later standards
(C++11/14/17/20/23) where possible.
- Ensuring deterministic behavior, which is critical in real-time and resource-constrained environments.
- Introducing additional components and utilities useful in embedded contexts but absent from the STL.
The ETL avoids dynamic memory allocation entirely; the heap is never used. All non-intrusive containers have a fixed capacity, allowing memory requirements to be fully determined at compile-time. This makes the ETL ideal for lower-resource embedded applications where predictability, performance, and memory control are essential.
The library is compatible with any compiler that supports C++03 or later.
Help on integrating the ETL with your project may be found here.
## Key features of the ETL
- Actively Maintained: Developed and maintained on GitHub since 2014.
- Open Source: MIT licensed.
- No STL Dependency: Designed to operate independently of the C++ Standard Template Library.
- No Dynamic Memory Allocation: All storage is allocated either at compile-time or on the stack; heap usage is entirely avoided.
- RTTI and Virtual Functions: No runtime type information (RTTI) is required. Virtual functions are used sparingly and only when strictly necessary.
- Header-Only Library: All functionality is provided via header files; No separate compilation needed.
- Fixed-Capacity Containers: Offers STL-like containers with fixed or maximum capacity, plus additional non-standard container types.
- Cache Efficiency: Containers use contiguous memory layouts for optimal cache performance.
- Compact Codebase: Shared base classes (based on type) help reduce overall container code size.
- Compile-Time Features:
- Templated compile-time constants
- Template-based design pattern base classes (e.g., Visitor, Observer)
- Type-safe smart enumerations
- Type-safe typedefs and constants
- Embedded System Frameworks:
- Message routing
- Finite state machines
- Task scheduling
- C++11 Backports: Implements many C++11 features (type traits, algorithms, containers) for use in C++03 environments.
- Utilities:
- CRC calculations (8, 16, 32 & 64-bit)
- Checksums and hash functions
- Variants (type-safe unions)
- Extensive template support utilities
- Robust Error Handling: Configurable error checking using asserts, exceptions, error handlers, or no checks; user’s choice.
- Thoroughly Tested:
- Over 10,000 unit tests
- Tested with Visual Studio 2022, GCC 12, and Clang 14
- Continuous integration via GitHub Actions.
- Readable and Well-Documented: Clean, maintainable source code with clear documentation.
- Support: Free email support available. A Slack group is available. Paid support on request.
- Archived: A snapshot of the ETL is preserved in the Arctic Code Vault for long-term digital preservation.
Any help porting the library to work under different platforms and compilers would be gratefully received.
I am especially interested in people who are using Keil, IAR, Green Hills, TI Code Composer etc, bare metal or RTOS, and DSPs.
@ -129,6 +182,84 @@ add_executable(foo main.cpp)
target_link_libraries(foo PRIVATE etl::etl)
```
## Profile definition
When using ETL in a project, there is typically an `etl_profile.h` defined to
adjust ETL to the project needs. ETL will automatically find `etl_profile.h`
if it is available in the include path(s). If it's not available, ETL will
work with default values.
### Example
```
#ifndef __ETL_PROFILE_H__
#define __ETL_PROFILE_H__
#define ETL_TARGET_DEVICE_GENERIC
#define ETL_TARGET_OS_NONE
#define ETL_NO_STL
#endif
```
## Platform specific implementation
Although ETL is generally a self-contained header-only library, some interfaces need to be
implemented in every project or platform, at least if those interfaces are actually being
used, due to project specifics:
| ETL header | Platform specific API to be implemented | Needed when using |
The content of this repo is available as a library in the Arduino IDE (search for the "Embedded Template Library" in the IDE library manager). The Arduino library repository is available at ```https://github.com/ETLCPP/etl-arduino```, see there for more details.
Efficient Manchester encoding and decoding of data. The Manchester code represents a data bit as a sequence of a 'high' and a 'low' value. In software this translates to a conversion from one to two bits, or in a practical situation, from `n` bytes to `n*2` bytes.
- Support for multiple encoding chunk sizes: 8-bit, 16-bit and 32-bit
- Span-based operations or chunk-based operations
- Constexpr functions for compile-time encoding/decoding
- Validation of encoded data
- Chunked span I/O uses little-endian byte order for multi-byte chunks, independent of host platform endianness
## Algorithm background
To encode the value `0b11001100` we must first duplicate all bits to create the value `0b1111000011110000`. We then perform an XOR of this value with the constant `0b1010101010101010` (`0xAAAA`) to obtain the Manchester coded value of `0b1010010110100101`. We have now replaced each `1` bit with the sequence `10` and each `0` bit with the sequence `01`.
### 2. Bit duplication
Bit duplication is achieved with the following steps. This is also called binary interleaving. The example shows encoding of an 8-bit value.
| 1 | `11011000` | Original | First bit pair (lsb, 00) is invalid. Last bit pair is also invalid. Other bit pairs are valid |
| 2 | `01101100` | Shift right by 1 | Shift the original value right by one bit |
| 3 | `10110100` | XOR | XOR the original with the shifted value |
| 4 | `01010101` | Mask with 0x55 | Apply mask to isolate bit pairs |
| 5 | `00010100` | Result | If result is not equal to 0x55, there was an error in the input |
## Analysis
Most traditional ways to Manchester encode data consist of a loop over all bits and a nested if-statement to check the value of the current bit. This approach does not scale well to increasing number of bits. The algorithm implemented here contains no conditional code and scales well. Doubling the number of processed bits per step (the chunk size) adds a single row to the bit duplication table. Because of the lack of loops and conditional code, this algorithm is likely to perform better than traditional ones on simple processors or when compiler optimization is disabled. On modern, powerful processors with caches and advanced optimization possibilities this algorithm may not show much benefit. In any case, the performance of the algorithm depends heavily on the processor type, compiler and compiler (optimization) settings.
## API Reference
### Classes
Classes `etl::manchester` and `etl::manchester_inverted` contain static functions for encoding, decoding and validity checking. It is not necessary to instantiate objects of these classes.
The Embedded Template Library provides a C++17-compatible implementation of ranges, inspired by the C++20 ranges library. This implementation enables range-based algorithms and views for embedded and resource-constrained environments where full C++20 support may not be available.
## Features
- **Ranges**: Provides range types and iterator wrappers for composing operations over sequences.
- **Views**: Includes lightweight, composable views such as `filter_view`, `transform_view`, and `subrange`.
- **Algorithms**: Supports range-based algorithms compatible with ETL containers and standard containers.
- **Compatibility**: Designed for C++17, with minimal dependencies and no reliance on C++20 features.
This first filters the even numbers and then squares them. Each `|` passes the result of the previous stage as input to the next view adaptor.
## Supported Views
All views are in the `etl::ranges` namespace. Corresponding range adaptor objects are available in `etl::ranges::views`.
### Range Factories
| View | `views::` adaptor | Description |
|---|---|---|
| `empty_view<T>` | `views::empty<T>` | A view with no elements. |
| `single_view` | `views::single` | A view containing exactly one element. |
| `iota_view` | `views::iota` | A view of sequentially increasing values. |
| `repeat_view` | `views::repeat` | A view that repeats a value a given number of times. |
### Range Adaptors
| View | `views::` adaptor | Description |
|---|---|---|
| `ref_view` | `views::ref` | A non-owning view that wraps a reference to a range. |
| `owning_view` | `views::owning` | A view that takes ownership of a range via move. |
| — | `views::all` | Returns the range itself (if already a view), a `ref_view`, or an `owning_view`. |
| `filter_view` | `views::filter` | Filters elements based on a predicate. |
| `transform_view` | `views::transform` | Applies a transformation to each element. |
| `as_rvalue_view` | `views::as_rvalue` | Casts each element to an rvalue reference. |
| `as_const_view` | `views::as_const` | Provides a const view of the elements. |
| `cache_latest_view` | `views::cache_latest` | Caches the most recently accessed element (avoids recomputation). |
| `reverse_view` | `views::reverse` | Reverses the order of elements. |
| `drop_view` | `views::drop` | Skips the first *n* elements. |
| `drop_while_view` | `views::drop_while` | Skips leading elements while a predicate is true. |
| `take_view` | `views::take` | Takes the first *n* elements. |
| `take_while_view` | `views::take_while` | Takes leading elements while a predicate is true. |
| `join_view` | `views::join` | Flattens a range of ranges into a single range. |
| `join_with_view` | `views::join_with` | Flattens a range of ranges, inserting a delimiter between each. |
| `split_view` | `views::split` | Splits a range into subranges around a delimiter pattern. |
| `lazy_split_view` | `views::lazy_split` | Lazily splits a range by a pattern (inner ranges discovered on iteration). |
| — | `views::counted` | Creates a view of *n* elements starting from an iterator. |
| `concat_view` | `views::concat` | Concatenates multiple ranges into a single view. |
| `zip_view` | `views::zip` | Zips multiple ranges into a view of tuples (length of shortest range). |
| `zip_transform_view` | `views::zip_transform` | Zips multiple ranges and applies a function to each tuple of elements. |
| `common_view` | `views::common` | Adapts a view so that its iterator and sentinel types are the same. |
| `enumerate_view` | `views::enumerate` | Pairs each element with its index, producing tuples of (index, value). |
| `elements_view` | `views::elements` | Extracts the *N*-th element from each tuple-like value. |
| `keys_view` | `views::keys` | Alias for `elements_view` with *N*=0 (extracts first element of pairs/tuples). |
| `values_view` | `views::values` | Alias for `elements_view` with *N*=1 (extracts second element of pairs/tuples). |
| `adjacent_view` | `views::adjacent` | Produces a view of tuples of *N* adjacent elements (sliding window of tuples). |
| — | `views::pairwise` | Alias for `views::adjacent<2>`. |
| `adjacent_transform_view` | `views::adjacent_transform` | Applies a function to each group of *N* adjacent elements. |
| — | `views::pairwise_transform` | Alias for `views::adjacent_transform<2>`. |
| `chunk_view` | `views::chunk` | Splits a range into non-overlapping chunks of a given size. |
| `slide_view` | `views::slide` | Produces overlapping subranges (sliding windows) of a given size. |
| `chunk_by_view` | `views::chunk_by` | Splits a range into subranges between adjacent elements where a predicate is false. |
| `stride_view` | `views::stride` | Yields every *N*-th element from the underlying range. |
| `cartesian_product_view` | `views::cartesian_product` | Produces the Cartesian product of multiple ranges as a view of tuples. |
| `to_input_view` | `views::to_input` | Downgrades iterator category to input iterator while preserving elements and order. |
| `subrange` | — | Represents a sub-range defined by an iterator–sentinel pair. |
All views support range-based for-loop iteration and can be composed with the pipe (`|`) operator.
## Supported Algorithms
All algorithms are callable objects in the `etl::ranges` namespace. Each supports both an iterator-pair overload and a range overload (where applicable), and most accept optional projection and comparator arguments.
### Non-modifying Sequence Operations
| Algorithm | Description |
|---|---|
| `for_each` | Applies a function to each element in a range. |
| `for_each_n` | Applies a function to the first *n* elements. |
| `find` | Finds the first element equal to a value. |
| `find_if` | Finds the first element satisfying a predicate. |
| `find_if_not` | Finds the first element not satisfying a predicate. |
| `find_end` | Finds the last occurrence of a subsequence. |
| `find_first_of` | Finds the first element matching any in a second range. |
| `adjacent_find` | Finds the first pair of adjacent equal elements. |
| `count` | Counts elements equal to a value. |
| `count_if` | Counts elements satisfying a predicate. |
| `all_of` | Checks if all elements satisfy a predicate. |
| `any_of` | Checks if any element satisfies a predicate. |
| `none_of` | Checks if no elements satisfy a predicate. |
| `mismatch` | Finds the first position where two ranges differ. |
| `equal` | Checks if two ranges are equal. |
| `is_permutation` | Checks if one range is a permutation of another. |
| `search` | Searches for the first occurrence of a subsequence. |
| `search_n` | Searches for *n* consecutive copies of a value. |
| `starts_with` | Checks if a range starts with another range. |
| `ends_with` | Checks if a range ends with another range. |
| `lexicographical_compare` | Compares two ranges lexicographically. |
### Fold Operations
| Algorithm | Description |
|---|---|
| `fold_left` | Left-folds elements with a binary operation. |
| `fold_left_with_iter` | Left-folds, returning both the result and an iterator. |
| `fold_left_first` | Left-folds using the first element as the initial value. |
| `fold_left_first_with_iter` | Like `fold_left_first`, also returning an iterator. |
| `fold_right` | Right-folds elements with a binary operation. |
| `fold_right_last` | Right-folds using the last element as the initial value. |
### Modifying Sequence Operations
| Algorithm | Description |
|---|---|
| `copy` | Copies elements to a destination range. |
| `copy_n` | Copies *n* elements to a destination range. |
| `copy_if` | Copies elements satisfying a predicate. |
| `copy_backward` | Copies elements backwards to a destination range. |
| `move` | Moves elements to a destination range. |
| `move_backward` | Moves elements backwards to a destination range. |
| `swap_ranges` | Swaps elements between two ranges. |
| `replace` | Replaces elements equal to a value. |
| `replace_if` | Replaces elements satisfying a predicate. |
| `replace_copy` | Copies, replacing elements equal to a value. |
| `replace_copy_if` | Copies, replacing elements satisfying a predicate. |
| `remove` | Removes elements equal to a value. |
| `remove_if` | Removes elements satisfying a predicate. |
| `remove_copy` | Copies, omitting elements equal to a value. |
| `fill` | Fills a range with a value. |
| `fill_n` | Fills *n* elements with a value. |
| `generate` | Assigns each element the result of a generator function. |
| `generate_n` | Assigns *n* elements the result of a generator function. |
| `iota` | Fills a range with sequentially increasing values. |
etl::shared_messagesm1(message_pool,m1);// Created a shared message by allocating a reference counted message from message_pool containing a copy of m1.
etl::shared_messagesm2(message_pool,m2);// Created a shared message by allocating a reference counted message from message_pool containing a copy of m2.
etl::shared_messagesm3(pm3);// Created a shared message from a statically allocated persistent message.
etl::shared_messagesm1(message_pool,
m1);// Created a shared message by allocating a reference counted message
// from message_pool containing a copy of m1.
etl::shared_messagesm2(message_pool,
m2);// Created a shared message by allocating a reference counted message
// from message_pool containing a copy of m2.
etl::shared_messagesm3(pm3);// Created a shared message from a statically
// allocated persistent message.
bus.subscribe(router1);// Subscribe router1 to the bus.
bus.subscribe(router2);// Subscribe router2 to the bus.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.