forked fromglynos/cpp-netlib
- Notifications
You must be signed in to change notification settings - Fork425
C++ Network Library Style Guidelines
Glyn Matthews edited this pageNov 28, 2013 ·4 revisions
I’m starting this in response to aquestion raised on the mailing list.
Now, style guidelines sound like a great idea, but in practice this is going to be impossible to enforce. For one thing, any guidelines are going to be pretty much arbitrary and not easy to defend if anyone breaks them, and the project admins will probably feel it’s not a valuable use of their time. But, consistency of style is going to be vital as this project grows.
So, beyondboost’s own requirements, it’s perhaps a good idea to define what’s acceptable and not acceptable within our own project.
We followGoogle’s style guidelines.
I can start with some observations I’ve made about the organisation of the directory and namespace structures:
- protocol specific stuff belongs in the namespace (e.g.HTTP)
network::httpand the directorynetwork/http/. - URI specific stuff belongs in the uri submodule
networknamespace and directorynetwork/uri/. - Implementation specific headers belong in
network::*::detailnetwork/*/detail. - Implementations are put in
.ippfiles that live alongside the.hppfiles. The.ippfile is included by a.cppfile inlibs/network/src/which is then compiled.