clause
clause copied to clipboard
Comma operators in declpack over +=
The overloaded comma operator in declpack
makes it useful for concatenating different declpack
instantiations as well as individual types to newly combined packs. There are cases where this can be of use when creating a new pack by multiple subpacks or while one takes advantage of regular pack expansion semantics in combination with comma operators. This issue is about studying whether a +=
operator would be better to a ,
one.
Unconvinced on whether this behavior should change given semantics of evaluation involved; the other option is to deploy another construct that defaults to a decltype(A,B)
behaviour where A
is the declpack
-like expression that behaves exactly like declpack
minus the comma operator semantics. The precedent for this is in the templify
assistant that wraps around e.g. a declpack((T...){}[] |= as_template_of<std::tuple>)
for a std::tuple<T...>
instantiation.