diff --git a/CODE_STYLE.md b/CODE_STYLE.md index 0a1e7857268..41233f2792a 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -121,9 +121,21 @@ private: - other headers are sorted in reverse order of their layering, that is, lower layer headers last - within a layer, headers are sorted alphabetically - strive for implementing one class per file -- `STL` limited in public headers to: - - `type_traits` +- `STL` limited in **filament** public headers to: + - `array` + - `initializer_list` + - `iterator` - `limits` + - `optional` + - `type_traits` + - `utility` + - `variant` + +For **libfilament** the rule of thumb is that STL headers that don't generate code are allowed (e.g. `type_traits`), +conversely containers and algorithms are not allowed. There are exceptions such as `array`. See above for the full list. +- The following `STL` headers are banned entirely, from public and private headers as well as implementation files: + - `iostream` + *Sorting the headers is important to help catching missing `#include` directives.* diff --git a/filament/backend/include/backend/DriverEnums.h b/filament/backend/include/backend/DriverEnums.h index 358c5420260..48de51c63ff 100644 --- a/filament/backend/include/backend/DriverEnums.h +++ b/filament/backend/include/backend/DriverEnums.h @@ -33,9 +33,9 @@ #include -#include // FIXME: STL headers are not allowed in public headers -#include // FIXME: STL headers are not allowed in public headers -#include // FIXME: STL headers are not allowed in public headers +#include +#include +#include #include #include