Mark de Wever | f78f93b | 2022-09-23 16:33:20 | [diff] [blame] | 1 | .. _implementation-defined-behavior: |
| 2 | |
| 3 | =============================== |
| 4 | Implementation-defined behavior |
| 5 | =============================== |
| 6 | |
| 7 | Contains the implementation details of the implementation-defined behavior in |
| 8 | libc++. Implementation-defined is mandated to be documented by the Standard. |
| 9 | |
| 10 | .. note: |
| 11 | This page is far from complete. |
| 12 | |
| 13 | |
| 14 | Implementation-defined behavior |
| 15 | =============================== |
| 16 | |
| 17 | Updating the Time Zone Database |
| 18 | ------------------------------- |
| 19 | |
| 20 | The Standard allows implementations to automatically update the |
| 21 | *remote time zone database*. Libc++ opts not to do that. Instead calling |
| 22 | |
| 23 | - ``std::chrono::remote_version()`` will update the version information of the |
| 24 | *remote time zone database*, |
| 25 | - ``std::chrono::reload_tzdb()``, if needed, will update the entire |
| 26 | *remote time zone database*. |
| 27 | |
| 28 | This offers a way for users to update the *remote time zone database* and |
| 29 | give them full control over the process. |
| 30 | |
Mark de Wever | 2fd4084 | 2023-12-19 18:32:17 | [diff] [blame] | 31 | |
| 32 | `[ostream.formatted.print]/3 <http://eel.is/c++draft/ostream.formatted.print#3>`_ A terminal capable of displaying Unicode |
| 33 | -------------------------------------------------------------------------------------------------------------------------- |
| 34 | |
| 35 | The Standard specifies that the manner in which a stream is determined to refer |
| 36 | to a terminal capable of displaying Unicode is implementation-defined. This is |
| 37 | used for ``std::print`` and similar functions taking an ``ostream&`` argument. |
| 38 | |
| 39 | Libc++ determines that a stream is Unicode-capable terminal by: |
| 40 | |
| 41 | * First it determines whether the stream's ``rdbuf()`` has an underlying |
| 42 | ``FILE*``. This is ``true`` in the following cases: |
| 43 | |
| 44 | * The stream is ``std::cout``, ``std::cerr``, or ``std::clog``. |
| 45 | |
| 46 | * A ``std::basic_filebuf<CharT, Traits>`` derived from ``std::filebuf``. |
| 47 | |
| 48 | * The way to determine whether this ``FILE*`` refers to a terminal capable of |
| 49 | displaying Unicode is the same as specified for `void vprint_unicode(FILE* |
| 50 | stream, string_view fmt, format_args args); |
| 51 | <http://eel.is/c++draft/print.fun#7>`_. This function is used for other |
| 52 | ``std::print`` overloads that don't take an ``ostream&`` argument. |
| 53 | |
PaulXiCao | af0d731 | 2024-07-20 15:50:05 | [diff] [blame] | 54 | `[sf.cmath] <https://wg21.link/sf.cmath>`_ Mathematical Special Functions: Large indices |
| 55 | ---------------------------------------------------------------------------------------- |
| 56 | |
| 57 | Most functions within the Mathematical Special Functions section contain integral indices. |
| 58 | The Standard specifies the result for larger indices as implementation-defined. |
| 59 | Libc++ pursuits reasonable results by choosing the same formulas as for indices below that threshold. |
| 60 | E.g. |
| 61 | |
| 62 | - ``std::hermite(unsigned n, T x)`` for ``n >= 128`` |
| 63 | |
| 64 | |
Mark de Wever | d5a6ec1 | 2024-08-01 15:00:14 | [diff] [blame] | 65 | `[stringbuf.cons] <http://eel.is/c++draft/stringbuf.cons>`_ Whether sequence pointers are initialized to null pointers |
| 66 | ---------------------------------------------------------------------------------------------------------------------- |
| 67 | |
| 68 | Libc++ does not initialize the pointers to null pointers. It resizes the buffer |
| 69 | to its capacity and uses that size. This means the SSO buffer of |
| 70 | ``std::string`` is used as initial output buffer. |
| 71 | |
| 72 | |
Mark de Wever | f78f93b | 2022-09-23 16:33:20 | [diff] [blame] | 73 | Listed in the index of implementation-defined behavior |
| 74 | ====================================================== |
| 75 | |
| 76 | The order of the entries matches the entries in the |
| 77 | `draft of the Standard <http://eel.is/c++draft/impldefindex>`_. |