Rainer Deyke wrote:
Andrei Alexandrescu wrote:
- make front() and back() for UTF-8 and UTF-16 automatically decode the
first and last Unicode character

- make popFront() and popBack() skip one entire Unicode character
(instead of just one code unit)

- alter isRandomAccessRange to return false for UTF-8 and UTF-16 strings

- change hasLength to return false for UTF-8 and UTF-16 strings

These are all fine for a dedicated string type.  They're horrible for
generic arrays, for the following reasons:
  - They break generic code.
  - They make it impossible to manipulate an array of code units as an
array of code units.

Arrays of char and wchar are not quite generic - they are definitely UTF strings.

Andrei

Reply via email to