diff --git a/doc/contributing/source/coding-style.rst b/doc/contributing/source/coding-style.rst index 4ef3ac654..33bd4c5ce 100644 --- a/doc/contributing/source/coding-style.rst +++ b/doc/contributing/source/coding-style.rst @@ -1081,6 +1081,23 @@ Miscellaneous items int* ptr = &x; int& ref = x; +- Use a trailing comma in braced-init-lists, so that each item is positioned in a new line. + + .. sourcecode:: cpp + + const std::vector myVector{ + "string-1", + "string-2", + "string-3", + }; + + const std::map myMap{ + {1, "string-1"}, + {2, "string-2"}, + {3, "string-3"}, + }; + + - Const reference syntax: .. sourcecode:: cpp