
23 Jun
2008
23 Jun
'08
2:01 a.m.
On Jun 22, 2008, at 18:50, Igor R wrote:
if you know the set of types you operate on consider using boost::variant which supports visitor pattern for dispatching of currently stored type.
Besides, if I'm not mistaken, there already exists operator << for boost::variant (which internally performs the visiting)...
Yeah. Using boost::variant looks a little unwieldy, as I'd have to deal with results from the database as complicated boost::variants with at least 5 possibilities, but it would be doable with something as simple as a typedef, I'd guess. Sub-ideal, but may be a reasonable way to do it. - Chris