Boost C++ Libraries Boost.Bimap Home Libraries People FAQ More

PrevUpHomeNext

tagged Struct Template Reference

The tag holder. More...

#include <tagged.hpp>

List of all members.

Public Types

typedef Tag tag
typedef Type value_type


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.

Definition at line 81 of file tagged.hpp.


The documentation for this struct was generated from the following file:
Copyright 2006 Matias Capeletto

PrevUpHomeNext