template <typename T, typename U>
struct exapand_utf : std::integral_constant<std::size_t, /* see table */>
T
is an 8, 16, or 32 bit integral type for a UTF code pointU
is an 8, 16, or 32 bit integral type for a UTF code point
value
is the maximum expansion when converting a UTF sequence fromT
toU
determined by the following table:
source/result | UTF-8 | UTF-16 | UTF-32 |
---|---|---|---|
UTF-8 | 1 | 1 | 1 |
UTF-16 | 3 | 1 | 1 |
UTF-32 | 4 | 2 | 1 |
see copy_utf
template <typename T, typename I, typename O>
O copy_utf(I f, I l, O o);
template <typename T, typename R, typename O>
O copy_utf(const R& r, O o);
copy_utf
copies the text from the range [f, l)
from UTF-8, 16, or 32 to UTF-8, 16
or 32 and assigns the result to *o
.
T
must be 8, 16, or 32 bit integral typeI
modelsInputIterator
;value_type(I)
must be 8, 16, or 32 bit integral typeO
modelsOutputIterator
; must acceptT
[f, l)
is a valid range of UTF-8, 16, or 32 encode texto
is not an iterator within the range[f, l)
- There is enough space to hold the text being copied. The maximum
requirement on the output is that
[o, o + m(l - f))
is a valid range wherem
isexpand_utf<value_type(I), T>::value
If the source contains an invalid or partial encoding then the output is undefined (debug builds may assert). However, the code will not read beyond the specified source range or output more than the maximum number of elements.
An output iterator pointing to the end of the encoded text.