Skip to content

Conversation

rolandreichweinbmw
Copy link
Contributor

@rolandreichweinbmw rolandreichweinbmw commented Jun 4, 2025

When the move ctors of etl::tuple are in use, typical compile error is:

include/etl/tuple.h:336:19: error: no matching function for call to 'forward'
      : base_type(etl::forward<tuple<UHead, UTail...>>(other.get_base()))
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/etl/utility.h:63:17: note: candidate function template not viable: cannot bind base class object of type 'etl::tuple<unsigned long, unsigned int, double>::base_type' (aka 'tuple<unsigned int, double>') to derived class reference 'typename etl::remove_reference<tuple<unsigned long, unsigned int, double>>::type &' (aka 'etl::tuple<unsigned long, unsigned int, double> &') for 1st argument
  constexpr T&& forward(typename etl::remove_reference<T>::type& t) ETL_NOEXCEPT
                ^
../../include/etl/utility.h:69:17: note: candidate function template not viable: no known conversion from 'tuple<unsigned int, double, (no argument)>' to 'tuple<unsigned long, unsigned int, double>' for 1st argument
  constexpr T&& forward(typename etl::remove_reference<T>::type&& t) ETL_NOEXCEPT
                ^

This is fixed by this PR.

@jwellbelove jwellbelove changed the base branch from master to development June 5, 2025 08:54
@jwellbelove jwellbelove merged commit e2f2a39 into ETLCPP:development Jun 5, 2025
82 checks passed
@jwellbelove
Copy link
Contributor

The unit tests for these move constructors were missing.
When I added them, I had to modify the const&& parameter types
from

ETL_CONSTEXPR14
tuple(const tuple<UHead, UTail...>&& other)
  : base_type(etl::forward<tuple<UHead, UTail...>>(other.get_base()))
  , value(etl::forward<UHead>(other.get_value()))
{
}

to

ETL_CONSTEXPR14
tuple(const tuple<UHead, UTail...>&& other)
  : base_type(other.get_base())
  , value(other.get_value())
{
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants