65 Commits

Author SHA1 Message Date
William Sciaroni
325908b1b9
Add permutation functions (#1348)
* 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>
2026-03-23 19:30:03 +00:00
Roland Reichwein
4a8c167a31
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
2026-03-10 20:39:13 +00:00
Roland Reichwein
a8ebe338f8
Fix etl::rotate (#1327)
Per the C++ standard, std::rotate returns first + (last - middle):

* When first == middle, return last
* When middle == last, return first
2026-03-06 10:11:46 +00:00
John Wellbelove
16b7183eb8 Merge branch 'pull-request/#1245-Fix-discrepancy-with-STL-in-max_element-and-minmax_element' into development 2025-12-23 07:35:26 +00:00
mike919192
342e43e28b
Fix discrepency with STL in max element and minmax element (#1245) 2025-12-23 07:09:37 +00:00
John Wellbelove
d884719098 Fixed all 'extra semicolon' warnings 2025-12-16 09:15:26 +00:00
John Wellbelove
e60f68bad8 Removed asserts from copy_s and move_s algorithms 2025-07-27 10:38:20 +01:00
John Wellbelove
799280f615 Work in progress 2025-06-26 20:23:17 +01:00
Roland Reichwein
49acd2d2ab Various cleanup changes (#1049)
* 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
2025-04-30 16:54:22 +01:00
John Wellbelove
5e689c0a66 Fix some sanitizer issues 2025-02-23 11:54:38 +00:00
jonasgampigbmw
b34e3a6f60
#1017 Fix empty range handling of min/max_element (#1018) 2025-01-21 17:08:38 +00:00
John Wellbelove
bbfce66abc Added template parameter clamp functions 2024-05-28 11:58:07 +01:00
John Wellbelove
55f508b315 Added etl::partition and etl::nth_element 2024-04-16 08:07:33 +01:00
John Wellbelove
a5560b2ce1 Added etl::partition 2024-04-09 13:46:33 +01:00
John Wellbelove
77513730e0 Fixed shadow warnings in all files
#823 Multiple variable shadowing warnings in private/bitset_new.h
2024-01-25 14:22:26 +00:00
John Wellbelove
480363a4e7 Added etl::generate algorithm 2023-12-18 10:52:40 +00:00
John Wellbelove
f8d5c31f66 Refactored swap 2023-10-28 11:33:25 +02:00
John Wellbelove
b609548f38 Added ETL_OR_STD17 macro for the namespace for size() 2023-04-23 18:58:30 +01:00
John Wellbelove
8eabe5fb26 Fix test array sizes
C++14 compiler compatibility

Updated test run scripts

Changed some ETL_ASSERT macros to ETL_ASSERT_OR_RETURN

Changed unit test macros for C++20 compaibility

Updated test run scripts

Updated CMake files to allow C++ standard selection

Replaced ETL_ASSERT_AND_RETURN with ETL_ASSERT_OR_RETURN

Updated C++14 & C++20 unit test compatibility

Changed native char8_t check

Added optional optimisation argument to bash script
2023-03-25 12:16:59 +00:00
John Wellbelove
baa47d1c33 Updated copyright notice 2022-06-10 21:45:37 +01:00
John Wellbelove
e6736404ed Final code after local CI tests 2022-01-08 18:51:35 +00:00
John Wellbelove
f3bf0dc7fe Disable etl::begin(), etl::end() and etl::size() for ETL_NO_STL 2021-10-20 13:34:44 +01:00
CanastraRF
7c0f169b66
literal with suffix (#416) 2021-08-23 11:01:18 +01:00
John Wellbelove
0d6c421fb1 Added etl::erase, etl::erase_if, etl::remove, etl::remove_if 2021-04-13 12:27:11 +01:00
John Wellbelove
bb9f27bd8d Merge branch 'master' into feature/add-mathematical-functors 2021-03-16 20:05:32 +00:00
John Wellbelove
36bd492ecf selection_sort 2021-03-16 20:05:05 +00:00
John Wellbelove
dbfa71944f Abstracted unit test framework header 2021-03-05 13:52:34 +00:00
John Wellbelove
0184725feb Added etl::multi_loop 2020-12-22 12:44:17 +00:00
John Wellbelove
1aac5fb046 Added etl::for_each 2020-12-22 12:43:54 +00:00
Ivo Ihlemann
010b16510f
add overload for etl::equal that compares lengths (#294)
* add overload for etl::equal that compares lengths

accoring to std::equal (https://en.cppreference.com/w/cpp/algorithm/equal)

* add test for equal overload that compares lengths
2020-10-29 09:02:44 +00:00
John Wellbelove
adf6243de6 Performance optimisations for etl::rotate, etl::move & etl::move_backward
when not using the STL, iterators are pointers and the objects are trivially copyable (currently POD types).
2020-09-24 23:19:33 +01:00
John Wellbelove
5c9f648cc5 Full string utilities for char 2020-07-15 12:22:46 +01:00
John Wellbelove
e323f2267f Changed http://www.etlcpp.com to https://www.etlcpp.com 2020-05-01 10:22:36 +01:00
John Wellbelove
582aa051c5 rvalue reference support for heap functions and etl::priority_queue 2020-03-18 19:51:41 +00:00
John Wellbelove
caba10699a Move etl::swap to utilities.h
Fixed many CLang warnings
2020-02-24 11:48:04 +01:00
John Wellbelove
8a99a2725c Merge remote-tracking branch 'origin/development'
# Conflicts:
#	include/etl/version.h
#	library.json
#	library.properties
#	support/Release notes.txt
2020-01-14 12:46:17 +00:00
John Wellbelove
97abf6ccc0 Added min_element & max_element 2020-01-12 16:25:37 +00:00
John Wellbelove
83347ccfdd Work in progress 2020-01-09 11:15:50 +00:00
John Wellbelove
94c5eed5a4 Work in progress 2020-01-04 11:49:22 +00:00
John Wellbelove
fc50557003 Work in progress 2020-01-04 11:20:29 +00:00
John Wellbelove
5803d928a1 Merge remote-tracking branch 'origin/feature/no_stl_unit_tests' into development
# Conflicts:
#	include/etl/stl/alternate/algorithm.h
#	include/etl/stl/alternate/iterator.h
#	include/etl/version.h
#	library.json
#	library.properties
#	support/Release notes.txt
#	test/test_no_stl_algorithm.cpp
#	test/test_no_stl_iterator.cpp
#	test/vs2017/etl.vcxproj
2019-12-01 18:21:10 +00:00
John Wellbelove
fe36361973 Finalised sort functions.
Added 'no STL' support.
2019-11-15 10:14:48 +00:00
John Wellbelove
e8e4fa3f0d Updated unit test project to support C++17 2019-09-28 11:25:25 +01:00
John Wellbelove
1326691a65 Added variadic min and max functions.
etl::multimin
etl::multimin_compare
etl::multimin_iter
etl::multimin_iter_compare
etl::multimax
etl::multimax_compare
etl::multimax_iter
etl::multimax_iter_compare
2019-05-04 22:14:06 +01:00
John Wellbelove
bd008350a2 Merge remote-tracking branch 'origin/feature/changed_include_paths' into development
# Conflicts:
#	include/etl/version.h
2018-07-28 21:55:27 +01:00
John Wellbelove
3fdf3e6b1a Merge remote-tracking branch 'origin/feature/no_stl' into development
# Conflicts:
#	include/etl/private/ivectorpointer.h
#	test/test_vector_pointer.cpp
2018-07-22 20:51:03 +01:00
John Wellbelove
a742749849 Merge branch 'development' 2017-11-01 09:33:17 +00:00
John Wellbelove
667b9e2b15 Added binary_find 2017-07-30 11:25:28 +01:00
John Wellbelove
f29121f252 Additional algorithms. 2017-06-29 17:22:02 +01:00
John Wellbelove
14074ade05 Additional algorithms. 2017-06-28 19:13:12 +01:00