Commit a3f0ad65 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

reduce: fixed the Result type in case the fetch functor returns a reference

parent 72ad8e30
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ auto reduce( const Index begin,
             Fetch&& fetch,
             Reduction&& reduction )
{
   using Result = decltype( fetch( ( Index ) 0 ) );
   using Result = std::decay_t< decltype( fetch( 0 ) ) >;
   return detail::Reduction< Device >::reduce( begin,
                                               end,
                                               std::forward< Fetch >( fetch ),
@@ -250,7 +250,7 @@ reduceWithArgument( const Index begin,
                    Fetch&& fetch,
                    Reduction&& reduction )
{
   using Result = decltype( fetch( ( Index ) 0 ) );
   using Result = std::decay_t< decltype( fetch( 0 ) ) >;
   return detail::Reduction< Device >::reduceWithArgument( begin,
                                                           end,
                                                           std::forward< Fetch >( fetch ),