...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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.
namespace traits { template<typename Sequence> struct tag_of { typedef unspecified type; }; }
Parameter |
Requirement |
Description |
---|---|---|
|
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
.
#include <boost/fusion/support/tag_of.hpp> #include <boost/fusion/include/tag_of.hpp>
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; BOOST_MPL_ASSERT((boost::is_same<tag1, tag2>)); BOOST_MPL_ASSERT((boost::is_same<tag3, tag4>));