rleigh-electradx 62925ec1ad
Changed make_list to take its arguments by forwarding reference (#1528)
make_list was the only make_xxx container factory taking its argument
pack by value rather than by forwarding reference, costing an extra
move per lvalue argument: each lvalue was copy-constructed into the
parameter and then moved into the initializer_list backing array,
where the forwarding-reference signature copies it there directly.
Rvalue prvalue arguments count the same either way in practice, as
copy elision constructs them directly into the by-value parameter.

Change the pack to T&&..., matching make_vector, make_forward_list and
make_indirect_vector. The deduced reference types decay through
common_type, so the element type deduction is unchanged.

Adds tests for const/non-const lvalues of the element type (guarding
against the forward<T> defect fixed for make_array and make_deque),
mixed-type common_type deduction, and an instrumented type counting
copy/move constructions, which fails with the by-value signature (one
extra move per lvalue argument) and passes with the fix.

Also corrects the make_list documentation, which described a
make_array-style signature with an explicit element type parameter
that never matched the implementation.

Verified with clang 22 (C++17): all 93 list tests pass; C++14/20
syntax checks pass.

Note: mixed-type lvalue arguments are affected by a separate
pre-existing defect in etl::common_type (its two-type specialization
recurses with decay<T2> twice instead of decay<T1>, decay<T2>), which
already affects the other common_type-based factories and is being
fixed separately.

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-08-04 10:57:25 +01:00
..
binary Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00
blog Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
callbacks Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
chrono Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
codecs Fix code examples in documentation (#1471) 2026-06-23 18:11:17 +01:00
containers Changed make_list to take its arguments by forwarding reference (#1528) 2026-08-04 10:57:25 +01:00
getting-started Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
IO Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
iterators Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
maths Fix code examples in documentation (#1471) 2026-06-23 18:11:17 +01:00
messaging Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
multi-tasking Documentation updates (#1469) 2026-06-23 18:12:58 +01:00
patterns Fix code examples in documentation (#1471) 2026-06-23 18:11:17 +01:00
pseudo-containers Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00
ranges Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00
releases Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
resourses Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00
source Squashed commit of the following: 2026-07-11 13:02:42 +01:00
state machines Hotfix/documentation updates (#1456) 2026-06-08 08:58:47 +01:00
strings Format user defined types in format.h (#1470) 2026-06-24 11:27:53 +02:00
timers Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
tutorials Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
types Add etl::apply (#1509) 2026-07-16 09:15:24 +01:00
utilities Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
_index.md Various fixes and cleanup (#1507) 2026-07-20 11:19:41 +02:00
about.md Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00
Is the ETL free.md Issue/add hugo support for documentation (#1449) 2026-06-06 13:12:44 +01:00