Tag
Tag
Template for tag definition.
Include Headers
seqan/basic.h
Parameters
Any parameter less types. |
Remarks
This struct is defined such that parameter less tags are easier recognizeable.
This is best explained with the example below.
Functions
Returns file format extensions given a format tag. |
Examples
Usually, tags are defined in the following way.
typedef Tag<SomeTag_> SomeTag;
They are then used as follows.
void f(T const & x, SomeTag const & tag)
{
// ...
}
// Somewhere else:
f(3, SomeTag());
This has the advantages that (1) the type of tag parameters is printed as Tag<SomeTag_> in compiler error traces.
Furthermore, (2) parameter less tags can be defined redundantly in multiple headers and we can still instantiate them anywhere where they are declared.
The latter (2) cannot be achieved with only forward declaration (struct SomeTag; ) or full declarations (struct SomeTag {}; ) everywhere.
SeqAn - Sequence Analysis Library - www.seqan.de