Skip to content

Conversation

@ITHelpDec
Copy link

Two changes are needed to get this code to compile:

  1. Change line 60 from return last to return (this is a void function, we our not returning an _OutputIterator
  2. Make addend a constant reference at line 27

One further change required to stop the code from crashing at runtime.

  1. Complete the join_threadsclass

  * "Void function 'parallel_partial_sum<std::__wrap_iter<int *>>' should not return a value"
  * example from book is actually simple `return`
  * "Non-const lvalue reference to type 'value_type' (aka 'int') cannot bind to a temporary of type 'int'"
  * simple fix making the lvalue reference const
  * "Thread 1: signal SIGABRT"
  * code will crash with current implementation
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.

1 participant