<<<<<<< .working ======= >>>>>>> .merge-right.r57125
Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
<<<<<<< .working

tag_of

Description

=======
Description
>>>>>>> .merge-right.r57125

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.

<<<<<<< .working

Synopsis

=======
Synopsis
>>>>>>> .merge-right.r57125
namespace traits
{
    template<typename Sequence>
    struct tag_of
    {
        typedef unspecified type;
    };
}
<<<<<<< .working

Parameters

=======
Parameters
>>>>>>> .merge-right.r57125

Parameter

Requirement

Description

T

Any type

The type to query.

<<<<<<< .working

Expression Semantics

=======
Expression Semantics
>>>>>>> .merge-right.r57125
typedef traits::tag_of<T>::type tag;

Return type: Any type.

Semantics: Returns the tag type associated with T.

<<<<<<< .working

Header

=======
Header
>>>>>>> .merge-right.r57125
#include <boost/fusion/support/tag_of.hpp>
#include <boost/fusion/include/tag_of.hpp>
<<<<<<< .working

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;
=======
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>));

PrevUpHomeNext