The above macro generates the necessary code to adapt struct_name
or an arbitrary specialization of struct_name
as a model of Random
Access Sequence and Associative
Sequence. The sequence (template_param0)(template_param1)...
declares the names of the template type parameters used. The sequence (specialization_param0)(specialization_param1)... declares the template parameters of the
actual specialization of struct_name
that is adapted as a fusion sequence. The sequence of ([member_typeN,]member_nameN,key_typeN)
tuples declares the type, name and key type of each of the struct members
that are part of the sequence.

When member_typeN is omitted or set to auto, the type is infered with Boost.TypeOf.

The macro should be used at global scope, and struct_name
should be the fully namespace qualified name of the struct to be adapted.

namespacedemo{template<typenameName,typenameAge>structemployee{Namename;Ageage;};}namespacekeys{structname;structage;}// Any instantiated demo::employee is now a Fusion sequence.// It is also an associative sequence with// keys keys::name and keys::age present.BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((Name)(Age),(demo::employee)(Name)(Age),(name,keys::name)(age,keys::age))// Without BOOST_PP_VARIADICS support :BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((Name)(Age),(demo::employee)(Name)(Age),(Name,name,keys::name)(Age,age,keys::age))