10 Dec
2013
10 Dec
'13
5:32 p.m.
On Tue, Dec 10, 2013 at 5:54 AM, Andrey Semashev
I think that case would better be handled by variant<blank>. I.e. you can replace void return types with blank and the rest of the code can be left intact.
While that is the current workaround, I look at it as exactly that -- a work-around. It just seems very arbitrary to me and only makes it so that people have to special-case for a logical variant<> in metaprogrammed code. As Peter Dimov also pointed out, variant<> seems to be just as valid as a union {}, and I think most people would expect it to work pretty much the same way. I also don't think we'd lose anything by simply supporting it and the implementation would be trivial. -- -Matt Calabrese