
21 Jul
2006
21 Jul
'06
3:51 p.m.
Dave Dribin wrote :
Sometimes these things use unions. It's not necessarily an old C feature.
Have you looked at boost.variant ? It allows similar semantic functionality.
What's ugly?
It's an illegimate use of a factory. According to the RAII idiom, the resource should be acquired through its constructor. However I admit I don't know how it fits with (un)serialization of binary files.