peek

Takes an array of word ushort and converts the first T.sizeof / 2 word to T. The array is not consumed.

  1. T peek(ushort[] words)
    T
    peek
    (
    T
    )
    (
    ushort[] words
    )
  2. T peek(ushort[] words, size_t index)

Parameters

T

The integral type to convert the first T.sizeof / 2 words to.

words
Type: ushort[]

The array of word to convert

Examples

1 ushort[] words = [0x645A, 0x3ffb];
2 assert(words.peek!float == 1.964F);
3 assert(words.length == 2);
4 
5 ushort[] odd = [0x645A, 0x3ffb, 0xffaa];
6 assert(odd.peek!float == 1.964F);
7 assert(odd.length == 3);

Meta