{"id":13730269,"url":"https://github.com/tahonermann/text_view","last_synced_at":"2025-06-26T05:02:03.710Z","repository":{"id":133857741,"uuid":"41640449","full_name":"tahonermann/text_view","owner":"tahonermann","description":"A C++ concepts and range based character encoding and code point enumeration library","archived":false,"fork":false,"pushed_at":"2017-11-11T05:25:56.000Z","size":856,"stargazers_count":122,"open_issues_count":18,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-19T06:48:48.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tahonermann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-08-30T19:30:17.000Z","updated_at":"2025-06-13T20:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"f263173f-9ace-4bf9-86bb-70e53bad0b31","html_url":"https://github.com/tahonermann/text_view","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tahonermann/text_view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tahonermann","download_url":"https://codeload.github.com/tahonermann/text_view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tahonermann%2Ftext_view/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262003914,"owners_count":23243345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:12.507Z","updated_at":"2025-06-26T05:02:03.624Z","avatar_url":"https://github.com/tahonermann.png","language":"C++","readme":"[![Travis Build Status](https://travis-ci.org/tahonermann/text_view.svg?branch=master)](https://travis-ci.org/tahonermann/text_view)\nTravis CI (Linux:gcc)\n\n[![codecov](https://codecov.io/gh/tahonermann/text_view/branch/master/graph/badge.svg)](https://codecov.io/gh/tahonermann/text_view)\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\n# [Text_view]\nA [C++ Concepts][ISO/IEC 19217:2015]\nbased character encoding and code point enumeration library.\n\nThis project is the reference implementation for proposal [P0244] for the C++\nstandard.\n\nThis port of [Text_view] requires a C++17 conforming compiler that implements\n[ISO/IEC technical specification 19217:2015, **C++ Extensions for concepts**\n][ISO/IEC 19217:2015].  A port of [Text_view] that builds with C++11 conforming\ncompilers is available at [Text_view for range-v3][Text_view-range-v3].\n\nFor discussion of this project, please post and/or subscribe to the\n`text_view@googlegroups.com` group hosted at\nhttps://groups.google.com/d/forum/text_view\n\n- [Overview](#overview)\n- [Current features and limitations](#current-features-and-limitations)\n- [Requirements](#requirements)\n- [Build and installation](#build-and-installation)\n  - [Building and installing gcc](#building-and-installing-gcc)\n  - [Building and installing cmcstl2](#building-and-installing-cmcstl2)\n  - [Building and installing Text_view](#building-and-installing-text_view)\n- [Usage](#usage)\n  - [Header \u0026lt;experimental/text_view\u0026gt; synopsis](#header-experimentaltext_view-synopsis)\n  - [Concepts](#concepts)\n  - [Error Policies](#error-policies)\n  - [Error Status](#error-status)\n  - [Exceptions](#exceptions)\n  - [Type traits](#type-traits)\n  - [Character sets](#character-sets)\n  - [Character set identification](#character-set-identification)\n  - [Character set information](#character-set-information)\n  - [Characters](#characters)\n  - [Encodings](#encodings)\n  - [Text iterators](#text-iterators)\n  - [Text view](#text-view)\n- [Supported Encodings](#supported-encodings)\n- [Terminology](#terminology)\n  - [Code Unit](#code-unit)\n  - [Code Point](#code-point)\n  - [Character Set](#character-set)\n  - [Character](#character)\n  - [Encoding](#encoding)\n- [References](#references)\n\n# Overview\n[C++11][ISO/IEC 14882:2011] added support for new character types ([N2249]) and\n[Unicode] string literals ([N2442]), but neither [C++11][ISO/IEC 14882:2011],\nnor more recent standards have provided means of efficiently and conveniently\nenumerating [code points](#code-point) in [Unicode] or legacy encodings.  While\nit is possible to implement such enumeration using interfaces provided in the\nstandard `\u003ccodecvt\u003e` library, doing to is awkward, requires that text be\nprovided as pointers to contiguous memory, and inefficent due to virtual\nfunction call overhead (__examples and data required to back up these\nassertions__).\n\n[Text_view] provides iterator and range based interfaces for encoding and\ndecoding strings in a variety of [character encodings](#encoding).  The\ninterface is intended to support all modern and legacy\n[character encodings](#encoding), though this library does not yet provide\nimplementations for legacy [encodings](#encoding).\n\nAn example usage follows.  Note that `\\u00F8` (LATIN SMALL LETTER O WITH STROKE)\nis encoded as UTF-8 using two [code units](#code-unit) (`\\xC3\\xB8`), but\niterator based enumeration sees just the single [code point](#code-point).\n\n```C++\nusing CT = utf8_encoding::character_type;\nauto tv = make_text_view\u003cutf8_encoding\u003e(u8\"J\\u00F8erg is my friend\");\nauto it = tv.begin();\nassert(*it++ == CT{0x004A}); // 'J'\nassert(*it++ == CT{0x00F8}); // 'ø'\nassert(*it++ == CT{0x0065}); // 'e'\n```\n\nThe iterators and ranges that [Text_view] provides are compatible with the\nnon-modifying sequence utilities provided by the standard C++ `\u003calgorithm\u003e`\nlibrary.  This enables use of standard algorithms to search encoded text.\n\n```C++\nit = std::find(tv.begin(), tv.end(), CT{0x00F8});\nassert(it != tv.end());\n```\n\nThe iterators provided by [Text_view] also provide access to the underlying\n[code unit](#code-unit) sequence.\n\n```C++\nauto base_it = it.base_range().begin();\nassert(*base_it++ == '\\xC3');\nassert(*base_it++ == '\\xB8');\nassert(base_it == it.base_range().end());\n```\n\n[Text_view] ranges satisfy the requirements for use in\n[C++11][ISO/IEC 14882:2011] range-based for statements with the removed\nsame type restriction for the begin and end expressions provided by [P0184R0]\nas adopted for C++17.\n\n```C++\nfor (const auto \u0026ch : tv) {\n  ...\n}\n```\n\n# Current features and limitations\n[Text_view] provides interfaces for the following:\n- Encoding and decoding of text for the [encodings](#encoding) listed in\n  [supported encodings](#supported-encodings).\n- Encoding text using [C++11][ISO/IEC 14882:2011] compliant output iterators.\n- Decoding text using input, forward, bidirectional, and random access\n  iterators that are compliant with standard iterator requirements as specified\n  in the [ranges proposal][N4560].\n- Constructing view adapters for encoded text stored in arrays, containers,\n  or std::basic_string, or referenced by another range or view.  These view\n  adapters meet the requirements for views in the [ranges proposal][N4560].\n\n[Text_view] does **not** currently provide interfaces for the following:\n- Transcoding of code points from one [character set](#character-set) to\n  another.\n- Iterators for grapheme clusters or other boundary conditions.\n- Collation.\n- Localization.\n- Internationalization.\n- [Unicode] code point properties.\n- [Unicode] normalization.\n\n# Requirements\n[Text_view] requires a C++ compiler that implements [ISO/IEC technical\nspecification 19217:2015, **C++ Extensions for concepts**][ISO/IEC 19217:2015]\nAs of 2016-08-26, this specification is only supported by [gcc] release\n6.2.0 or later.  Additionally, [Text_view] depends on the [cmcstl2]\nimplementation of the [ranges proposal][N4560] for concept definitions.\n\n# Build and installation\nThis section provides instructions for building [Text_view] and suitable\nversions of its dependencies.\n\n## Building and installing [gcc]\n[Text_view] requires [gcc] version 6.2.0 or later.  The following commands\ncan be used to perform a suitable build of the current in-development release\nof [gcc] on Linux if an installation of [gcc] 6.2.0 or later is not available.\nIf you have an installation of [gcc] 6.2.0 or later available, then there is\nno need to build [gcc] yourself.\n\n```sh\n$ svn co svn://gcc.gnu.org/svn/gcc/trunk gcc-trunk-src\n$ curl -O ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.1.tar.bz2\n$ curl -O ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.bz2\n$ curl -O ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.1.tar.gz\n$ cd gcc-trunk-src\n$ svn update -r 234230  # Optional command to select a known good gcc version\n$ bzip2 -d -c ../gmp-5.1.1.tar.bz2 | tar -xvf -\n$ mv gmp-5.1.1 gmp\n$ bzip2 -d -c ../mpfr-3.1.2.tar.bz2 | tar -xvf -\n$ mv mpfr-3.1.2 mpfr\n$ tar -zxvf ../mpc-1.0.1.tar.gz\n$ mv mpc-1.0.1 mpc\n$ cd ..\n$ mkdir gcc-trunk-build\n$ cd gcc-trunk-build\n$ LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch); export LIBRARY_PATH\n$ CPATH=/usr/include/$(gcc -print-multiarch); export CPATH\n$ ../gcc-trunk-src/configure \\\n  CC=gcc \\\n  CXX=g++ \\\n  --prefix $(pwd)/../gcc-trunk-install \\\n  --disable-multilib \\\n  --disable-bootstrap \\\n  --enable-languages=c,c++\n$ make -j 4\n$ make install\n$ cd ..\n```\n\nWhen complete, the new [gcc] build will be present in the `gcc-trunk-install`\ndirectory.\n\n## Building and installing [cmcstl2]\n[Text_view] only depends on headers provided by [cmcstl2] and no build or\ninstallation is required.  [Text_view] is known to build successfully with\n[cmcstl2] git revision `eb5ecdf79e22eb68c86cb62fd0912559593e5597`.  The\nfollowing commands can be used to checkout a known good revision.\n\n```sh\n$ git clone https://github.com/CaseyCarter/cmcstl2.git cmcstl2\n$ cd cmcstl2\n$ git checkout eb5ecdf79e22eb68c86cb62fd0912559593e5597\n```\n\n## Building and installing [Text_view]\n[Text_view] has a [CMake] based build system sufficient to build and run its\ntests, to validate example code, and to perform a minimal installation following\nestablished operating system conventions.  By default, files will be installed\nunder `/usr/local` on UNIX and UNIX-like systems, and under `C:\\Program Files`\non Windows.  The installation location can be changed by invoking `cmake` with\na `-DCMAKE_INSTALL_PREFIX=\u003cpath\u003e` option.  On UNIX and UNIX-like systems, header\nfiles will be installed in the `include` directory of the installation\ndestination, and other files will be installed under `share/text_view`.  On\nWindows, header files be installed in the `text_view\\include` directory of the\ninstallation destination, and other files will be installed under `text_view`.\n\nUnless [cmcstl2] is installed to a common location, it will be necessary to\ninform the build where it is installed.  This is typically done by setting the\n`CMCSTL2_INSTALL_PATH` environment variable.  As of this writing, [cmcstl2]\ndoes not provide an installation option, so `CMCSTL2_INSTALL_PATH` should\nspecify the location where the [cmcstl2] source resides (the directory that\ncontains the [cmcstl2] `include` directory).\n\nThe following commands suffice to build and run tests and examples, and perform\nan installation.  If the build succeeds, built test and example programs will\nbe present in the `test` and `examples` subdirectories of the build directory\n(the built test and example programs are not installed), and header files,\nexample code, cmake package configuration modules, and other miscellaneous files\nwill be present in the installation directory.\n\n```sh\n$ vi setenv.sh  # Update GCC_INSTALL_PATH and CMCSTL2_INSTALL_PATH.\n$ . ./setenv.sh\n$ mkdir build\n$ cd build\n$ cmake .. [-DCMAKE_INSTALL_PREFIX=/path/to/install/to]\n$ cmake --build . --target install\n$ ctest\n```\n\n`check` and `check-install` [CMake] targets are also available for automating\nbuild and test.  The `check` target performs a build without installation and\nthen runs the tests.  The `check-install` target performs a build, runs tests,\ninstalls to a location within the build directory, and then performs tests\n(verifying that example code builds) on the installation.\n\nThe installation includes a [CMake] based build system for building the example\ncode.  To build all of the examples, run `cmake` specifying the `examples`\ndirectory of the installation as the source directory.  Alternatively, each\nexample can be built independently by specifying its source directory as the\nsource directory in a `cmake` invocation.  If the installation was to a\nnon-default installation location (`-DCMAKE_INSTALL_PREFIX` was specified),\nthen it may be necessary to set `CMAKE_PREFIX_PATH` to the [Text_view]\ninstallation location (the location `CMAKE_INSTALL_PREFIX` was set to) or\n`text_view_DIR` to the directory containing the installed\n`text_view-config.cmake` file, so that the [Text_view] package configuration\nfile is found.  See the [CMake] documentation for more details.\n\nThe following commands suffice to build all of the installed examples.\n\n```sh\n$ cd /path/to/installation/text_view/examples\n$ mkdir build\n$ cd build\n$ cmake .. [-DCMAKE_PREFIX_PATH=/path/to/installation]\n$ cmake --build .\n$ ctest\n```\n\n# Usage\nTo use [Text_view] in your own code, perform a build and installation as\ndescribed above, add include paths for the `text_view/include` and [cmcstl2]\ninstallation locations, add a library search path for the `text_view/lib`\ndirectory, include the `text_view` header file in your sources, and link the\n[text_view] library with your executable.\n\n```C++\n#include \u003cexperimental/text_view\u003e\n```\n\n[Text_view] installations include a [CMake] package configuration file suitable\nfor use in [CMake] based projects.  To use it, specify `text_view` as the\n`\u003cpackage\u003e` argument to `find_package` in your [CMake] file and add invocations\nof `target_link_libraries` for each relevant target with the `\u003clib\u003e` argument\nset to `text-view`.  This will automatically apply compiler and linker options\nrequired to use [Text_view] to each target.  See the `CMakeLists.txt` files for\nthe utilities under the `examples` directory for reference.  If [Text_view] was\ninstalled to a non-default installation location (`-DCMAKE_INSTALL_PREFIX` was\nspecified), then it may be necessary to set `CMAKE_PREFIX_PATH` to the\n[Text_view] installation location (the location `CMAKE_INSTALL_PREFIX` was set\nto) or `text_view_DIR` to the directory containing the installed\n`text_view-config.cmake` file, so that the [Text_view] package configuration\nfile is found.  It is also possible to use the build directory as a\n(non-relocatable) installation directory by setting The `CMAKE_PREFIX_PATH`\nor `text_view_DIR` variables appropriately.  See the [CMake] documentation for\nmore details.  The `CMakeLists.txt` files provided with the installed examples\nexemplify a minimal [CMake] based build system for a downstream consumer of\n[Text_view].\n\nAll interfaces intended for public use are declared in the\n`std::experimental::text` namespace.  The `text` namespace is an inline\nnamespace, so all entities are available from the `std::experimental` namespace\nitself.\n\nThe interface descriptions in the sections that follow use the concept names\nfrom the [ranges proposal][N4560], are intended to be used as specification,\nand should be considered authoritative.  Any differences in behavior as\ndefined by these definitions as compared to the [Text_view] implementation are\nunintentional and should be considered indicatative of a defect in either the\nspecification or the implementation.\n\n## Header \u0026lt;experimental/text_view\u0026gt; synopsis\n\n```C++\nnamespace std {\nnamespace experimental {\ninline namespace text {\n\n// concepts:\ntemplate\u003ctypename T\u003e concept bool CodeUnit();\ntemplate\u003ctypename T\u003e concept bool CodePoint();\ntemplate\u003ctypename T\u003e concept bool CharacterSet();\ntemplate\u003ctypename T\u003e concept bool Character();\ntemplate\u003ctypename T\u003e concept bool CodeUnitIterator();\ntemplate\u003ctypename T, typename V\u003e concept bool CodeUnitOutputIterator();\ntemplate\u003ctypename T\u003e concept bool TextEncodingState();\ntemplate\u003ctypename T\u003e concept bool TextEncodingStateTransition();\ntemplate\u003ctypename T\u003e concept bool TextErrorPolicy();\ntemplate\u003ctypename T\u003e concept bool TextEncoding();\ntemplate\u003ctypename T, typename I\u003e concept bool TextEncoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextForwardDecoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextBidirectionalDecoder();\ntemplate\u003ctypename T, typename I\u003e concept bool TextRandomAccessDecoder();\ntemplate\u003ctypename T\u003e concept bool TextIterator();\ntemplate\u003ctypename T, typename I\u003e concept bool TextSentinel();\ntemplate\u003ctypename T\u003e concept bool TextOutputIterator();\ntemplate\u003ctypename T\u003e concept bool TextInputIterator();\ntemplate\u003ctypename T\u003e concept bool TextForwardIterator();\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalIterator();\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessIterator();\ntemplate\u003ctypename T\u003e concept bool TextView();\ntemplate\u003ctypename T\u003e concept bool TextInputView();\ntemplate\u003ctypename T\u003e concept bool TextForwardView();\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalView();\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessView();\n\n// error policies:\nclass text_error_policy;\nclass text_strict_error_policy;\nclass text_permissive_error_policy;\nusing text_default_error_policy = text_strict_error_policy;\n\n// error handling:\nenum class encode_status : int {\n  no_error = /* implementation-defined */,\n  invalid_character = /* implementation-defined */,\n  invalid_state_transition = /* implementation-defined */\n};\nenum class decode_status : int {\n  no_error = /* implementation-defined */,\n  no_character = /* implementation-defined */,\n  invalid_code_unit_sequence = /* implementation-defined */,\n  underflow = /* implementation-defined */\n};\nconstexpr inline bool status_ok(encode_status es) noexcept;\nconstexpr inline bool status_ok(decode_status ds) noexcept;\nconstexpr inline bool error_occurred(encode_status es) noexcept;\nconstexpr inline bool error_occurred(decode_status ds) noexcept;\nconst char* status_message(encode_status es) noexcept;\nconst char* status_message(decode_status ds) noexcept;\n\n// exception classes:\nclass text_error;\nclass text_encode_error;\nclass text_decode_error;\n\n// character sets:\nclass any_character_set;\nclass basic_execution_character_set;\nclass basic_execution_wide_character_set;\nclass unicode_character_set;\n\n// implementation defined character set type aliases:\nusing execution_character_set = /* implementation-defined */ ;\nusing execution_wide_character_set = /* implementation-defined */ ;\nusing universal_character_set = /* implementation-defined */ ;\n\n// character set identification:\nclass character_set_id;\n\ntemplate\u003cCharacterSet CST\u003e\n  inline character_set_id get_character_set_id();\n\n// character set information:\nclass character_set_info;\n\ntemplate\u003cCharacterSet CST\u003e\n  inline const character_set_info\u0026 get_character_set_info();\nconst character_set_info\u0026 get_character_set_info(character_set_id id);\n\n// character set and encoding traits:\ntemplate\u003ctypename T\u003e\n  using code_unit_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using code_point_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using character_set_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using character_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using encoding_type_t = /* implementation-defined */ ;\ntemplate\u003ctypename T\u003e\n  using default_encoding_type_t = /* implementation-defined */ ;\n\n// characters:\ntemplate\u003cCharacterSet CST\u003e class character;\ntemplate \u003c\u003e class character\u003cany_character_set\u003e;\n\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\n\n// encoding state and transition types:\nclass trivial_encoding_state;\nclass trivial_encoding_state_transition;\nclass utf8bom_encoding_state;\nclass utf8bom_encoding_state_transition;\nclass utf16bom_encoding_state;\nclass utf16bom_encoding_state_transition;\nclass utf32bom_encoding_state;\nclass utf32bom_encoding_state_transition;\n\n// encodings:\nclass basic_execution_character_encoding;\nclass basic_execution_wide_character_encoding;\n#if defined(__STDC_ISO_10646__)\nclass iso_10646_wide_character_encoding;\n#endif // __STDC_ISO_10646__\nclass utf8_encoding;\nclass utf8bom_encoding;\nclass utf16_encoding;\nclass utf16be_encoding;\nclass utf16le_encoding;\nclass utf16bom_encoding;\nclass utf32_encoding;\nclass utf32be_encoding;\nclass utf32le_encoding;\nclass utf32bom_encoding;\n\n// implementation defined encoding type aliases:\nusing execution_character_encoding = /* implementation-defined */ ;\nusing execution_wide_character_encoding = /* implementation-defined */ ;\nusing char8_character_encoding = /* implementation-defined */ ;\nusing char16_character_encoding = /* implementation-defined */ ;\nusing char32_character_encoding = /* implementation-defined */ ;\n\n// itext_iterator:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  requires TextForwardDecoder\u003cET, /* implementation-defined */ \u003e()\n  class itext_iterator;\n\n// itext_sentinel:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class itext_sentinel;\n\n// otext_iterator:\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e CUIT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class otext_iterator;\n\n// otext_iterator factory functions:\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\n\n// basic_text_view:\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  class basic_text_view;\n\n// basic_text_view type aliases:\nusing text_view = basic_text_view\u003cexecution_character_encoding,\n                                  /* implementation-defined */ \u003e;\nusing wtext_view = basic_text_view\u003cexecution_wide_character_encoding,\n                                   /* implementation-defined */ \u003e;\nusing u8text_view = basic_text_view\u003cchar8_character_encoding,\n                                    /* implementation-defined */ \u003e;\nusing u16text_view = basic_text_view\u003cchar16_character_encoding,\n                                     /* implementation-defined */ \u003e;\nusing u32text_view = basic_text_view\u003cchar32_character_encoding,\n                                     /* implementation-defined */ \u003e;\n\n// basic_text_view factory functions:\ntemplate\u003cTextEncoding ET, ranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(typename ET::state_type state, IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputIterator IT, ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::ForwardIterator IT\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::ForwardIterator IT\u003e\n  auto make_text_view(IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      typename std::make_unsigned\u003cranges::difference_type_t\u003cIT\u003e\u003e::type n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputRange Iterable\u003e\n  auto make_text_view(typename ET::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextEncoding ET, ranges::InputRange Iterable\u003e\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\ntemplate\u003cTextInputIterator TIT, TextSentinel\u003cTIT\u003e TST\u003e\n  auto make_text_view(TIT first, TST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\ntemplate\u003cTextView TVT\u003e\n  TVT make_text_view(TVT tv);\n\n} // inline namespace text\n} // namespace experimental\n} // namespace std\n```\n\n## Concepts\n\n- [Concept CodeUnit](#concept-codeunit)\n- [Concept CodePoint](#concept-codepoint)\n- [Concept CharacterSet](#concept-characterset)\n- [Concept Character](#concept-character)\n- [Concept CodeUnitIterator](#concept-codeunititerator)\n- [Concept CodeUnitOutputIterator](#concept-codeunitoutputiterator)\n- [Concept TextEncodingState](#concept-textencodingstate)\n- [Concept TextEncodingStateTransition](#concept-textencodingstatetransition)\n- [Concept TextErrorPolicy](#concept-texterrorpolicy)\n- [Concept TextEncoding](#concept-textencoding)\n- [Concept TextEncoder](#concept-textencoder)\n- [Concept TextForwardDecoder](#concept-textforwarddecoder)\n- [Concept TextBidirectionalDecoder](#concept-textbidirectionaldecoder)\n- [Concept TextRandomAccessDecoder](#concept-textrandomaccessdecoder)\n- [Concept TextIterator](#concept-textiterator)\n- [Concept TextSentinel](#concept-textsentinel)\n- [Concept TextOutputIterator](#concept-textoutputiterator)\n- [Concept TextInputIterator](#concept-textinputiterator)\n- [Concept TextForwardIterator](#concept-textforwarditerator)\n- [Concept TextBidirectionalIterator](#concept-textbidirectionaliterator)\n- [Concept TextRandomAccessIterator](#concept-textrandomaccessiterator)\n- [Concept TextView](#concept-textview)\n- [Concept TextInputView](#concept-textinputview)\n- [Concept TextForwardView](#concept-textforwardview)\n- [Concept TextBidirectionalView](#concept-textbidirectionalview)\n- [Concept TextRandomAccessView](#concept-textrandomaccessview)\n\n### Concept CodeUnit\nThe `CodeUnit` concept specifies requirements for a type usable as the\n[code unit](#code-unit) type of a string type.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodeUnit() {\n  return /* implementation-defined */ ;\n}\n```\n\n`CodeUnit\u003cT\u003e()` is satisfied if and only if\n`std::is_integral\u003cT\u003e::value` is true and at least one of\n`std::is_unsigned\u003cT\u003e::value` is true,\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, char\u003e::value` is true, or\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, wchar_t\u003e::value` is true.\n\n### Concept CodePoint\nThe `CodePoint` concept specifies requirements for a type usable as the\n[code point](#code-point) type of a [character set](#character-set) type.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodePoint() {\n  return /* implementation-defined */ ;\n}\n```\n\n`CodePoint\u003cT\u003e()` is satisfied if and only if\n`std::is_integral\u003cT\u003e::value` is true and at least one of\n`std::is_unsigned\u003cT\u003e::value` is true,\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, char\u003e::value` is true, or\n`std::is_same\u003cstd::remove_cv_t\u003cT\u003e, wchar_t\u003e::value` is true.\n\n### Concept CharacterSet\nThe `CharacterSet` concept specifies requirements for a type that describes\na [character set](#character-set).  Such a type has a member typedef-name\ndeclaration for a type that satisfies `CodePoint`, a static member function\nthat returns a name for the [character set](#character-set), and a static\nmember function that returns a code point value to be used to construct a\nsubstitution character to stand in when errors occur during encoding and\ndecoding operations when the permissive error policy is in effect.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CharacterSet() {\n  return CodePoint\u003ccode_point_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires () {\n           { T::get_name() } noexcept -\u003e const char *;\n           { T::get_substitution_code_point() } noexcept -\u003e code_point_type_t\u003cT\u003e;\n         };\n}\n```\n\n### Concept Character\nThe `Character` concept specifies requirements for a type that describes a\n[character](#character) as defined by an associated\n[character set](#character-set).  Non-static member functions provide access to\nthe [code point](#code-point) value of the described [character](#character).\nTypes that satisfy `Character` are regular and copyable.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool Character() {\n  return ranges::Regular\u003cT\u003e()\n      \u0026\u0026 ranges::Constructible\u003cT, code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e\u003e()\n      \u0026\u0026 CharacterSet\u003ccharacter_set_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (T t,\n                   const T ct,\n                   code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e cp)\n         {\n           { t.set_code_point(cp) } noexcept;\n           { ct.get_code_point() } noexcept\n               -\u003e code_point_type_t\u003ccharacter_set_type_t\u003cT\u003e\u003e;\n           { ct.get_character_set_id() }\n               -\u003e character_set_id;\n         };\n}\n```\n\n### Concept CodeUnitIterator\nThe `CodeUnitIterator` concept specifies requirements of an iterator that\nhas a value type that satisfies `CodeUnit`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool CodeUnitIterator() {\n  return ranges::Iterator\u003cT\u003e()\n      \u0026\u0026 CodeUnit\u003cranges::value_type_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept CodeUnitOutputIterator\nThe `CodeUnitOutputIterator` concept specifies requirements of an output\niterator that can be assigned from a type that satisfies `CodeUnit`.\n\n```C++\ntemplate\u003ctypename T, typename V\u003e concept bool CodeUnitOutputIterator() {\n  return ranges::OutputIterator\u003cT, V\u003e()\n      \u0026\u0026 CodeUnit\u003cV\u003e();\n}\n```\n\n### Concept TextEncodingState\nThe `TextEncodingState` concept specifies requirements of types that hold\n[encoding](#encoding) state.  Such types are semiregular.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncodingState() {\n  return ranges::Semiregular\u003cT\u003e();\n}\n```\n\n### Concept TextEncodingStateTransition\nThe `TextEncodingStateTransition` concept specifies requirements of types\nthat hold [encoding](#encoding) state transitions.  Such types are\nsemiregular.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncodingStateTransition() {\n  return ranges::Semiregular\u003cT\u003e();\n}\n```\n\n### Concept TextErrorPolicy\nThe `TextErrorPolicy` concept specifies requirements of types used\nto specify error handling policies.  Such types are semiregular class types\nthat derive from class `text_error_policy`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextErrorPolicy() {\n  return ranges::Semiregular\u003cT\u003e()\n      \u0026\u0026 ranges::DerivedFrom\u003cT, text_error_policy\u003e()\n      \u0026\u0026 !ranges::Same\u003cstd::remove_cv_t\u003cT\u003e, text_error_policy\u003e();\n}\n```\n\n### Concept TextEncoding\nThe `TextEncoding` concept specifies requirements of types that define an\n[encoding](#encoding).  Such types define member types that identify the\n[code unit](#code-unit), [character](#character), encoding state, and encoding\nstate transition types, a static member function that returns an initial\nencoding state object that defines the encoding state at the beginning of a\nsequence of encoded characters, and static data members that specify the\nminimum and maximum number of [code units](#code-units) used to encode any\nsingle character.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextEncoding() {\n  return requires () {\n           { T::min_code_units } noexcept -\u003e int;\n           { T::max_code_units } noexcept -\u003e int;\n         }\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 TextEncodingStateTransition\u003ctypename T::state_transition_type\u003e()\n      \u0026\u0026 CodeUnit\u003ccode_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 Character\u003ccharacter_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires () {\n           { T::initial_state() } noexcept\n               -\u003e const typename T::state_type\u0026;\n         };\n}\n```\n\n### Concept TextEncoder\nThe `TextEncoder` concept specifies requirements of types that are used to\nencode [characters](#character) using a particular [code unit](#code-unit)\niterator that satisfies `OutputIterator`.  Such a type satisifies\n`TextEncoding` and defines static member functions used to encode state\ntransitions and [characters](#character).\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextEncoder() {\n  return TextEncoding\u003cT\u003e()\n      \u0026\u0026 ranges::OutputIterator\u003cCUIT, code_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026out,\n           typename T::state_transition_type stt,\n           int \u0026encoded_code_units)\n         {\n           { T::encode_state_transition(state, out, stt, encoded_code_units) }\n             -\u003e encode_status;\n         }\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026out,\n           character_type_t\u003cT\u003e c,\n           int \u0026encoded_code_units)\n         {\n           { T::encode(state, out, c, encoded_code_units) }\n             -\u003e encode_status;\n         };\n}\n```\n\n### Concept TextForwardDecoder\nThe `TextForwardDecoder` concept specifies requirements of types that are used\nto decode [characters](#character) using a particular [code unit](#code-unit)\niterator that satisifies `ForwardIterator`.  Such a type satisfies\n`TextEncoding` and defines a static member function used to decode state\ntransitions and [characters](#character).\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextForwardDecoder() {\n  return TextEncoding\u003cT\u003e()\n      \u0026\u0026 ranges::ForwardIterator\u003cCUIT\u003e()\n      \u0026\u0026 ranges::ConvertibleTo\u003cranges::value_type_t\u003cCUIT\u003e,\n                               code_unit_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026in_next,\n           CUIT in_end,\n           character_type_t\u003cT\u003e \u0026c,\n           int \u0026decoded_code_units)\n         {\n           { T::decode(state, in_next, in_end, c, decoded_code_units) }\n             -\u003e decode_status;\n         };\n\n}\n```\n\n### Concept TextBidirectionalDecoder\nThe `TextBidirectionalDecoder` concept specifies requirements of types that\nare used to decode [characters](#character) using a particular\n[code unit](#code-unit) iterator that satisifies `BidirectionalIterator`.  Such\na type satisfies `TextForwardDecoder` and defines a static member function\nused to decode state transitions and [characters](#character) in the reverse\norder of their encoding.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextBidirectionalDecoder() {\n  return TextForwardDecoder\u003cT, CUIT\u003e()\n      \u0026\u0026 ranges::BidirectionalIterator\u003cCUIT\u003e()\n      \u0026\u0026 requires (\n           typename T::state_type \u0026state,\n           CUIT \u0026in_next,\n           CUIT in_end,\n           character_type_t\u003cT\u003e \u0026c,\n           int \u0026decoded_code_units)\n         {\n           { T::rdecode(state, in_next, in_end, c, decoded_code_units) }\n             -\u003e decode_status;\n         };\n}\n```\n\n### Concept TextRandomAccessDecoder\nThe `TextRandomAccessDecoder` concept specifies requirements of types that\nare used to decode [characters](#character) using a particular\n[code unit](#code-unit) iterator that satisifies `RandomAccessIterator`.  Such a\ntype satisfies `TextBidirectionalDecoder`, requires that the minimum and\nmaximum number of [code units](#code-unit) used to encode any character have\nthe same value, and that the encoding state be an empty type.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextRandomAccessDecoder() {\n  return TextBidirectionalDecoder\u003cT, CUIT\u003e()\n      \u0026\u0026 ranges::RandomAccessIterator\u003cCUIT\u003e()\n      \u0026\u0026 T::min_code_units == T::max_code_units\n      \u0026\u0026 std::is_empty\u003ctypename T::state_type\u003e::value;\n}\n```\n\n### Concept TextIterator\nThe `TextIterator` concept specifies requirements of iterator types that are\nused to encode and decode [characters](#character) as an [encoded](#encoding)\nsequence of [code units](#code-unit).  [Encoding](#encoding) state and error\nindication is held in each iterator instance and is made accessible via\nnon-static member functions.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextIterator() {\n  return ranges::Iterator\u003cT\u003e()\n      \u0026\u0026 TextEncoding\u003cencoding_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e()\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.state() } noexcept\n               -\u003e const typename encoding_type_t\u003cT\u003e::state_type\u0026;\n           { ct.error_occurred() } noexcept\n               -\u003e bool;\n         };\n}\n```\n\n### Concept TextSentinel\nThe `TextSentinel` concept specifies requirements of types that are used to\nmark the end of a range of encoded [characters](#character).  A type T that\nsatisfies `TextIterator` also satisfies `TextSentinel\u003cT\u003e` there by enabling\n`TextIterator` types to be used as sentinels.\n\n```C++\ntemplate\u003ctypename T, typename I\u003e concept bool TextSentinel() {\n  return ranges::Sentinel\u003cT, I\u003e()\n      \u0026\u0026 TextIterator\u003cI\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e();\n}\n```\n\n### Concept TextOutputIterator\nThe `TextOutputIterator` concept refines `TextIterator` with a requirement that\nthe type also satisfy `ranges::OutputIterator` for the character type of the\nassociated encoding and that a member function be provided for retrieving error\ninformation.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextOutputIterator() {\n  return TextIterator\u003cI\u003e();\n      \u0026\u0026 ranges::OutputIterator\u003cT, character_type_t\u003cencoding_type_t\u003cT\u003e\u003e\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.get_error() } noexcept\n               -\u003e encode_status;\n         };\n}\n```\n\n### Concept TextInputIterator\nThe `TextInputIterator` concept refines `TextIterator` with requirements that\nthe type also satisfy `ranges::InputIterator`, that the iterator value type\nsatisfy `Character`, and that a member function be provided for retrieving error\ninformation.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextInputIterator() {\n  return TextIterator\u003cT\u003e()\n      \u0026\u0026 ranges::InputIterator\u003cT\u003e()\n      \u0026\u0026 Character\u003cranges::value_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 requires (const T ct) {\n           { ct.get_error() } noexcept\n               -\u003e decode_status;\n         };\n}\n```\n\n### Concept TextForwardIterator\nThe `TextForwardIterator` concept refines `TextInputIterator` with a requirement\nthat the type also satisfy `ranges::ForwardIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextForwardIterator() {\n  return TextInputIterator\u003cT\u003e()\n      \u0026\u0026 ranges::ForwardIterator\u003cT\u003e();\n}\n```\n\n### Concept TextBidirectionalIterator\nThe `TextBidirectionalIterator` concept refines `TextForwardIterator` with a\nrequirement that the type also satisfy `ranges::BidirectionalIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalIterator() {\n  return TextForwardIterator\u003cT\u003e()\n      \u0026\u0026 ranges::BidirectionalIterator\u003cT\u003e();\n}\n```\n\n### Concept TextRandomAccessIterator\nThe `TextRandomAccessIterator` concept refines `TextBidirectionalIterator` with\na requirement that the type also satisfy `ranges::RandomAccessIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessIterator() {\n  return TextBidirectionalIterator\u003cT\u003e()\n      \u0026\u0026 ranges::RandomAccessIterator\u003cT\u003e();\n}\n```\n\n### Concept TextView\nThe `TextView` concept specifies requirements of types that provide view access\nto an underlying [code unit](#code-unit) range.  Such types satisfy\n`ranges::View`, provide iterators that satisfy `TextIterator`, define member\ntypes that identify the [encoding](#encoding), encoding state, and underlying\n[code unit](#code-unit) range and iterator types.  Non-static member functions\nare provided to access the underlying [code unit](#code-unit) range and initial\n[encoding](#encoding) state.\n\nTypes that satisfy `TextView` do not own the underlying [code unit](#code-unit)\nrange and are copyable in constant time.  The lifetime of the underlying range\nmust exceed the lifetime of referencing `TextView` objects.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextView() {\n  return ranges::View\u003cT\u003e()\n      R\u0026 TextIterator\u003cranges::iterator_t\u003cT\u003e\u003e()\n      \u0026\u0026 TextEncoding\u003cencoding_type_t\u003cT\u003e\u003e()\n      \u0026\u0026 ranges::View\u003ctypename T::view_type\u003e()\n      \u0026\u0026 TextErrorPolicy\u003ctypename T::error_policy\u003e()\n      \u0026\u0026 TextEncodingState\u003ctypename T::state_type\u003e()\n      \u0026\u0026 CodeUnitIterator\u003ccode_unit_iterator_t\u003cT\u003e\u003e()\n      R\u0026 requires (T t, const T ct) {\n           { ct.base() } noexcept\n               -\u003e const typename T::view_type\u0026;\n           { ct.initial_state() } noexcept\n               -\u003e const typename T::state_type\u0026;\n         };\n}\n```\n\n### Concept TextInputView\nThe `TextInputView` concept refines `TextView` with a requirement that the\nview's iterator type also satisfy `TextInputIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextInputView() {\n  return TextView\u003cT\u003e()\n      \u0026\u0026 TextInputIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextForwardView\nThe `TextForwardView` concept refines `TextInputView` with a requirement that\nthe view's iterator type also satisfy `TextForwardIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextForwardView() {\n  return TextInputView\u003cT\u003e()\n      \u0026\u0026 TextForwardIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextBidirectionalView\nThe `TextBidirectionalView` concept refines `TextForwardView` with a requirement\nthat the view's iterator type also satisfy `TextBidirectionalIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextBidirectionalView() {\n  return TextForwardView\u003cT\u003e()\n      \u0026\u0026 TextBidirectionalIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n### Concept TextRandomAccessView\nThe `TextRandomAccessView` concept refines `TextBidirectionalView` with a\nrequirement that the view's iterator type also satisfy\n`TextRandomAccessIterator`.\n\n```C++\ntemplate\u003ctypename T\u003e concept bool TextRandomAccessView() {\n  return TextBidirectionalView\u003cT\u003e()\n      \u0026\u0026 TextRandomAccessIterator\u003cranges::iterator_t\u003cT\u003e\u003e();\n}\n```\n\n## Error Policies\n\n- [Class text_error_policy](#class-text_error_policy)\n- [Class text_strict_error_policy](#class-text_strict_error_policy)\n- [Class text_permissive_error_policy](#class-text_permissive_error_policy)\n- [Alias text_default_error_policy](#alias-text_default_error_policy)\n\n### Class text_error_policy\n\nClass `text_error_policy` is a base class from which all text error policy\nclasses must derive.\n\n```C++\nclass text_error_policy {};\n```\n\n### Class text_strict_error_policy\n\nThe `text_strict_error_policy` class is a policy class that specifies that\nexceptions be thrown for errors that occur during encoding and decoding\noperations initiated through text iterators.  This class satisfies\n`TextErrorPolicy`.\n\n```C++\nclass text_strict_error_policy : public text_error_policy {};\n```\n\n### Class text_permissive_error_policy\n\nThe `class_text_permissive_error_policy` class is a policy class that specifies\nthat substitution characters such as the Unicode replacement character\n`U+FFFD` be substituted in place of errors that occur during encoding and\ndecoding operations initiated through text iterators.  This class satisfies\n`TextErrorPolicy`.\n\n```C++\nclass text_permissive_error_policy : public text_error_policy {};\n```\n\n### Alias text_default_error_policy\n\nThe `text_default_error_policy` alias specifies the default text error policy.\nConforming implementations must alias this to `text_strict_error_policy`, but\nmay have options to select an alternative default policy for environments that\ndo not support exceptions.  The referred class shall satisfy `TextErrorPolicy`.\n\n```C++\nusing text_default_error_policy = text_strict_error_policy;\n```\n\n## Error Status\n\n- [Enum encode_status](#enum-encode_status)\n- [Enum decode_status](#enum-decode_status)\n- [status_ok](#status_ok)\n- [error_occurred](#error_occurred)\n- [status_message](#status_message)\n\n### Enum encode_status\n\nThe `encode_status` enumeration type defines enumerators used to report errors\nthat occur during text encoding operations.\n\nThe `no_error` enumerator indicates that no error has occurred.\n\nThe `invalid_character` enumerator indicates that an attempt was made to encode\na character that was not valid for the encoding.\n\nThe `invalid_state_transition` enumerator indicates that an attempt was made to\nencode a state transition that was not valid for the encoding.\n\n```C++\nenum class encode_status : int {\n  no_error = /* implementation-defined */,\n  invalid_character = /* implementation-defined */,\n  invalid_state_transition = /* implementation-defined */\n};\n```\n\n### Enum decode_status\n\nThe `decode_status` enumeration type defines enumerators used to report errors\nthat occur during text decoding operations.\n\nThe `no_error` enumerator indicates that no error has occurred.\n\nThe `no_character` enumerator indicates that no error has occurred, but that no\ncharacter was decoded for a code unit sequence.  This typically indicates that\nthe code unit sequence represents an encoding state transition such as for an\nescape sequence or byte order marker.\n\nThe `invalid_code_unit_sequence` enumerator indicates that an attempt was made\nto decode an invalid code unit sequence.\n\nThe `underflow` enumerator indicates that the end of the input range was\nencountered before a complete code unit sequence was decoded.\n\n```C++\nenum class decode_status : int {\n  no_error = /* implementation-defined */,\n  no_character = /* implementation-defined */,\n  invalid_code_unit_sequence = /* implementation-defined */,\n  underflow = /* implementation-defined */\n};\n```\n\n### status_ok\n\nThe `status_ok` function returns `true` if the `encode_status` argument value\nis `encode_status::no_error` or if the `decode_status` argument is either of\n`decode_status::no_error` or `decode_status::no_character`.  `false` is\nreturned for all other values.\n\n```C++\nconstexpr inline bool status_ok(encode_status es) noexcept;\nconstexpr inline bool status_ok(decode_status ds) noexcept;\n```\n\n### error_occurred\n\nThe `error_occurred` function returns `false` if the `encode_status` argument\nvalue is `encode_status::no_error` or if the `decode_status` argument is either\nof `decode_status::no_error` or `decode_status::no_character`.  `true` is\nreturned for all other values.\n\n```C++\nconstexpr inline bool error_occurred(encode_status es) noexcept;\nconstexpr inline bool error_occurred(decode_status ds) noexcept;\n```\n\n### status_message\n\nThe `status_message` function returns a pointer to a statically allocated\nstring containing a short description of the value of the `encode_status` or\n`decode_status` argument.\n\n```C++\nconst char* status_message(encode_status es) noexcept;\nconst char* status_message(decode_status ds) noexcept;\n```\n\n## Exceptions\n\n- [Class text_error](#class-text_error)\n- [Class text_encode_error](#class-text_encode_error)\n- [Class text_decode_error](#class-text_decode_error)\n\n### Class text_error\n\nThe `text_error` class defines the base class for the types of objects\nthrown as exceptions to report errors detected during text processing.\n\n```C++\nclass text_error : public std::runtime_error\n{\npublic:\n  using std::runtime_error::runtime_error;\n};\n```\n\n### Class text_encode_error\n\nThe `text_encode_error` class defines the types of objects thrown as exceptions\nto report errors detected during encoding of a [character](#character).  Objects\nof this type are generally thrown in response to an attempt to encode a\n[character](#character) with an invalid [code point](#code-point) value, or to\nencode an invalid state transition.\n\n```C++\nclass text_encode_error : public text_error\n{\npublic:\n  explicit text_encode_error(encode_status es) noexcept;\n\n  const encode_status\u0026 status_code() const noexcept;\n\nprivate:\n  encode_status es; // exposition only\n};\n```\n\n### Class text_decode_error\n\nThe `text_decode_error` class defines the types of objects thrown as exceptions\nto report errors detected during decoding of a [code unit](#code-unit) sequence.\nObjects of this type are generally thrown in response to an attempt to decode\nan ill-formed [code unit](#code-unit) sequence, a [code unit](#code-unit)\nsequence that specifies an invalid [code point](#code-point) value, or a\n[code unit](#code-unit) sequence that specifies an invalid state transition.\n\n```C++\nclass text_decode_error : public text_error\n{\npublic:\n  explicit text_decode_error(decode_status ds) noexcept;\n\n  const decode_status\u0026 status_code() const noexcept;\n\nprivate:\n  decode_status ds; // exposition only\n};\n```\n\n## Type traits\n\n- [code_unit_type_t](#code_unit_type_t)\n- [code_point_type_t](#code_point_type_t)\n- [character_set_type_t](#character_set_type_t)\n- [character_type_t](#character_type_t)\n- [encoding_type_t](#encoding_type_t)\n- [default_encoding_type_t](#default_encoding_type_t)\n\n### code_unit_type_t\n\nThe `code_unit_type_t` type alias template provides convenient means for\nselecting the associated [code unit](#code-unit) type of some other type,\nsuch as an [encoding](#encoding) type that satisfies `TextEncoding`.  The\naliased type is the same as `typename T::code_unit_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using code_unit_type_t = /* implementation-defined */ ;\n```\n\n### code_point_type_t\n\nThe `code_point_type_t` type alias template provides convenient means for\nselecting the associated [code point](#code-point) type of some other type,\nsuch as a type that satisfies `CharacterSet` or `Character`.  The aliased\ntype is the same as `typename T::code_point_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using code_point_type_t = /* implementation-defined */ ;\n```\n\n### character_set_type_t\n\nThe `character_set_type_t` type alias template provides convenient means for\nselecting the associated [character set](#character-set) type of some other\ntype, such as a type that satisfies `Character`.  The aliased type is the same\nas `typename T::character_set_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using character_set_type_t = /* implementation-defined */ ;\n```\n\n### character_type_t\n\nThe `character_type_t` type alias template provides convenient means for\nselecting the associated [character](#character) type of some other type, such\nas a type that satisfies `TextEncoding`.  The aliased type is the same as\n`typename T::character_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using character_type_t = /* implementation-defined */ ;\n```\n\n### encoding_type_t\n\nThe `encoding_type_t` type alias template provides convenient means for\nselecting the associated [encoding](#encoding) type of some other type, such\nas a type that satisfies `TextIterator` or `TextView`.  The aliased type is the\nsame as `typename T::encoding_type`.\n\n```C++\ntemplate\u003ctypename T\u003e\n  using encoding_type_t = /* implementation-defined */ ;\n```\n\n### default_encoding_type_t\n\nThe `default_encoding_type_t` type alias template resolves to the default\n[encoding](#encoding) type, if any, for a given type, such as a type that\nsatisfies `CodeUnit`.  Specializations are provided for the following\ncv-unqualified and reference removed fundamental types.  Otherwise, the alias\nwill attempt to resolve against a `default_encoding_type` member type.\n\nWhen `std::remove_cv_t\u003cstd::remove_reference_t\u003cT\u003e\u003e` is ... | the default encoding is ...\n---------------------------------------------------------- | ---------------------------\n`char` | `execution_character_encoding`\n`wchar_t` | `execution_wide_character_encoding`\n`char16_t` | `char16_character_encoding`\n`char32_t` | `char32_character_encoding`\n\n```C++\ntemplate\u003ctypename T\u003e\n  using default_encoding_type_t = /* implementation-defined */ ;\n```\n\n## Character sets\n\n- [Class any_character_set](#class-any_character_set)\n- [Class basic_execution_character_set](#class-basic_execution_character_set)\n- [Class basic_execution_wide_character_set](#class-basic_execution_wide_character_set)\n- [Class unicode_character_set](#class-unicode_character_set)\n- [Character set type aliases](#character-set-type-aliases)\n\n### Class any_character_set\n\nThe `any_character_set` class provides a generic [character set](#character-set)\ntype used when a specific [character set](#character-set) type is unknown or\nwhen the ability to switch between specific [character sets](#character-set)\nis required.  This class satisfies the `CharacterSet` concept and has an\nimplementation defined `code_point_type` that is able to represent\n[code point](#code-point) values from all of the implementation provided\n[character set](#character-set) types.  The code point returned by\n`get_substitution_code_point` is implementation defined.\n\n\n```C++\nclass any_character_set {\npublic:\n  using code_point_type = /* implementation-defined */;\n\n  static const char* get_name() noexcept {\n    return \"any_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class basic_execution_character_set\n\nThe `basic_execution_character_set` class represents the basic execution\ncharacter set specified in `[lex.charset]p3` of the [C++11][ISO/IEC 14882:2011]\nstandard.  This class satisfies the `CharacterSet` concept and has a\n`code_point_type` member type that aliases `char`.  The code point returned by\n`get_substitution_code_point` is the code point for the `'?'` character.\n\n\n```C++\nclass basic_execution_character_set {\npublic:\n  using code_point_type = char;\n\n  static const char* get_name() noexcept {\n    return \"basic_execution_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class basic_execution_wide_character_set\n\nThe `basic_execution_wide_character_set` class represents the basic execution\nwide character set specified in `[lex.charset]p3` of the\n[C++11][ISO/IEC 14882:2011] standard.  This class satisfies the `CharacterSet`\nconcept and has a `code_point_type` member type that aliases `wchar_t`.  The\ncode point returned by `get_substitution_code_point` is the code point for the\n`L'?'` character.\n\n\n```C++\nclass basic_execution_wide_character_set {\npublic:\n  using code_point_type = wchar_t;\n\n  static const char* get_name() noexcept {\n    return \"basic_execution_wide_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Class unicode_character_set\n\nThe `unicode_character_set` class represents the [Unicode]\n[character sets](#character-set).  This class satisfies the `CharacterSet`\nconcept and has a `code_point_type` member type that aliases `char32_t`.\nThe code point returned by `get_substitution_code_point` is the `U+FFFD`\nUnicode replacement character.\n\n\n```C++\nclass unicode_character_set {\npublic:\n  using code_point_type = char32_t;\n\n  static const char* get_name() noexcept {\n    return \"unicode_character_set\";\n  }\n\n  static constexpr code_point_type get_substitution_code_point() noexcept;\n};\n```\n\n### Character set type aliases\n\nThe `execution_character_set`,\n`execution_wide_character_set`, and\n`universal_character_set` type aliases reflect the implementation\ndefined execution, wide execution, and universal\n[character sets](#character-set) specified in `[lex.charset]p2-3` of the C++\nstandard.\n\nThe [character set](#character-set) aliased by `execution_character_set` must be\na superset of the `basic_execution_character_set`\n[character set](#character-set).  This alias refers to the\n[character set](#character-set) that the compiler assumes during\ntranslation; the [character set](#character-set) that the compiler uses when\ntranslating [characters](#character) specified by universal-character-name\ndesignators in ordinary string literals, not the locale sensitive run-time\nexecution [character set](#character-set).\n\nThe [character set](#character-set) aliased by `execution_wide_character_set`\nmust be a superset of the `basic_execution_wide_character_set`\n[character set](#character-set).  This alias refers to the\n[character set](#character-set)  that the compiler assumes during\ntranslation; the [character set](#character-set) that the compiler uses when\ntranslating [characters](#character) specified by universal-character-name\ndesignators in wide string literals, not the locale sensitive run-time\nexecution wide [character set](#character-set).\n\nThe [character set](#character-set) aliased by `universal_character_set` must\nbe a superset of the `unicode_character_set` [character set](#character-set).\n\n```C++\nusing execution_character_set = /* implementation-defined */ ;\nusing execution_wide_character_set = /* implementation-defined */ ;\nusing universal_character_set = /* implementation-defined */ ;\n```\n\n## Character set identification\n\n- [Class character_set_id](#class-character_set_id)\n- [get_character_set_id](#get_character_set_id)\n\n### Class character_set_id\n\nThe `character_set_id` class provides unique, opaque values used to identify\n[character sets](#character-set) at run-time.  Values of this type are produced\nby `get_character_set_id()` and can be passed to `get_character_set_info()` to\nobtain [character set](#character-set) information.  Values of this type are\ncopy constructible, copy assignable, equality comparable, and strictly totally\nordered.\n\n```C++\nclass character_set_id {\npublic:\n  character_set_id() = delete;\n\n  friend bool operator==(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator!=(character_set_id lhs, character_set_id rhs) noexcept;\n\n  friend bool operator\u003c(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003e(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003c=(character_set_id lhs, character_set_id rhs) noexcept;\n  friend bool operator\u003e=(character_set_id lhs, character_set_id rhs) noexcept;\n};\n```\n\n### get_character_set_id\n\n`get_character_set_id()` returns a unique, opaque value for the\n[character set](#character-set) type specified by the template parameter.\n\n```C++\ntemplate\u003cCharacterSet CST\u003e\n  inline character_set_id get_character_set_id();\n```\n\n## Character set information\n\n- [Class character_set_info](#class-character_set_info)\n- [get_character_set_info](#get_character_set_info)\n\n### Class character_set_info\n\nThe `character_set_info` class stores information about a\n[character set](#character-set).  Values of this type are produced by the\n`get_character_set_info()` functions based on a [character set](#character-set)\ntype or ID.\n\n```C++\nclass character_set_info {\npublic:\n  character_set_info() = delete;\n\n  character_set_id get_id() const noexcept;\n\n  const char* get_name() const noexcept;\n\nprivate:\n  character_set_id id; // exposition only\n};\n```\n\n### get_character_set_info\n\nThe `get_character_set_info()` functions return a reference to a\n`character_set_info` object based on a [character set](#character-set) type or\nID.\n\n```C++\nconst character_set_info\u0026 get_character_set_info(character_set_id id);\n\ntemplate\u003cCharacterSet CST\u003e\n  inline const character_set_info\u0026 get_character_set_info();\n```\n\n## Characters\n\n- [Class template character](#class-template-character)\n\n### Class template character\n\nObjects of `character` class template specialization type define a\n[character](#character) via the association of a [code point](#code-point)\nvalue and a [character set](#character-set).  The specialization provided for\nthe `any_character_set` type is used to maintain a dynamic\n[character set](#character-set) association while specializations for other\n[character sets](#character-set) specify a static association.  These types\nsatisfy the `Character` concept and are default constructible, copy\nconstructible, copy assignable, and equality comparable.  Member functions\nprovide access to the [code point](#code-point) and\n[character set](#character-set) ID values for the represented\n[character](#character).  Default constructed objects represent a null\n[character](#character) using a zero initialized [code point](#code-point)\nvalue.\n\nObjects with different [character set](#character-set) type are not equality\ncomparable with the exception that objects with a static\n[character set](#character-set) type of `any_character_set` are comparable with\nobjects with any static [character set](#character-set) type.  In this case,\nobjects compare equally if and only if their [character set](#character-set)\nID and [code point](#code-point) values match.  Equality comparison between\nobjects with different static [character set](#character-set) type is not\nimplemented to avoid potentially costly unintended implicit transcoding between\n[character sets](#character-set).\n\n```C++\ntemplate\u003cCharacterSet CST\u003e\nclass character {\npublic:\n  using character_set_type = CST;\n  using code_point_type = code_point_type_t\u003ccharacter_set_type\u003e;\n\n  character() = default;\n  explicit character(code_point_type code_point) noexcept;\n\n  friend bool operator==(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n  friend bool operator!=(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n\n  void set_code_point(code_point_type code_point) noexcept;\n  code_point_type get_code_point() const noexcept;\n\n  static character_set_id get_character_set_id();\n\nprivate:\n  code_point_type code_point; // exposition only\n};\n\ntemplate\u003c\u003e\nclass character\u003cany_character_set\u003e {\npublic:\n  using character_set_type = any_character_set;\n  using code_point_type = code_point_type_t\u003ccharacter_set_type\u003e;\n\n  character() = default;\n  explicit character(code_point_type code_point) noexcept;\n  character(character_set_id cs_id, code_point_type code_point) noexcept;\n\n  friend bool operator==(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n  friend bool operator!=(const character \u0026lhs,\n                         const character \u0026rhs) noexcept;\n\n  void set_code_point(code_point_type code_point) noexcept;\n  code_point_type get_code_point() const noexcept;\n\n  void set_character_set_id(character_set_id new_cs_id) noexcept;\n  character_set_id get_character_set_id() const noexcept;\n\nprivate:\n  character_set_id cs_id;     // exposition only\n  code_point_type code_point; // exposition only\n};\n\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator==(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cany_character_set\u003e \u0026lhs,\n                  const character\u003cCST\u003e \u0026rhs);\ntemplate\u003cCharacterSet CST\u003e\n  bool operator!=(const character\u003cCST\u003e \u0026lhs,\n                  const character\u003cany_character_set\u003e \u0026rhs);\n```\n\n## Encodings\n\n- [class trivial_encoding_state](#class-trivial_encoding_state)\n- [class trivial_encoding_state_transition](#class-trivial_encoding_state_transition)\n- [Class basic_execution_character_encoding](#class-basic_execution_character_encoding)\n- [Class basic_execution_wide_character_encoding](#class-basic_execution_wide_character_encoding)\n- [Class iso_10646_wide_character_encoding](#class-iso_10646_wide_character_encoding)\n- [Class utf8_encoding](#class-utf8_encoding)\n- [Class utf8bom_encoding](#class-utf8bom_encoding)\n- [Class utf16_encoding](#class-utf16_encoding)\n- [Class utf16be_encoding](#class-utf16be_encoding)\n- [Class utf16le_encoding](#class-utf16le_encoding)\n- [Class utf16bom_encoding](#class-utf16bom_encoding)\n- [Class utf32_encoding](#class-utf32_encoding)\n- [Class utf32be_encoding](#class-utf32be_encoding)\n- [Class utf32le_encoding](#class-utf32le_encoding)\n- [Class utf32bom_encoding](#class-utf32bom_encoding)\n- [Encoding type aliases](#encoding-type-aliases)\n\n### Class trivial_encoding_state\n\nThe `trivial_encoding_state` class is an empty class used by stateless\n[encodings](#encoding) to implement the parts of the generic\n[encoding](#encoding) interfaces necessary to support stateful\n[encodings](#encoding).\n\n```C++\nclass trivial_encoding_state {};\n```\n\n### Class trivial_encoding_state_transition\n\nThe `trivial_encoding_state_transition` class is an empty class used by\nstateless [encodings](#encoding) to implement the parts of the generic\n[encoding](#encoding) interfaces necessary to support stateful\n[encodings](#encoding) that support non-[code-point](#code-point)\nencoding [code unit](#code-unit) sequences.\n\n```C++\nclass trivial_encoding_state_transition {};\n```\n\n### Class basic_execution_character_encoding\n\nThe `basic_execution_character_encoding` class implements support for the\n[encoding](#encoding) used for ordinary string literals limited to support\nfor the basic execution character set as defined in `[lex.charset]p3` of\nthe C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass basic_execution_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cbasic_execution_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class basic_execution_wide_character_encoding\n\nThe `basic_execution_wide_character_encoding` class implements support for the\n[encoding](#encoding) used for wide string literals limited to support for the\nbasic execution wide-character set as defined in `[lex.charset]p3` of\nthe C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `wchar_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass basic_execution_wide_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cbasic_execution_wide_character_set\u003e;\n  using code_unit_type = wchar_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class iso_10646_wide_character_encoding\n\nThe `iso_10646_wide_character_encoding` class is only defined\nwhen the `__STDC_ISO_10646__` macro is defined.\n\nThe `iso_10646_wide_character_encoding` class implements support for the\n[encoding](#encoding) used for wide string literals when that\n[encoding](#encoding) uses the [Unicode] [character set](#character-set) and\n`wchar_t` is large enough to store the [code point](#code-point) values of\nall [characters](#character) defined by the version of the [Unicode] standard\nindicated by the value of the `__STDC_ISO_10646__` macro as specified in\n`[cpp.predefined]p2` of the C++ standard.\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports random\naccess decoding, and has a [code unit](#code-unit) of type `wchar_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\n#if defined(__STDC_ISO_10646__)\nclass iso_10646_wide_character_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = wchar_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n#endif // __STDC_ISO_10646__\n```\n\n### Class utf8_encoding\n\nThe `utf8_encoding` class implements support for the [Unicode] UTF-8\n[encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf8_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf8bom_encoding\n\nThe `utf8bom_encoding` class implements support for the [Unicode] UTF-8\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf8bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf8bom_encoding_state_transition {\npublic:\n  static utf8bom_encoding_state_transition to_initial_state() noexcept;\n  static utf8bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf8bom_encoding_state_transition to_assume_bom_written_state() noexcept;\n};\n\nclass utf8bom_encoding {\npublic:\n  using state_type = utf8bom_encoding_state;\n  using state_transition_type = utf8bom_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003cstd::make_unsigned_t\u003ccode_unit_type\u003e\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16_encoding\n\nThe `utf16_encoding` class implements support for the [Unicode] UTF-16\n[encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char16_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char16_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 2;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16be_encoding\n\nThe `utf16be_encoding` class implements support for the [Unicode] UTF-16\nbig-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16be_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16le_encoding\n\nThe `utf16le_encoding` class implements support for the [Unicode] UTF-16\nlittle-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf16le_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf16bom_encoding\n\nThe `utf16bom_encoding_state` class implements support for the [Unicode] UTF-16\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf16bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf16bom_encoding_state_transition {\npublic:\n  static utf16bom_encoding_state_transition to_initial_state() noexcept;\n  static utf16bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_be_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_le_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_be_bom_written_state() noexcept;\n  static utf16bom_encoding_state_transition to_assume_le_bom_written_state() noexcept;\n};\n\nclass utf16bom_encoding {\npublic:\n  using state_type = utf16bom_encoding_state;\n  using state_transition_type = utf16bom_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 2;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32_encoding\n\nThe `utf32_encoding` class implements support for the [Unicode] UTF-32\n[encoding](#encoding).\n\nThis [encoding](#encoding) is trivial, stateless, fixed width, supports\nrandom access decoding, and has a [code unit](#code-unit) of type `char32_t`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char32_t;\n\n  static constexpr int min_code_units = 1;\n  static constexpr int max_code_units = 1;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32be_encoding\n\nThe `utf32be_encoding` class implements support for the [Unicode] UTF-32\nbig-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, fixed width, supports random access\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32be_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 4;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32le_encoding\n\nThe `utf32le_encoding` class implements support for the [Unicode] UTF-32\nlittle-endian [encoding](#encoding).\n\nThis [encoding](#encoding) is stateless, fixed width, supports random access\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\n```C++\nclass utf32le_encoding {\npublic:\n  using state_type = trivial_encoding_state;\n  using state_transition_type = trivial_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 4;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Class utf32bom_encoding\n\nThe `utf32bom_encoding` class implements support for the [Unicode] UTF-32\n[encoding](#encoding) with a byte order mark (BOM).\n\nThis [encoding](#encoding) is stateful, variable width, supports bidirectional\ndecoding, and has a [code unit](#code-unit) of type `char`.\n\nErrors that occur during encoding and decoding operations are reported via\nthe `encode_status` and `decode_status` return types.  Exceptions are not\ndirectly thrown, but may propagate from operations performed on the\ndependent code unit iterator.\n\nThis [encoding](#encoding) defines a state transition class that enables\nforcing or suppressing the encoding of a BOM, or influencing whether a decoded\nBOM [code unit](#code-unit) sequence represents a BOM or a\n[code point](#code-point).\n\n```C++\nclass utf32bom_encoding_state {\n  /* implementation-defined */\n};\n\nclass utf32bom_encoding_state_transition {\npublic:\n  static utf32bom_encoding_state_transition to_initial_state() noexcept;\n  static utf32bom_encoding_state_transition to_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_be_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_le_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_assume_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_assume_be_bom_written_state() noexcept;\n  static utf32bom_encoding_state_transition to_assume_le_bom_written_state() noexcept;\n};\n\nclass utf32bom_encoding {\npublic:\n  using state_type = utf32bom_encoding_state;\n  using state_transition_type = utf32bom_encoding_state_transition;\n  using character_type = character\u003cunicode_character_set\u003e;\n  using code_unit_type = char;\n\n  static constexpr int min_code_units = 4;\n  static constexpr int max_code_units = 4;\n\n  static const state_type\u0026 initial_state() noexcept;\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode_state_transition(state_type \u0026state,\n                                                 CUIT \u0026out,\n                                                 const state_transition_type \u0026stt,\n                                                 int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitOutputIterator\u003ccode_unit_type\u003e CUIT\u003e\n    static encode_status encode(state_type \u0026state,\n                                CUIT \u0026out,\n                                character_type c,\n                                int \u0026encoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status decode(state_type \u0026state,\n                                CUIT \u0026in_next,\n                                CUST in_end,\n                                character_type \u0026c,\n                                int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n\n  template\u003cCodeUnitIterator CUIT, typename CUST\u003e\n    requires ranges::ForwardIterator\u003cCUIT\u003e()\n          \u0026\u0026 ranges::Convertible\u003cranges::value_type_t\u003cCUIT\u003e, code_unit_type\u003e()\n          \u0026\u0026 ranges::Sentinel\u003cCUST, CUIT\u003e()\n    static decode_status rdecode(state_type \u0026state,\n                                 CUIT \u0026in_next,\n                                 CUST in_end,\n                                 character_type \u0026c,\n                                 int \u0026decoded_code_units)\n    noexcept(/* implementation defined */);\n};\n```\n\n### Encoding type aliases\n\nThe `execution_character_encoding`,\n`execution_wide_character_encoding`,\n`char8_character_encoding`,\n`char16_character_encoding`, and\n`char32_character_encoding` type aliases reflect the implementation\ndefined [encodings](#encoding) used for execution, wide execution, UTF-8,\nchar16_t, and char32_t string literals.\n\nEach of these [encodings](#encoding) carries a compatibility requirement with\nanother [encoding](#encoding).  Decode compatibility is satisfied when the\nfollowing criteria is met.\n\n1. Text encoded by the compatibility [encoding](#encoding) can be decoded\n   by the aliased [encoding](#encoding).\n2. Text encoded by the aliased [encoding](#encoding) can be decoded by the\n   compatibility [encoding](#encoding) when encoded [characters](#character)\n   are restricted to members of the [character set](#character-set) of the\n   compatibility [encoding](#encoding).\n\nThese compatibility requirements allow implementation freedom to use\n[encodings](#encoding) that provide features beyond the minimum requirements\nimposed on the compatibility [encodings](#encoding) by the standard.  For\nexample, the [encoding](#encoding) aliased by `execution_character_encoding`\nis allowed to support [characters](#character) that are not members of the\n[character set](#character-set) of the `basic_execution_character_encoding`\n\nThe [encoding](#encoding) aliased by `execution_character_encoding` must be\ndecode compatible with the `basic_execution_character_encoding`\n[encoding](#encoding).\n\nThe [encoding](#encoding) aliased by `execution_wide_character_encoding` must\nbe decode compatible with the\n`basic_execution_wide_character_encoding` [encoding](#encoding).\n\nThe [encoding](#encoding) aliased by `char8_character_encoding` must be\ndecode compatible with the `utf8_encoding` [encoding](#encoding).\n\nThe [encoding](#encoding) aliased by `char16_character_encoding` must be\ndecode compatible with the `utf16_encoding` [encoding](#encoding).\n\nThe [encoding](#encoding) aliased by `char32_character_encoding` must be\ndecode compatible with the `utf32_encoding` [encoding](#encoding).\n\n```C++\nusing execution_character_encoding = /* implementation-defined */ ;\nusing execution_wide_character_encoding = /* implementation-defined */ ;\nusing char8_character_encoding = /* implementation-defined */ ;\nusing char16_character_encoding = /* implementation-defined */ ;\nusing char32_character_encoding = /* implementation-defined */ ;\n```\n\n## Text iterators\n\n- [Class template itext_iterator](#class-template-itext_iterator)\n- [Class template itext_sentinel](#class-template-itext_sentinel)\n- [Class template otext_iterator](#class-template-otext_iterator)\n- [make_otext_iterator](#make_otext_iterator)\n\n### Class template itext_iterator\n\nObjects of `itext_iterator` class template specialization type provide a\nstandard iterator interface for enumerating the [characters](#character) encoded\nby the associated [encoding](#encoding) `ET` in the [code unit](#code-unit)\nsequence exposed by the associated view.  These types satisfy the\n`TextInputIterator` concept and are default constructible, copy and move\nconstructible, copy and move assignable, and equality comparable.\n\nThese types also conditionally satisfy `ranges::ForwardIterator`,\n`ranges::BidirectionalIterator`, and `ranges::RandomAccessIterator` depending\non traits of the associated [encoding](#encoding) `ET` and view `VT` as\ndescribed in the following table.\n\nWhen `ET` and `ranges::iterator_t\u003cVT\u003e` satisfy ... | then `itext_iterator\u003cET, VT\u003e` satisfies ...  | and `itext_iterator\u003cET, VT\u003e::iterator_category` is ...\n-------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------\n`ranges::InputIterator\u003cranges::iterator_t\u003cVT\u003e\u003e \u0026\u0026` \u003cbr/\u003e `! ranges::ForwardIterator\u003cranges::iterator_t\u003cVT\u003e\u003e \u0026\u0026` \u003cbr/\u003e `TextForwardDecoder\u003cET, /* implementation-defined */ \u003e` \u003cbr/\u003e (With an internal adapter to provide forward iterator semantics over the input iterator) | `ranges::InputIterator` | `std::input_iterator_tag`\n`TextForwardDecoder\u003cET, ranges::iterator_t\u003cVT\u003e\u003e` | `ranges::ForwardIterator` | `std::forward_iterator_tag`\n`TextBidirectionalDecoder\u003cET, ranges::iterator_t\u003cVT\u003e\u003e` | `ranges::BidirectionalIterator` | `std::bidirectional_iterator_tag`\n`TextRandomAccessDecoder\u003cET, ranges::iterator_t\u003cVT\u003e\u003e` | `ranges::RandomAccessIterator` | `std::random_access_iterator_tag`\n\nMember functions provide access to the stored [encoding](#encoding) state, the\nunderlying [code unit](#code-unit) iterator, and the underlying\n[code unit](#code-unit) range for the current [character](#character).  The\nunderlying [code unit](#code-unit) range is returned with an implementation\ndefined type that satisfies `ranges::View`.  The `is_ok` member function\nreturns true if the iterator is dereferenceable as a result of having\nsuccessfully decoded a [code point](#code-point) (This predicate is used to\ndistinguish between an input iterator that just successfully decoded the last\n[code point](#code-point) in the [code unit](#code-unit) stream as compared to\none that was advanced after having done so; in both cases, the underlying\n[code unit](#code-unit) input iterator will compare equal to the end\niterator).\n\nThe `error_occurred` and `get_error` member functions enable retrieving\ninformation about errors that occurred during decoding operations.  if a call\nto `error_occurred` returns `false`, then it is guaranteed that a dereference\noperation will not throw an exception; assuming a non-singular iterator that is\nnot past the end.\n\nThe `look_ahead_range` member function is provided only when the underlying\ncode unit iterator is an input iterator; it provides access to code units that\nwere read from the code unit iterator, but were not (yet) used to decode a\ncharacter.  Generally such look ahead only occurs when an invalid code unit\nsequence is encountered.\n\n`itext_iterator` is a [proxy iterator][P0022R1] since the value type is computed\nand a meaningful reference type cannot be provided for the dereference and\nsubscript operators.  The `reference` member type is an alias of an\nimplementation defined proxy reference type, must satisfy `Character`, and must\nsupport implicit conversion to `const value_type\u0026`.\n\nNote: Implementation of a reference proxy would be simplified if the\n[operator dot proposal][P0252R0] is adopted.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\n  requires TextForwardDecoder\u003c\n             ET,\n             /* implementation-defined */ \u003e()\nclass itext_iterator {\npublic:\n  using encoding_type = ET;\n  using view_type = VT;\n  using error_policy = TEP;\n  using state_type = typename encoding_type::state_type;\n\n  using iterator = ranges::iterator_t\u003cstd::add_const_t\u003cview_type\u003e\u003e;\n  using iterator_category = /* implementation-defined */;\n  using value_type = character_type_t\u003cencoding_type\u003e;\n  using reference = value_type;\n  using pointer = std::add_const_t\u003cvalue_type\u003e*;\n  using difference_type = ranges::difference_type_t\u003citerator\u003e;\n\n  itext_iterator();\n\n  itext_iterator(state_type state,\n                 const view_type *view,\n                 iterator first);\n\n  reference operator*() const noexcept;\n  pointer operator-\u003e() const noexcept;\n\n  friend bool operator==(const itext_iterator \u0026l, const itext_iterator \u0026r);\n  friend bool operator!=(const itext_iterator \u0026l, const itext_iterator \u0026r);\n\n  friend bool operator\u003c(const itext_iterator \u0026l, const itext_iterator \u0026r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  friend bool operator\u003e(const itext_iterator \u0026l, const itext_iterator \u0026r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  friend bool operator\u003c=(const itext_iterator \u0026l, const itext_iterator \u0026r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  friend bool operator\u003e=(const itext_iterator \u0026l, const itext_iterator \u0026r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n\n  itext_iterator\u0026 operator++();\n  itext_iterator\u0026 operator++()\n    requires TextForwardDecoder\u003cencoding_type, iterator\u003e();\n  itext_iterator operator++(int);\n\n  itext_iterator\u0026 operator--()\n    requires TextBidirectionalDecoder\u003cencoding_type, iterator\u003e();\n  itext_iterator operator--(int)\n    requires TextBidirectionalDecoder\u003cencoding_type, iterator\u003e();\n\n  itext_iterator\u0026 operator+=(difference_type n)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  itext_iterator\u0026 operator-=(difference_type n)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n\n  friend itext_iterator operator+(itext_iterator l, difference_type n)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  friend itext_iterator operator+(difference_type n, itext_iterator r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n\n  friend itext_iterator operator-(itext_iterator l, difference_type n)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n  friend difference_type operator-(const itext_iterator \u0026l,\n                                   const itext_iterator \u0026r)\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n\n  reference operator[](difference_type n) const\n    requires TextRandomAccessDecoder\u003cencoding_type, iterator\u003e();\n\n  const state_type\u0026 state() const noexcept;\n\n  const iterator\u0026 base() const noexcept;\n\n  /* implementation-defined */ base_range() const noexcept;\n\n  /* implementation-defined */ look_ahead_range() const noexcept\n    requires ! ranges::ForwardIterator\u003citerator\u003e();\n\n  bool error_occurred() const noexcept;\n  decode_status get_error() const noexcept;\n\n  bool is_ok() const noexcept;\n\nprivate:\n  state_type base_state;  // exposition only\n  iterator base_iterator; // exposition only\n  bool ok;                // exposition only\n};\n```\n\n### Class template itext_sentinel\n\nObjects of `itext_sentinel` class template specialization type denote the end\nof a range of text as delimited by a sentinel object for the underlying\n[code unit](#code-unit) sequence.  These types satisfy the `TextSentinel`\nconcept and are default constructible, copy and move constructible, and copy and\nmove assignable.  Member functions provide access to the sentinel for the\nunderlying [code unit](#code-unit) sequence.\n\nObjects of these types are equality comparable to `itext_iterator` objects that\nhave matching [encoding](#encoding) and view types.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\nclass itext_sentinel {\npublic:\n  using view_type = VT;\n  using error_policy = TEP;\n  using sentinel = ranges::sentinel_t\u003cstd::add_const_t\u003cview_type\u003e\u003e;\n\n  itext_sentinel() = default;\n\n  itext_sentinel(sentinel s);\n\n  friend bool operator==(const itext_iterator\u003cET, VT, TEP\u003e \u0026ti,\n                         const itext_sentinel \u0026ts);\n  friend bool operator!=(const itext_iterator\u003cET, VT, TEP\u003e \u0026ti,\n                         const itext_sentinel \u0026ts);\n  friend bool operator==(const itext_sentinel \u0026ts,\n                         const itext_iterator\u003cET, VT, TEP\u003e \u0026ti);\n  friend bool operator!=(const itext_sentinel \u0026ts,\n                         const itext_iterator\u003cET, VT, TEP\u003e \u0026ti);\n\n  const sentinel\u0026 base() const noexcept;\n\nprivate:\n  sentinel base_sentinel; // exposition only\n};\n```\n\n### Class template otext_iterator\n\nObjects of `otext_iterator` class template specialization type provide a\nstandard iterator interface for encoding [characters](#character) in the form\nimplemented by the associated [encoding](#encoding) `ET`.  These types satisfy\nthe `TextOutputIterator` concept and are default constructible, copy and move\nconstructible, and copy and move assignable.\n\nMember functions provide access to the stored encoding state and the underlying\n[code unit](#code-unit) output iterator.\n\nThe `error_occurred` and `get_error` member functions enable retrieving\ninformation about errors that occurred during encoding operations.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e CUIT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\nclass otext_iterator {\npublic:\n  using encoding_type = ET;\n  using error_policy = TEP;\n  using state_type = typename ET::state_type;\n  using state_transition_type = typename ET::state_transition_type;\n\n  using iterator = CUIT;\n  using iterator_category = std::output_iterator_tag;\n  using value_type = character_type_t\u003cencoding_type\u003e;\n  using reference = value_type\u0026;\n  using pointer = value_type*;\n  using difference_type = ranges::difference_type_t\u003citerator\u003e;\n\n  otext_iterator();\n\n  otext_iterator(state_type state, iterator current);\n\n  otext_iterator\u0026 operator*() const noexcept;\n\n  otext_iterator\u0026 operator++() noexcept;\n  otext_iterator\u0026 operator++(int) noexcept;\n\n  otext_iterator\u0026 operator=(const state_transition_type \u0026stt);\n  otext_iterator\u0026 operator=(const character_type_t\u003cencoding_type\u003e \u0026value);\n\n  const state_type\u0026 state() const noexcept;\n\n  const iterator\u0026 base() const noexcept;\n\n  bool error_occurred() const noexcept;\n  encode_status get_error() const noexcept;\n\nprivate:\n  state_type base_state;  // exposition only\n  iterator base_iterator; // exposition only\n};\n```\n\n### make_otext_iterator\n\nThe `make_otext_iterator` functions enable convenient construction of\n`otext_iterator` objects via type deduction of the underlying\n[code unit](#code-unit) output iterator type.  Overloads are provided to enable\nconstruction with an explicit [encoding](#encoding) state or the implicit\n[encoding](#encoding) dependent initial state.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(typename ET::state_type state, IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\ntemplate\u003cTextEncoding ET,\n         CodeUnitOutputIterator\u003ccode_unit_type_t\u003cET\u003e\u003e IT\u003e\n  auto make_otext_iterator(IT out)\n  -\u003e otext_iterator\u003cET, IT\u003e;\n```\n\n## Text view\n\n- [Class template basic_text_view](#class-template-basic_text_view)\n- [Text view type aliases](#text-view-type-aliases)\n- [make_text_view](#make_text_view)\n\n### Class template basic_text_view\n\nObjects of `basic_text_view` class template specialization type provide a view\nof an underlying [code unit](#code-unit) sequence as a sequence of\n[characters](#character).  These types satisfy the `TextView` concept and are\ndefault constructible, copy and move constructible, and copy and move\nassignable.  Member functions provide access to the underlying\n[code unit](#code-unit) sequence and the initial [encoding](#encoding)\nstate for the range.\n\nConstructors are provided to construct objects of these types from objects of\nthe underlying [code unit](#code-unit) view type and from iterator and sentinel\npairs, iterator and difference pairs, and range or `std::basic_string` types for\nwhich an object of the underlying [code unit](#code-unit) view type can be\nconstructed.  For each of these, overloads are provided to construct the view\nwith an explicit [encoding](#encoding) state or with an implicit initial\n[encoding](#encoding) state provided by the [encoding](#encoding) `ET`.\n\nThe end of the view is represented with a sentinel type when the end of the\nunderlying [code unit](#code-unit) view is represented with a sentinel type or\nwhen the [encoding](#encoding) `ET` is a stateful [encoding](#encoding);\notherwise, the end of the view is represented with an iterator of the same type\nas used for the beginning of the view.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         ranges::View VT,\n         TextErrorPolicy TEP = text_default_error_policy\u003e\nclass basic_text_view : public ranges::view_base {\npublic:\n  using encoding_type = ET;\n  using view_type = VT;\n  using error_policy = TEP;\n  using state_type = typename ET::state_type;\n  using code_unit_iterator = ranges::iterator_t\u003cstd::add_const_t\u003cview_type\u003e\u003e;\n  using code_unit_sentinel = ranges::sentinel_t\u003cstd::add_const_t\u003cview_type\u003e\u003e;\n  using iterator = itext_iterator\u003cET, VT, TEP\u003e;\n  using sentinel = itext_sentinel\u003cET, VT, TEP\u003e;\n\n  basic_text_view();\n\n  basic_text_view(state_type state,\n                  view_type view);\n\n  basic_text_view(view_type view);\n\n  basic_text_view(state_type state,\n                  code_unit_iterator first,\n                  code_unit_sentinel last)\n    requires ranges::Constructible\u003cview_type,\n                                   code_unit_iterator\u0026\u0026,\n                                   code_unit_sentinel\u0026\u0026\u003e();\n\n  basic_text_view(code_unit_iterator first,\n                  code_unit_sentinel last)\n    requires ranges::Constructible\u003cview_type,\n                                   code_unit_iterator\u0026\u0026,\n                                   code_unit_sentinel\u0026\u0026\u003e();\n\n  basic_text_view(state_type state,\n                  code_unit_iterator first,\n                  ranges::difference_type_t\u003ccode_unit_iterator\u003e n)\n    requires ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_iterator\u003e();\n\n  basic_text_view(code_unit_iterator first,\n                  ranges::difference_type_t\u003ccode_unit_iterator\u003e n)\n    requires ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_iterator\u003e();\n\n  template\u003ctypename charT, typename traits, typename Allocator\u003e\n    basic_text_view(state_type state,\n                    const basic_string\u003ccharT, traits, Allocator\u003e \u0026str)\n    requires ranges::Constructible\u003ccode_unit_iterator, const charT *\u003e()\n          \u0026\u0026 ranges::ConvertibleTo\u003cranges::difference_type_t\u003ccode_unit_iterator\u003e,\n                                   typename basic_string\u003ccharT, traits, Allocator\u003e::size_type\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_sentinel\u003e();\n\n  template\u003ctypename charT, typename traits, typename Allocator\u003e\n    basic_text_view(const basic_string\u003ccharT, traits, Allocator\u003e \u0026str)\n    requires ranges::Constructible\u003ccode_unit_iterator, const charT *\u003e()\n          \u0026\u0026 ranges::ConvertibleTo\u003cranges::difference_type_t\u003ccode_unit_iterator\u003e,\n                                   typename basic_string\u003ccharT, traits, Allocator\u003e::size_type\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_sentinel\u003e();\n\n  template\u003cranges::InputRange Iterable\u003e\n    basic_text_view(state_type state,\n                    const Iterable \u0026iterable)\n    requires ranges::Constructible\u003ccode_unit_iterator,\n                                   ranges::iterator_t\u003cconst Iterable\u003e\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_sentinel\u003e();\n\n  template\u003cranges::InputRange Iterable\u003e\n    basic_text_view(const Iterable \u0026iterable)\n    requires ranges::Constructible\u003ccode_unit_iterator,\n                                   ranges::iterator_t\u003cconst Iterable\u003e\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_sentinel\u003e();\n\n  basic_text_view(iterator first, iterator last)\n    requires ranges::Constructible\u003ccode_unit_iterator,\n                                   decltype(std::declval\u003citerator\u003e().base())\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_iterator\u003e();\n\n  basic_text_view(iterator first, sentinel last)\n    requires ranges::Constructible\u003ccode_unit_iterator,\n                                   decltype(std::declval\u003citerator\u003e().base())\u003e()\n          \u0026\u0026 ranges::Constructible\u003cview_type,\n                                   code_unit_iterator,\n                                   code_unit_sentinel\u003e();\n\n  const view_type\u0026 base() const noexcept;\n\n  const state_type\u0026 initial_state() const noexcept;\n\n  iterator begin() const;\n  iterator end() const\n    requires std::is_empty\u003cstate_type\u003e::value\n          \u0026\u0026 ranges::Iterator\u003ccode_unit_sentinel\u003e();\n  sentinel end() const\n    requires !std::is_empty\u003cstate_type\u003e::value\n          || !ranges::Iterator\u003ccode_unit_sentinel\u003e();\n\nprivate:\n  state_type base_state; // exposition only\n  view_type base_view;   // exposition only\n};\n\n```\n\n### Text view type aliases\n\nThe `text_view`, `wtext_view`, `u8text_view`, `u16text_view` and\n`u32text_view` type aliases reference an implementation defined specialization\nof `basic_text_view` for all five of the [encodings](#encoding) the standard\nstates must be provided.\n\nThe implementation defined view type used for the underlying\n[code unit](#code-unit) view type must satisfy `ranges::View` and provide\niterators of pointer to the underlying [code unit](#code-unit) type to\ncontiguous storage.  The intent in providing these type aliases is to minimize\ninstantiations of the `basic_text_view` and `itext_iterator` class templates by\nencouraging use of common view types with underlying [code unit](#code-unit)\nviews that reference contiguous storage, such as views into objects with a type\ninstantiated from `std::basic_string`.\n\nIt is permissible for the `text_view` and `u8text_view` type aliases to\nreference the same type.  This will be the case when the execution character\n[encoding](#encoding) is UTF-8.  Attempts to overload functions based on\n`text_view` and `u8text_view` will result in multiple function\ndefinition errors on such implementations.\n\n```C++\nusing text_view = basic_text_view\u003c\n          execution_character_encoding,\n          /* implementation-defined */ \u003e;\nusing wtext_view = basic_text_view\u003c\n          execution_wide_character_encoding,\n          /* implementation-defined */ \u003e;\nusing u8text_view = basic_text_view\u003c\n          char8_character_encoding,\n          /* implementation-defined */ \u003e;\nusing u16text_view = basic_text_view\u003c\n          char16_character_encoding,\n          /* implementation-defined */ \u003e;\nusing u32text_view = basic_text_view\u003c\n          char32_character_encoding,\n          /* implementation-defined */ \u003e;\n```\n\n### make_text_view\n\nThe `make_text_view` functions enable convenient construction of\n`basic_text_view` objects via implicit selection of a view type for the\nunderlying [code unit](#code-unit) sequence.\n\nWhen provided iterators or ranges for contiguous storage, these functions return\na `basic_text_view` specialization type that uses the same implementation\ndefined view type as for the `basic_text_view` type\naliases as discussed in [Text view type aliases](#text-view-type-aliases).\n\nOverloads are provided to construct `basic_text_view` objects from\niterator and sentinel pairs, iterator and difference pairs, and range or\n`std::basic_string` objects.  For each of these overloads, additional \noverloads are provided to construct the view with an explicit\n[encoding](#encoding) state or with an implicit initial [encoding](#encoding)\nstate provided by the [encoding](#encoding) `ET`.  Each of these overloads\nrequires that the [encoding](#encoding) type be explicitly specified.\n\nAdditional overloads are provided to construct the view from iterator and\nsentinel pairs that satisfy `TextInputIterator` and objects of a type that\nsatisfies `TextView`.  For these overloads, the [encoding](#encoding) type is\ndeduced and the [encoding](#encoding) state is implicitly copied from the\narguments.\n\nIf `make_text_view` is invoked with an rvalue range, then the lifetime of the\nreturned object and all copies of it must end with the full-expression that the\n`make_text_view` invocation is within.  Otherwise, the returned object or its\ncopies will hold iterators into a destructed object resulting in undefined\nbehavior.\n\n```C++\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  auto make_text_view(IT first, ST last)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::InputIterator IT,\n         ranges::Sentinel\u003cIT\u003e ST\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      ST last)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::ForwardIterator IT\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::ForwardIterator IT\u003e\n  auto make_text_view(typename ET::state_type state,\n                      IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e::state_type state,\n                      IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::ForwardIterator IT\u003e\n  auto make_text_view(IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::ForwardIterator IT\u003e\n  auto make_text_view(IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::ForwardIterator IT\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e;\n  }\n  auto make_text_view(IT first,\n                      ranges::difference_type_t\u003cIT\u003e n)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cIT\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::InputRange Iterable\u003e\n  auto make_text_view(typename ET::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::InputRange Iterable\u003e\n  auto make_text_view(typename ET::state_type state,\n                      const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cRT\u003e\u003e\u003e::state_type state,\n                      const RT \u0026range)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cRT\u003e\u003e\u003e::state_type state,\n                      const RT \u0026range)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         TextErrorPolicy TEP,\n         ranges::InputRange Iterable\u003e\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextEncoding ET,\n         ranges::InputRange Iterable\u003e\n  auto make_text_view(const Iterable \u0026iterable)\n  -\u003e basic_text_view\u003cET, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         ranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(\n    const RT \u0026range)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cranges::InputRange Iterable\u003e\n  requires requires () {\n    typename default_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e;\n  }\n  auto make_text_view(\n    const RT \u0026range)\n  -\u003e basic_text_view\u003cdefault_encoding_type_t\u003cranges::value_type_t\u003cranges::iterator_t\u003cIterable\u003e\u003e\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         TextInputIterator TIT,\n         TextSentinel\u003cTIT\u003e TST\u003e\n  auto make_text_view(TIT first, TST last)\n  -\u003e basic_text_view\u003cencoding_type_t\u003cTIT\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextInputIterator TIT,\n         TextSentinel\u003cTIT\u003e TST\u003e\n  auto make_text_view(TIT first, TST last)\n  -\u003e basic_text_view\u003cencoding_type_t\u003cTIT\u003e, /* implementation-defined */ \u003e;\n\ntemplate\u003cTextErrorPolicy TEP,\n         TextView TVT\u003e\n  TVT make_text_view(TVT tv);\n\ntemplate\u003cTextView TVT\u003e\n  TVT make_text_view(TVT tv);\n```\n\n# Supported Encodings\nAs of 2015-12-31, supported [encodings](#encoding) include:\n\nEncoding name | Description | Encoding type\n------------- | ----------- | -------------\nexecution_character_encoding | Type alias for the encoding of ordinary string literals (C++11 2.3p3) | implementation defined\nexecution_wide_character_encoding | Type alias for the encoding of wide string literals (C++11 2.3p3) | implementation defined\nchar8_character_encoding | Type alias for the encoding of UTF-8 string literals (C++11 2.14.5p7) | implementation defined\nchar16_character_encoding | Type alias for the encoding of char16_t string literals (C++11 2.14.5p9) | implementation defined\nchar32_character_encoding | Type alias for the encoding of char32_t string literals (C++11 2.14.5p10) | implementation defined\nbasic_execution_character_encoding | An encoding that meets the minimum requirements of C++11 2.3p3 | trivial\nbasic_execution_wide_character_encoding | An encoding that meets the minimum requirements of C++11 2.3p3 | trivial\niso_10646_wide_character_encoding | An ISO 10646 encoding.  Only defined if __STDC_ISO_10646__ is defined | trivial\nutf8_encoding | [Unicode] UTF-8 | stateless, variable width\nutf8bom_encoding | [Unicode] UTF-8 with a byte order mark | stateful, variable width\nutf16_encoding | [Unicode] UTF-16, native endian | stateless, variable width\nutf16be_encoding | [Unicode] UTF-16, big endian | stateless, variable width\nutf16le_encoding | [Unicode] UTF-16, little endian | stateless, variable width\nutf16bom_encoding | [Unicode] UTF-16 with a byte order mark | stateful, variable width\nutf32_encoding | [Unicode] UTF-32, native endian | trivial\nutf32be_encoding | [Unicode] UTF-32, big endian | stateless, fixed width\nutf32le_encoding | [Unicode] UTF-32, little endian | stateless, fixed width\nutf32bom_encoding | [Unicode] UTF-32 with a byte order mark | stateful, variable width\n\n# Terminology\nThe terminology used in this document and in the [Text_view] library has been\nchosen to be consistent with industry standards and, in particular, the\n[Unicode standard].  Any inconsistencies in the use of this terminology and that\nin the [Unicode standard] is unintentional.  The terms described in this\ndocument and used within the [Text_view] library comprise a subset of the\nterminology used within the [Unicode standard]; only those terms necessary to\nspecify functionality exhibited by this library are included here.  Those who\nwould like to learn more about general text processing terminology in computer\nsystems are encouraged to read chatper 2, \"General Structure\" of the\n[Unicode standard].\n\n## Code Unit\nA single, indivisible, integral element of an encoded sequence of characters.  A\nsequence of one or more code units specifies a code point or encoding state\ntransition as defined by a character encoding.  A code unit does not, by itself,\nidentify any particular character or code point; the meaning ascribed to a\nparticular code unit value is derived from a character encoding definition.\n\nThe [C++11][ISO/IEC 14882:2011] `char`, `wchar_t`, `char16_t`, and `char32_t`\ntypes are most commonly used as code unit types.\n\nThe string literal `u8\"J\\u00F8erg\"` contains 7 code units and 6 code unit\nsequences; \"\\u00F8\" is encoded using two code units and string literals contain\na trailing NUL code unit.\n\nThe string literal `\"J\\u00F8erg\"` contains an implementation defined number of\ncode units.  The standard does not specify the encoding of ordinary and wide\nstring literals, so the number of code units encoded by \"\\u00F8\" depends on the\nimplementation defined encoding used for ordinary string literals.\n\n## Code Point\nAn integral value denoting an abstract character as defined by a character set.\nA code point does not, by itself, identify any particular character; the\nmeaning ascribed to a particular code point value is derived from a character\nset definition.\n\nThe [C++11][ISO/IEC 14882:2011] `char`, `wchar_t`, `char16_t`, and `char32_t`\ntypes are most commonly used as code point types.\n\nThe string literal `u8\"J\\u00F8erg\"` describes a sequence of 6 code point values;\nstring literals implicitly specify a trailing NUL code point.\n\nThe string literal `\"J\\u00F8erg\"` describes a sequence of an implementation\ndefined number of code point values.  The standard does not specify the encoding\nof ordinary and wide string literals, so the number of code points encoded by\n\"\\u00F8\" depends on the implementation defined encoding used for ordinary string\nliterals.  Implementations are permitted to translate a single code point in the\nsource or Unicode character sets to multiple code points in the execution\nencoding.\n\n## Character Set\nA mapping of code point values to abstract characters.  A character set need not\nprovide a mapping for every possible code point value representable by the code\npoint type.\n\n[C++11][ISO/IEC 14882:2011] does not specify the use of any particular character\nset or encoding for ordinary and wide character and string literals, though it\ndoes place some restrictions on them.  Unicode character and string literals are\ngoverned by the [Unicode] standard.\n\nCommon character sets include [ASCII], [Unicode][Unicode code charts], and\n[Windows code page 1252].\n\n## Character\nAn element of written language, for example, a letter, number, or symbol.  A\ncharacter is identified by the combination of a character set and a code point\nvalue.\n\n## Encoding\nA method of representing a sequence of characters as a sequence of code unit\nsequences.\n\nAn encoding may be stateless or stateful.  In stateless encodings, characters\nmay be encoded or decoded starting from the beginning of any code unit sequence.\nIn stateful encodings, it may be necessary to record certain affects of\npreviously encoded characters in order to correctly encode additional\ncharacters, or to decode preceding code unit sequences in order to correctly\ndecode following code unit sequences.\n\nAn encoding may be fixed width or variable width.  In fixed width encodings,\nall characters are encoded using a single code unit sequence and all code unit\nsequences have the same length.  In variable width encodings, different\ncharacters may require multiple code unit sequences, or code unit sequences of\nvarying length.\n\nAn encoding may support bidirectional or random access decoding of code unit\nsequences.  In bidirectional encodings, characters may be decoded by traversing\ncode unit sequences in reverse order.  Such encodings must support a method to\nidentify the start of a preceding code unit sequence.  In random access\nencodings, characters may be decoded from any code unit sequence within the\nsequence of code unit sequences, in constant time, without having to decode any\nother code unit sequence.  Random access encodings are necessarily stateless\nand fixed length.  An encoding that is neither bidirectional, nor random\naccess, may only be decoded by traversing code unit sequences in forward order.\n\nAn encoding may support encoding characters from multiple character sets.  Such\nan encoding is either stateful and defines code unit sequences that switch the\nactive character set, or defines code unit sequences that implicitly identify\na character set, or both.\n\nA trivial encoding is one in which all encoded characters correspond to a single\ncharacter set and where each code unit encodes exactly one character using the\nsame value as the code point for that character.  Such an encoding is stateless,\nfixed width, and supports random access decoding.\n\nCommon encodings include the [Unicode] UTF-8, UTF-16, and UTF-32 encodings, the\nISO/IEC 8859 series of encodings including [ISO/IEC 8859-1], and many trivial\nencodings such as [Windows code page 1252].\n\n# References\n- [Text_view]  \n  https://github.com/tahonermann/text_view\n- [Text_view-range-v3]\n  https://github.com/tahonermann/text_view-range-v3\n- [cmcstl2]\n  https://github.com/CaseyCarter/cmcstl2\n- [ISO/IEC technical specification 19217:2015, C++ Extensions for concepts][ISO/IEC 19217:2015]  \n  http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=64031\n- [P0252R0: Operator Dot Wording][P0252R0]\n  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0252r0.pdf\n- [P0184R0: Generalizing the Range-Based For Loop][P0184R0]  \n  http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0184r0.html\n- [P0022R1: Proxy Iterators for the Ranges Extensions][P0022R1]  \n  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0022r1.html\n- [N4560: Working Draft, C++ Extensions for Ranges][N4560]  \n  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4560.pdf\n- [N2442: Raw and Unicode String Literals; Unified Proposal (Rev. 2)][N2442]  \n  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm\n- [N2249: New Character Types in C++][N2249]  \n  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html\n- [Unicode]  \n  http://unicode.org\n- [CMake]  \n  https://cmake.org\n\n[Text_view]:\nhttps://github.com/tahonermann/text_view\n(Text_view library)\n[Text_view-range-v3]:\nhttps://github.com/tahonermann/text_view-range-v3\n(Text_view for range-v3)\n[cmcstl2]:\nhttps://github.com/CaseyCarter/cmcstl2\n(An implementation of C++ Extensions for Ranges)\n[Unicode]:\nhttp://unicode.org\n(The Unicode Consortium)\n[Unicode standard]:\nhttp://www.unicode.org/standard/standard.html\n(The Unicode Standard)\n[Unicode code charts]:\nhttp://www.unicode.org/charts\n(Unicode Character Code Charts)\n[ASCII]:\nhttp://webstore.ansi.org/RecordDetail.aspx?sku=INCITS+4-1986[R2012]\n(INCITS 4-1986[R2012])\n[Windows code page 1252]:\nhttps://msdn.microsoft.com/en-us/library/cc195054.aspx\n(Code Page 1252 Windows Latin 1)\n[ISO/IEC 8859-1]:\nhttp://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2fIEC+8859-1%3a1998\n(ISO/IEC 8859-1:1998 Information technology - 8-bit single-byte coded graphic character sets - Part 1: Latin alphabet No. 1)\n[ISO/IEC 14882:2011]:\nhttp://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=50372\n(ISO/IEC 14882:2011 Information technology -- Programming languages -- C++)\n[ISO/IEC 19217:2015]:\nhttp://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=64031\n(ISO/IEC technical specification 19217:2015, C++ Extensions for concepts)\n[N2249]:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html\n(N2249: New Character Types in C++)\n[N2442]:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm\n(N2442: Raw and Unicode String Literals; Unified Proposal \\(Rev. 2\\))\n[N4560]:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4560.pdf\n(N4560: Working Draft, C++ Extensions for Ranges)\n[P0022R1]:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0022r1.html\n(P0022R1: Proxy Iterators for the Ranges Extensions)\n[P0184R0]:\nhttp://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0184r0.html\n(P0184R0: Generalizing the Range-Based For Loop)\n[P0244]:\nhttp://wg21.link/p0244\n(P0244: Text_view: A C++ concepts and range based character encoding and code point enumeration library)\n[P0252R0]:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0252r0.pdf\n(P0252R0: Operator Dot Wording)\n[gcc]:\nhttps://gcc.gnu.org\n(GCC, the GNU Compiler Collection)\n[cmake]:\nhttps://cmake.org\n(The CMake build system)\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahonermann%2Ftext_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftahonermann%2Ftext_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftahonermann%2Ftext_view/lists"}