4 ms·
Can you please point out what about Buckaroo's (i.e., the author's) solution is wrong? I take it, his version of Either is copied from the neither project [1],
by fnl 9y ago
Can you please point out what about Buckaroo's (i.e., the author's) solution is wrong? I take it, his version of Either is copied from the neither project [1], so the destructor of the union is:
~Either() {
if(isLeft) {
leftValue.~L();
} else {
rightValue.~R();
}
}
Which does explicitly call the destructors. (Obviously, if you only were referring to his eight-line toy version of Either for the blog, please forget my comment.)
[EDIT: re-reading your comment once more, I see you did indeed mean the blog implementation; please ignore this comment.]
[EDIT2: BTW, it seems the author is "affiliated" with that LoopPerfect/neither implementation.]
[1] https://github.com/LoopPerfect/neither/blob/master/neither/include/either.hpp https://github.com/LoopPerfect/neither/blob/master/neither/i...