-
Notifications
You must be signed in to change notification settings - Fork 116
Introduce variadic constructor for key_matching join_node #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Introduce variadic constructor for key_matching join_node #652
Conversation
| Creates a ``join_node`` that uses the function objects ``b0``, ``b1``, ... , ``bN`` to determine | ||
| the tags for the input ports ``0`` through ``N``. | ||
|
|
||
| **Constraints:**: only participates in overload resolution if ``std::tuple_size<OutputTuple>::value`` is ``2 + sizeof...(BN)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing this constraint changes can change the behavior for the existing code.
The design of the key_matching join_node implies that the number of argument is equivalent to the number of elements in the tuple.
oneTBB implementation generates a compile-time error if it is not the case. With this constraint, this overload would not participate in overload resolution, that will be different compiler-time error in most cases.
| template <typename B0, typename... BN> | ||
| join_node( graph &g, B0 b0, BN... bn ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we consider adding this constructor as a breaking change, the alternative is to keep the "old" set of constructors and introduce the variadic constructor to handle cases when number of elements is more than 10.
Existing constructors will match better for 2-10 arguments and the old behavior is guaranteed to be preserved.
But on the other hand, a set of existing constructors will be generated from a variadic by the compiler and the only difference in the behavior is the constraint (that can be omitted if we consider it breaking).
|
As we discussed, the current definition of constructors in the specification is incorrect, as the only working scenario occurs when the number of arguments exactly matches the number of elements in the tuple. The existing oneTBB implementation results in compilation error when there is a mismatch. A variadic constructor without constraints would not introduce breaking changes but it would also not resolve the issue described above. When the constraint is added (see the same example compiled with The same constructor cannot be implemented using |
No description provided.