Я вот как-то так делаю. Идея в том, что каждый микс наследует базу и все предыдущие.
using boost::mpl::fold;
using boost::mpl::vector;
using boost::mpl::quote1;
using boost::mpl::quote2;
using boost::mpl::bind2;
using boost::mpl::apply_wrap1;
using boost::mpl::placeholders::_1;
using boost::mpl::placeholders::_2;
using boost::mpl::is_sequence;
template
<
typename Comp,
typename T,
typename Owner,
unsigned int PropId_ = 0
>
class component_base;
template
<
typename T,
typename Owner,
typename Mixes,
unsigned int PropId_ = 0
>
class component_t : public
fold
<
Mixes,
component_base
<
component_t<T, Owner, Mixes, PropId_>,
T, Owner, PropId_
>,
apply_wrap1<_2, _1>
>::type
{
private:
static_assert(is_sequence<Mixes>::value, "Must be an MPL sequence.");
friend comp_accessor;
using inherited = typename
fold
<
Mixes,
component_base
<
component_t<T, Owner, Mixes, PropId_>,
T, Owner, PropId_
>,
apply_wrap1<_2, _1>
>::type;
public:
using inherited::inherited;
};
template <char const *Str_>
struct str_wrp
{
static char const *value() { return Str_; }
};
template <typename T, typename Owner, char const *NetnodeName_, unsigned int PropId_ = 0>
using noevent_pst_comp_t = component_t
<
T, Owner,
vector<bind2<quote2<persist_mix>, _1, str_wrp<NetnodeName_>>>
>;
Здравствуйте, gencoder, Вы писали: