Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::bimaps::tags::tagged< Type, Tag > Struct Template Reference

The tag holder. More...

#include <tagged.hpp>

Public Types

typedef Type value_type
 
typedef Tag tag
 

Detailed Description

template<class Type, class Tag>
struct boost::bimaps::tags::tagged< Type, Tag >

The tag holder.

The idea is to add a level of indirection to the type being tagged. With this class you wrapped a type and apply a tag to it. The only thing to remember is that if you write

typedef tagged<type,tag> taggedType;

Then instead to use directly the tagged type, in order to access it you have to write taggedType::value_type. The tag can be obtained using taggedType::tag. The idea is not to use this metadata directly but rather using the metafunctions that are defined in the support namespace. With this metafunctions you can work with tagged and untagged types in a consistent way. For example, the following code is valid:

BOOST_STATIC_ASSERT( is_same< value_type_of<taggedType>, value_type_of<type> >::value );

The are other useful metafunctions there too. See also value_type_of, tag_of, is_tagged, apply_to_value_type.

Member Typedef Documentation

template<class Type , class Tag >
typedef Tag boost::bimaps::tags::tagged< Type, Tag >::tag
template<class Type , class Tag >
typedef Type boost::bimaps::tags::tagged< Type, Tag >::value_type

The documentation for this struct was generated from the following file: