![]() |
Home | Libraries | People | FAQ | More |
All conforming Fusion sequences and iterators have an associated tag type. The purpose of the tag is to enable tag dispatching from Intrinsic functions to implementations appropriate for the type. The default implementation of tag_of returns T::fusion_tag for a given type T, if such a member typedef exists.
This metafunction may be specialized to accomodate clients providing Fusion conforming sequences.
namespace traits { template<typename Sequence> struct tag_of { typedef unspecified type; }; }
namespace traits { template<typename Sequence> struct tag_of { typedef unspecified type; }; } [heading Parameters]
typedef traits::tag_of<T>::type tag;
Return type: Any type.
Semantics: Returns the tag type associated with T.
#include <boost/fusion/support/tag_of.hpp>
typedef traits::is_sequence<list<> tag1; typedef traits::is_sequence<list<int> > tag2; typedef traits::is_sequence<vector<> > tag3; typedef traits::is_sequence<vector<int> > tag4; BOOST_MPL_ASSERT((boost::is_same<tag1, tag2>)); BOOST_MPL_ASSERT((boost::is_same<tag3, tag4>));
| Copyright © 2001-2005 Joel de Guzman, Dan Marsden |