Boost logo

Boost Users :

From: Jeffrey A. Edlund (jedlund_at_[hidden])
Date: 2008-04-10 01:59:31


On Thu, 10 Apr 2008 07:21:08 +0200
Olaf Peter <ope-devel_at_[hidden]> wrote:

> Thank you Jeffrey.
>
> > typedef boost::variant<double, bool> double_variant;
> > typedef boost::tuple<double_variant,double_variant> double_tuple;
> ...
> > std::ostream& operator<<( std::ostream& os, const double_variant& p )
> > {
> > output_visitor out_v(os);
> > boost::apply_visitor(out_v,p);
> > return os;
> > }
> ...
>
> This works, but is there a generic way without global typedefs?

You don't have to use the typedefs. Just replace double_variant with boost::variant<double, bool> and double_tuple with boost::tuple<double_variant,double_variant>. Is that what you were asking?

Jeffrey


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