Public Types | Public Member Functions | List of all members
util::TaggedType< T, Tag > Struct Template Reference

A type with a specified tag. More...

#include <TupleLookupByTag.h>

Inheritance diagram for util::TaggedType< T, Tag >:

Public Types

using tag = Tag
 Tag of this object. More...
 
using tagged_type = T
 Type of the object which was tagged. More...
 

Public Member Functions

template<typename... Args>
 TaggedType (Args &&...args)
 

Detailed Description

template<typename T, typename Tag>
struct util::TaggedType< T, Tag >

A type with a specified tag.

Template Parameters
Tthe base type being tagged
Tagthe tag to be assigned to the new type
See also
add_tag, TagExtractor

The new type TaggedType<T, Tag> inherits from T (including its constructors) and adds (and hides existing) tag type with value Tag. This type is suitable to be used in the tag-related traits.

For example:

struct VectorTag {};
using TaggedVector = TaggedType<std::vector<int>, VectorTag>;

Definition at line 597 of file TupleLookupByTag.h.

Member Typedef Documentation

template<typename T, typename Tag>
using util::TaggedType< T, Tag >::tag = Tag

Tag of this object.

Definition at line 603 of file TupleLookupByTag.h.

template<typename T, typename Tag>
using util::TaggedType< T, Tag >::tagged_type = T

Type of the object which was tagged.

Definition at line 604 of file TupleLookupByTag.h.

Constructor & Destructor Documentation

template<typename T, typename Tag>
template<typename... Args>
util::TaggedType< T, Tag >::TaggedType ( Args &&...  args)
inline

Definition at line 601 of file TupleLookupByTag.h.

601 : T(std::forward<Args>(args)...) {}
static QCString args
Definition: declinfo.cpp:674

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