Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-03-26 10:53:12


AMDG

Robert Dailey wrote:
> I love the logic presented here. boost::variant has always been
> confusing to me, but I took the time just now to read over the
> documentation for it a few times and I get it now. However, the issue
> still remains in how to organize all of my signals. In your example
> you have all of the signals manually typed out into separate
> variables, whereas I would rather have them in some sort of container,
> such as a map.

How about this:

typedef boost::mpl::vector<WalkPacket, ChatPacket, QuestPacket>
packet_types;
typedef boost::mpl::transform<boost::signal1<void, _> >::type signals;
typedef boost::mpl::inherit_linearly<signals, static_visitor<>,
mpl::inherit<_, _> >::type SignalVisitor;

In Christ,
Steven Watanabe


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