From b23846962b71ea0791f64042253e0d370689a816 Mon Sep 17 00:00:00 2001 From: Nikita <69168929+nikitalita@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:37:45 +0000 Subject: [PATCH] Specify that try-catch blocks are forbidden in cpp_usage_guidelines.rst --- .../common_engine_methods_and_macros.rst | 2 ++ contributing/development/cpp_usage_guidelines.rst | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/contributing/development/core_and_modules/common_engine_methods_and_macros.rst b/contributing/development/core_and_modules/common_engine_methods_and_macros.rst index 7754a40d1..8a47f21c5 100644 --- a/contributing/development/core_and_modules/common_engine_methods_and_macros.rst +++ b/contributing/development/core_and_modules/common_engine_methods_and_macros.rst @@ -182,6 +182,8 @@ repetition: It's recommended to use ``GLOBAL_DEF``/``EDITOR_DEF`` only once per setting and use ``GLOBAL_GET``/``EDITOR_GET`` in all other places where it's referenced. +.. _doc_common_engine_methods_and_macros_error_macros: + Error macros ------------ diff --git a/contributing/development/cpp_usage_guidelines.rst b/contributing/development/cpp_usage_guidelines.rst index 0ba327848..9f0032a26 100644 --- a/contributing/development/cpp_usage_guidelines.rst +++ b/contributing/development/cpp_usage_guidelines.rst @@ -100,6 +100,15 @@ pull request. To follow the existing style, please use standard ``#ifdef``-based include guards instead of ``#pragma once`` in new files. +``try``-``catch`` blocks +~~~~~~~~~~~~~~~~~~~~~~~~ + +C++ style exception handling using ``try`` and ``catch`` blocks is forbidden. +This restriction is in place for several reasons, including performance, binary +size and code complexity. +Use :ref:`doc_common_engine_methods_and_macros_error_macros` instead. + + .. seealso:: See :ref:`doc_code_style_guidelines_header_includes` for guidelines on sorting