brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 62f715a Raw
78 lines · plain
1.. _implementation-defined-behavior:2 3===============================4Implementation-defined behavior5===============================6 7This document contains the implementation details of the implementation-defined behavior in libc++.8The C++ standard mandates that implementation-defined behavior is documented.9 10.. note:11   This page is far from complete.12 13 14Implementation-defined behavior15===============================16 17Updating the Time Zone Database18-------------------------------19 20The C++ standard allows implementations to automatically update the21*remote time zone database*. Libc++ opts not to do that. Instead calling22 23 - ``std::chrono::remote_version()`` will update the version information of the24   *remote time zone database*,25 - ``std::chrono::reload_tzdb()``, if needed, will update the entire26   *remote time zone database*.27 28This offers a way for users to update the *remote time zone database* and29give them full control over the process.30 31 32`[ostream.formatted.print]/3 <http://eel.is/c++draft/ostream.formatted.print#3>`_ A terminal capable of displaying Unicode33--------------------------------------------------------------------------------------------------------------------------34 35The C++ standard specifies that the manner in which a stream is determined to refer36to a terminal capable of displaying Unicode is implementation-defined. This is37used for ``std::print`` and similar functions taking an ``ostream&`` argument.38 39Libc++ determines that a stream is Unicode-capable terminal by:40 41* First it determines whether the stream's ``rdbuf()`` has an underlying42  ``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 of49  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 other52  ``std::print`` overloads that don't take an ``ostream&`` argument.53 54`[sf.cmath] <https://wg21.link/sf.cmath>`_ Mathematical Special Functions: Large indices55----------------------------------------------------------------------------------------56 57Most functions within the Mathematical Special Functions section contain integral indices.58The C++ standard specifies the result for larger indices as implementation-defined.59Libc++ pursuits reasonable results by choosing the same formulas as for indices below that threshold.60E.g.,61 62- ``std::hermite(unsigned n, T x)`` for ``n >= 128``63 64 65`[stringbuf.cons] <http://eel.is/c++draft/stringbuf.cons>`_ Whether sequence pointers are initialized to null pointers66----------------------------------------------------------------------------------------------------------------------67 68Libc++ does not initialize the pointers to null pointers. It resizes the buffer69to its capacity and uses that size. This means the SSO buffer of70``std::string`` is used as initial output buffer.71 72 73Listed in the index of implementation-defined behavior74======================================================75 76The order of the entries matches the entries in the77`draft of the Standard <http://eel.is/c++draft/impldefindex>`_.78