I need to send some "heavy" types between nodes in tbb::flow::graph (Intel TBB library), ie structure with dynamic arrays within. If I try to create an instance of such structure in one node and send a pointer on it to the other node, I get Access Violation (and this is expected, cause I try to use the data from another thread).
So only way to pass such arguments is to pass them by value using appropriate copy-constructor, isn't it? But then we will waste a lot of time for copying...
UPDATE: πάντα ῥεῖ suggests to use std::unique_ptr to pass such types through nodes. But I'm afraid I don't understand how to implement that. For example, how to use std::unique_ptr with source_node?
UPDATE 2: using std::unique_ptr<> gives C2280 'attempting to reference a deleted function' within flow_graph.h line 287.
So question is still opened.