- changed status to wontfix
Consider adding structured binding support to futures
Issue #571
wontfix
Split off from documentation issue #469:
The C++ standard specifies that structured bindings can use get<i>(e)
, found by ADL, to enable structured bindings for a custom class. By providing this function in the upcxx
namespace for upcxx::future
or as a hidden friend in upcxx::future
, we can enable this functionality for UPC++ futures.
upcxx::future<int,double> fut = /* ... */;
auto [a,b] = fut;
Comments (1)
-
reporter - Log in to comment
In the 2023-02-21 meeting discussion, we decided not to pursue this idea, which seems likely to degrade readability (e.g. result vs wait), and at best just saves a few characters of typing relative to calling the appropriate
wait*
orresult*
member function on thefut
object (the best choice depends on the synchronization state and whether the caller wants the new variablesa
,b
to be const references or copies).