Skip to content

Commit 70c5f00

Browse files
authored
style: add a description of the c++ function's scope
1 parent d0eec17 commit 70c5f00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

STYLE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# C++ coding style
22

33
Yacl follows the [Envoy C++ style guidelines](https://github.com/envoyproxy/envoy/blob/main/STYLE.md), i.e. we also encourage appropriate exception uses.
4+
5+
## The scope of functions and classes
6+
7+
To limit the scope of a function or class to the current file, use an anonymous namespace. For functions or classes within a namespace that shares the same name as the repository (repo), ensure they are thoroughly covered by tests and can be used normally by other repos. Sub-namespaces under a repo-named namespace may be used for interactions between different internal packages, and there is no strict requirement for their stability. If external repos need to use them, they must verify their suitability and stability independently. For functional changes in non-anonymous namespaces, ensure that the changelog is updated accordingly.

0 commit comments

Comments
 (0)