i've just started to work with TBB. Have to say it looks very nice, however I ran into the following issue. Using a lambda with std::shared_ptr does not seem to work.
source_node<int>(g,[&](int& val) -> bool {val = 0; return true;},false);
source_node<std::shared_ptr<int>(g,[&](std::shared_ptr<int> val) -> bool {val = std::make_shared<int>(0);return true;},false);
with the following compile error:
error: C2665: 'std::shared_ptr<int>::shared_ptr' : none of the 5 overloads could convert all the argument types
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\memory(504): could be 'std::shared_ptr<int>::shared_ptr<main::<lambda_484cee4d4b0231890bebaeba94e0ddad>,bool>(std::nullptr_t,_Dx,_Alloc)'
with
[
_Dx=main::<lambda_484cee4d4b0231890bebaeba94e0ddad>
]
basically the int has been replaced with std::shared_ptr.
Any ideas would be apreciated!
regards Auke
Thanx Mike Seymour
source_node<std::shared_ptr<int>>(g,[&](std::shared_ptr<int> val) -> bool {val = std::make_shared<int>(0);return true;},false);