# ConceptFiniteOrderedAlphabetConceptAn type that is of finite domain and totally ordered and thus has a minimum and maximum value.

Extends OrderedAlphabetConcept AlphabetConcept, AssignableConcept, ComparableConcept, CopyConstructibleConcept, DefaultConstructibleConcept, EqualityComparableConcept, LessThanComparableConcept, OrderedAlphabetConcept

## Member Function Overview

### Member Functions Inherited From AssignableConcept

• `operator=`

### Member Functions Inherited From ComparableConcept

• `operator>`

### Member Functions Inherited From EqualityComparableConcept

• `operator!=`
• `operator==`

### Member Functions Inherited From LessThanComparableConcept

• `operator<`

### Member Functions Inherited From OrderedAlphabetConcept

• `operator<`

## Interface Function Overview

• `T ordValue(value);`
Maps an alphabet 1-to-1 to the interval [0..ValueSize).
• `T1 valueSize<T2>();`
Returns size of an alphabet.

### Interface Functions Inherited From AssignableConcept

• `assign`
• `move`
• `set`

### Interface Functions Inherited From ComparableConcept

• `operator<=`
• `operator>=`

### Interface Functions Inherited From OrderedAlphabetConcept

• `infimumValueImpl`
• `maxValue`
• `minValue`
• `supremumValueImpl`

## Interface Metafunction Overview

• `ValueSize<T>::Type;, ValueSize<T>::VALUE;`
Number of different values a value type object can have.

### Interface Metafunctions Inherited From AlphabetConcept

• `BitsPerValue`

### Interface Metafunctions Inherited From OrderedAlphabetConcept

• `MaxValue`
• `MinValue`

## Interface Functions Detail

### `T ordValue(value);`

Maps an alphabet 1-to-1 to the interval [0..ValueSize).

#### Parameters

 `value` Arbitrary character value. Types: SimpleType

#### Returns

`T` An unsigned value (result of Size between 0 and ValueSize of the type of value.

This function first converts value to its unsigned value type and after that to an unsigned int. You can't use (unsigned int)c for a character c as on some systems char is signed and a -1 would be mapped to 0xffffffff instead of 0x000000ff.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `T1 valueSize<T2>();`

Returns size of an alphabet.

#### Template Parameters

`T2` Type to query for value size.

#### Returns

`T1` Number of values in type T2.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Interface Metafunctions Detail

### ```ValueSize<T>::Type; ValueSize<T>::VALUE;```

Number of different values a value type object can have.

#### Template Parameters

`T` A type to query for its value size.

#### Returns

`VALUE` The number of different values a value of type T can have. The type is Type. The type of the result VALUE.

This function is only defined for integral types like unsigned, int, or Dna. For floating point numbers and the 64 bit types int64_t and uint64_t, it returns 0 since there is no standard compliant way to return the number of values for these types.

Note that you cannot get pointers or references to ValueSize<T>::VALUE in your program. You can use valueSize in your programs without problems, though. When you get problems in your tests, use the "unary plus" workaround from the examples section.

#### Examples

The temporary assignment workaround.

```SEQAN_ASSERT_EQ(ValueSize<bool>::VALUE, 2u);    // Linker error.
SEQAN_ASSERT_EQ(+ValueSize<bool>::VALUE, 2u);   // OK
SEQAN_ASSERT_EQ(valueSize<bool>(), 2u);         // OK
```