ASTL homeSTL home

Type_alphabet<T, sz>


A type of Sigma based on a type T. All value of the type T are in the Sigma and the mapping is carried out by casting T to unsigned long.


//declare an Sigma based on the type char
typedef Type_alphabet<char> char_alphabet;


Defined in alphabet.h.

Template parameters

Parameter Description Default
T The Type_alphabet's value type: the type of object that is stored in the vector.  
sz (unsigned long)The size of the Sigma 0 =>computed from T

Model of


Type requirements

T must define a cast operator to unsigned long, and unsigned long must be castable to the T type.
T must define << and >> operators in order to use the ASCII input/ouput algorithms (wich is already good if we assume T being a model of alphabet).

Public base classes



Member Where defined Description
Alphabet Sigma The type of object, T, stored in the type_alphabet.
const_iterator Container Const iterator used to iterate through a type_alphabet.
iterator begin() Container Returns an iterator pointing to the beginning of the type_alphabet.
iterator end() Container Returns an iterator pointing to the end of the type_alphabet.
unsigned long size() const Container Returns the size of the type_alphabet.
unsigned long map(a) Sigma Returns the mapped value of a
Alphabet unmap(l) Sigma Return the unmapped equivalent of l

New members