Boost Users :
From: Chris Ross (cross+boost_at_[hidden])
Date: 2008-06-22 22:01:34
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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net