promise move assignment operator is missing

Issue #141 resolved
Dan Bonachea created an issue

C++ concepts speced for promise include MoveAssignable - however this operator is missing from the current implementation.

This deficiency makes it more awkward to correctly "re-init" a promise stored in statically in application-owned memory (where re-construction is not appropriate/sufficient, and where we want to elide the cost/complexity of dynamic allocation).

We need to determine whether this omission was intentional: if so what's the reason, if not are there any technical challenges to adding it?

Either way we currently have a compliance violation that needs to be resolved in the implementation and/or spec.

Comments (3)

  1. Dan Bonachea reporter

    A test that demonstrates the problem, with a toy example (conceptually based on Brian's Cannon code) motivating why it's needed.

    Current failure:

    issue141.cpp: In function 'int main()':
    issue141.cpp:39:17: error: use of deleted function 'upcxx::promise<>& upcxx::promise<>::operator=(const upcxx::promise<>&)'
             p[step] = std::move(tmp);
                     ^
    In file included from /home/bonachea/UPC/inst-upcxx/upcxx.debug.gasnet_seq.udp/include/upcxx/future.hpp:9:0,
                     from /home/bonachea/UPC/inst-upcxx/upcxx.debug.gasnet_seq.udp/include/upcxx/backend.hpp:9,
                     from /home/bonachea/UPC/inst-upcxx/upcxx.debug.gasnet_seq.udp/include/upcxx/allocate.hpp:8,
                     from /home/bonachea/UPC/inst-upcxx/upcxx.debug.gasnet_seq.udp/include/upcxx/upcxx.hpp:8,
                     from issue141.cpp:1:
    /home/bonachea/UPC/inst-upcxx/upcxx.debug.gasnet_seq.udp/include/upcxx/future/promise.hpp:32:9: note: 'upcxx::promise<>& upcxx::promise<>::operator=(const upcxx::promise<>&)' is implicitly declared as deleted because 'upcxx::promise<>' declares a move constructor or move assignment operator
       class promise:
    
  2. Log in to comment