clause icon indicating copy to clipboard operation
clause copied to clipboard

Comma operators in declpack over +=

Open irrequietus opened this issue 8 years ago • 1 comments

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.

irrequietus avatar Oct 25 '16 17:10 irrequietus

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.

irrequietus avatar Oct 25 '16 18:10 irrequietus