Skip to content

product_type_base Compared to std::tuple is inconsistent #106

@mochunshuang

Description

@mochunshuang

old: -> S

template <::std::size_t J, typename S>
   static auto element_get(::beman::execution26::detail::product_type_element<J, S>&& self) noexcept -> S {
       return ::std::move(self.value);
   }

new -> S &&

template <::std::size_t J, typename S>
   static auto element_get(::beman::execution26::detail::product_type_element<J, S>&& self) noexcept  -> S && {
       return ::std::move(self.value);
   }

because

  std::tuple<int, double, std::string> t = {42, 3.14,
                                               std::string("Hello, World!")};
     static_assert(std::is_same_v<decltype(std::get<1>(std::move(t))), double &&>,
                   "get<1> should return double&&"); 
auto t = product_type{ //old version
           42, 3.14, std::string("Hello, World!")};
  static_assert(not std::is_same_v<decltype(std::move(t).get<1>()), double &&>,
                     "get<1> should return double&&");// where inconsistent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions