Literals¶
This file contains the documentation for literal operator"" _w.
-
namespace literals¶
Functions
-
word_type operator""_w(const char *w, size_t n)¶
Literal for defining word_type over integers less than 10.
This operator provides a convenient brief means of constructing a word_type from an sequence of literal integer digits or a string. For example,
0123_wproduces the same output asword_type({0, 1, 2, 3}).There are some gotchas and this operator should be used with some care:
the parameter
wmust only consist of the integers \(\{0, \ldots, 9\}\). For example, there are no guarantees about the value of"abc"_w.if
wstarts with0and is follows by a value greater than7, then it is necessary to enclosewin quotes. For example,08_wwill not compile because it is interpreted as an invalid octal. However"08"_wbehaves as expected.
Warning
This operator performs no checks on its arguments whatsoever.
- Parameters:
w – the letters of the word
n – the length of
w(defaults to the length ofw)
- Throws:
(None) – This function guarantees not to throw a
LibsemigroupsException.- Returns:
A value of type word_type.
-
word_type operator""_w(const char *w, size_t n)¶