Boost logo

Boost Users :

Subject: [Boost-users] [mpl] Safe to instantiate mpl classes for tag-dispatch-by-instance?
From: Gabriel Redner (gredner_at_[hidden])
Date: 2011-08-09 14:50:38


Hi all,

Say I have a functor which accepts a tag instance:

struct tagA {};
struct tagB {};

struct MyFunc
{
  template <typename TTag>
  void operator()(TTag, int other_stuff) {...}
};

In some cases I want to pass multiple tags at once. Is it safe to
just instantiate mpl::pair, mpl::vector, etc. and use them for this
purpose, since from a runtime perspective they're just empty classes?
Or, is this a Bad Idea for some reason?

Thanks,
-Gabe


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