
15 Apr
2012
15 Apr
'12
2:26 p.m.
On 15/04/12 15:41, Florian Goujeon wrote:
On 04/15/2012 03:02 PM, paul Fultz wrote:
Do you have the code posted online somewhere?
Yes I do: https://github.com/fgoujeon/scalpel/tree/master/src/scalpel/utility/variant
This implementation is based on a fixed-size stack-based any container (any_container.hpp). I think it's annoying because it breaks the anti-aliasing rule. But I'll let you judge.
You use nested ifs, not as good as a switch. Also, the special code to deal with visitors that return void seems entirely unnecessary. As for any_container.hpp, the clear_and_set stuff (which I suppose you use in operator=) is very wrong. You're literally copying an object to a different location and calling the destructor there.