.working ======= >>>>>>> .merge-right.r57125
![]() |
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.
This metafunction may be specialized to accomodate clients providing Fusion conforming sequences.
<<<<<<< .workingnamespace traits { template<typename Sequence> struct tag_of { typedef unspecified type; }; }<<<<<<< .working
Parameter |
Requirement |
Description |
|---|---|---|
T |
Any type |
The type to query. |
typedef traits::tag_of<T>::type tag;
Return type: Any type.
Semantics: Returns the tag type associated with T.
<<<<<<< .working#include <boost/fusion/support/tag_of.hpp> #include <boost/fusion/include/tag_of.hpp><<<<<<< .working
typedef traits::tag_of<list<> >::type tag1; typedef traits::tag_of<list<int> >::type tag2; typedef traits::tag_of<vector<> >::type tag3; typedef traits::tag_of<vector<int> >::type tag4; =======Example
typedef traits::tag_of<list<> >::type tag1; typedef traits::tag_of<list<int> >::type tag2; typedef traits::tag_of<vector<> >::type tag3; typedef traits::tag_of<vector<int> >::type tag4; >>>>>>> .merge-right.r57125 BOOST_MPL_ASSERT((boost::is_same<tag1, tag2>)); BOOST_MPL_ASSERT((boost::is_same<tag3, tag4>));