.. _cpp_interface:

C++ Interface
=============

You can use the C++ interface of ATC by including the public header ``include/c++/atc.hpp``, which includes all public header files (located in ``include/c++/atc/``). Check out `this example <https://gitlab.kuleuven.be/numa/software/atc/-/tree/master/examples/example.cpp>`_ for a demonstration.

Because of the use of STL objects, you must ensure that there is ABI stability in between the set-up that you used to compile the ATC library and the user application, i.e. all STL objects must be represented in exactly the same way in-memory. You may (or may not) lose this compatibility by:

* Using different compilers.
* Using different versions of the same compiler.
* Compiling with certain different options. For example, `enabling -D_GLIBCXX_DEBUG in GCC changes the ABI of STL objects <https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode_using.html>`_.

If this becomes an issue, you can either recompile the ATC library using the same set-up, because the source code is publicly available (recommended), or use the less practical :ref:`c_interface`.

.. toctree::
   :maxdepth: 2
   :caption: Contents:
   
   c++/interface
   c++/options
   c++/results
