C++ Coding Guidelines

From LuxCoreRender Wiki
Revision as of 19:41, 29 April 2025 by Howetuft (talk | contribs) (Created page with "Here are some guidelines for C++ Coding. = Indentation = Indentation in LuxCore has historically used tabs rather than spaces. Thank you for your compliance. Please avoid trailing spaces. = Boost = Boost was used extensively in LuxCore, at a time when it was probably the only option for efficiently coding certain mechanisms (filepath, thread synchronization etc.). Since v2.10, however, this is no longer the case, as LuxCore has been ported to C++20, which offers a sta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Here are some guidelines for C++ Coding.

Indentation

Indentation in LuxCore has historically used tabs rather than spaces. Thank you for your compliance. Please avoid trailing spaces.

Boost

Boost was used extensively in LuxCore, at a time when it was probably the only option for efficiently coding certain mechanisms (filepath, thread synchronization etc.). Since v2.10, however, this is no longer the case, as LuxCore has been ported to C++20, which offers a standard library that can largely replace Boost, with a few exceptions. Please use C++20 standard library instead of Boost whenever possible.

Raw pointers

LuxCore development was started before the advent of modern C++ (C++11 and higher) and logically conceals numerous raw pointers. However, raw pointers are quite risky, particularly in terms of memory leaks, dangling pointers, pointer aliasing etc., and should be avoided now, to the benefit of smart pointers.

Modern C++

In general, we thank you for applying the best practices of modern C++ programming: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines