mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-24 17:27:21 +00:00
docs:update format issues for files under api-guides
This commit is contained in:
@@ -15,11 +15,13 @@ The following C++ features are supported:
|
||||
- :doc:`thread-local-storage` (``thread_local`` keyword)
|
||||
- All C++ features implemented by GCC, except for some :ref:`cplusplus_limitations`. See `GCC documentation <https://gcc.gnu.org/projects/cxx-status.html>`_ for details on features implemented by GCC.
|
||||
|
||||
|
||||
``esp-idf-cxx`` Component
|
||||
-------------------------
|
||||
|
||||
`esp-idf-cxx <https://github.com/espressif/esp-idf-cxx>`_ component provides higher-level C++ APIs for some of the ESP-IDF features. This component is available from the `ESP-IDF Component Registry <https://components.espressif.com/components/espressif/esp-idf-cxx>`_.
|
||||
|
||||
|
||||
C++ Language Standard
|
||||
---------------------
|
||||
|
||||
@@ -34,6 +36,7 @@ To compile the source code of a certain component using a different language sta
|
||||
|
||||
Use ``PUBLIC`` instead of ``PRIVATE`` if the public header files of the component also need to be compiled with the same language standard.
|
||||
|
||||
|
||||
.. _cplusplus_multithreading:
|
||||
|
||||
Multithreading
|
||||
@@ -47,6 +50,7 @@ See :example:`cxx/pthread` for an example of creating threads in C++.
|
||||
|
||||
The destructor of `std::jthread <https://en.cppreference.com/w/cpp/thread/jthread>`_ can only safely be called from a task that has been created by :ref:`posix_thread_api` or by the `C++ threading library API <https://en.cppreference.com/w/cpp/thread>`_.
|
||||
|
||||
|
||||
.. _cplusplus_exceptions:
|
||||
|
||||
Exception Handling
|
||||
@@ -60,6 +64,7 @@ C++ Exceptions should **only** be used for exceptional cases, i.e., something ha
|
||||
|
||||
See :example:`cxx/exceptions` for an example of C++ exception handling.
|
||||
|
||||
|
||||
C++ Exception Handling and Resource Usage
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -78,6 +83,7 @@ The run time of code using C++ exceptions depends on what actually happens at ru
|
||||
|
||||
If an exception is thrown, the run time of the code that unwinds the stack is orders of magnitude slower than code returning an error code. The significance of the increased run time will depend on the application's requirements and implementation of error handling (e.g., requiring user input or messaging to a cloud). As a result, exception-throwing code should never be used in real-time critical code paths.
|
||||
|
||||
|
||||
.. _cplusplus_rtti:
|
||||
|
||||
Runtime Type Information (RTTI)
|
||||
@@ -95,6 +101,7 @@ Developing in C++
|
||||
|
||||
The following sections provide tips on developing ESP-IDF applications in C++.
|
||||
|
||||
|
||||
Combining C and C++ Code
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -153,6 +160,7 @@ ESP-IDF expects the application entry point, ``app_main``, to be defined with C
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
.. _cplusplus_designated_initializers:
|
||||
|
||||
Designated Initializers
|
||||
@@ -171,6 +179,7 @@ iostream
|
||||
1. Normally, ESP-IDF build process eliminates the unused code. However, in the case of iostreams, simply including ``<iostream>`` header in one of the source files significantly increases the binary size by about 200 kB.
|
||||
2. By default, ESP-IDF uses a simple non-blocking implementation of the standard input stream (``stdin``). To get the usual behavior of ``std::cin``, the application has to initialize the UART driver and enable the blocking mode as shown in :example_file:`common_components/protocol_examples_common/stdin_out.c`.
|
||||
|
||||
|
||||
.. _cplusplus_limitations:
|
||||
|
||||
Limitations
|
||||
@@ -181,6 +190,7 @@ Limitations
|
||||
- Vtables are placed into Flash and are not accessible when the flash cache is disabled. Therefore, virtual function calls should be avoided in :ref:`iram-safe-interrupt-handlers`. Placement of Vtables cannot be adjusted using the linker script generator, yet.
|
||||
- C++ filesystem (``std::filesystem``) features are not supported.
|
||||
|
||||
|
||||
What to Avoid
|
||||
-------------
|
||||
|
||||
|
Reference in New Issue
Block a user