RAII em todo lugar, sem new ou delete crus, benchmarks validam cada mudança.
Constitution — C++ performance library
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the library. A spec may add rules; it never weakens these.
-
RAII everywhere. Every resource (memory, files, locks, handles) is owned by an object whose destructor releases it. Code that has to remember to release something on every return path fails the review.
-
No raw new or delete. Ownership is expressed with
std::unique_ptr,std::shared_ptronly when sharing is real, and containers. A nakednewordeleteoutside an allocator implementation fails the review and clang-tidy. -
Benchmarks gate every change. Hot paths have Google Benchmark cases run in CI on a dedicated machine. A change that slows a benchmark by more than 5% against main blocks the merge unless the plan accepts the trade-off.
-
Sanitizers stay green. The test suite runs under AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer in CI. Any report fails the build.
-
A stable, minimal public API. Public headers expose only what users need, follow semantic versioning and are checked for ABI changes on each release. Internal types stay out of public headers.
-
Modern CMake. The build uses targets with
target_*commands, exports a package config forfind_package, and builds with warnings as errors on GCC, Clang and MSVC. No globalinclude_directoriesor compiler flags. -
Measured, not guessed. An optimization comes with a benchmark or a profile (perf, VTune or Tracy) that shows the gain. Readability is not traded for speed that cannot be measured.