On 04/04/2015 05:49 PM, Steven Watanabe wrote:
AMDG
On 04/04/2015 04:33 PM, Larry Evans wrote:
On 04/04/2015 05:08 PM, Matt Calabrese wrote:
On Sat, Apr 4, 2015 at 3:06 PM, Matt Calabrese
wrote: You need to use a recursive union if you are to get some constexpr support.
Well, let me rephrase, you can expand it out by preprocessor to a certain limit and get that too, but you can't just use aligned storage. At some point you need to hit a recursive case.
Could you please elaborate on why recursion cannot be avoided?
Variadic parameter packs can't be expanded on class (or in this case union) members.
template
union variant_storage { T t;... // illegal }; In Christ, Steven Watanabe
Matt said aligned storage can't be used; hence, I assume he meant that the required alignment for the aligned storage would require recursion, but that would be constexpr template *function* recursion not template struct or union recursion. Hence, I suppose Matt meant the recursion requirement was for functions not commposites (e.g. struct or union). Matt?