
On Wed, Mar 26, 2008 at 9:53 AM, Steven Watanabe <watanabesj@gmail.com> wrote:
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;
Would you mind going over what exactly this is doing? I'm having a hard time wrapping my head around it. The documentation isn't helping much either, as I've never used these before and the descriptions are very confusing. I also didn't see a version of mpl::transform that only took 1 template argument. Is this correct?