Difference between revisions of "C/C++"
From HCL
Line 20: | Line 20: | ||
** includes <code>include_HEADERS = ...</code> | ** includes <code>include_HEADERS = ...</code> | ||
** sources (internal C data structures and C++ template classes) <code>library_SOURCES = library.h ...</code> | ** sources (internal C data structures and C++ template classes) <code>library_SOURCES = library.h ...</code> | ||
− | *** <code>library.h</code> is a precompiled header ( | + | *** <code>library.h</code> is a precompiled header (contains common headers), which is included in most of source files of the library |
Revision as of 18:54, 5 February 2010
Coding
- Coding header files
- One-true-brace ident style
- Learn from examples and use coding approaches from third-party software
Commenting
- Place Doxygen comments in header files (before declarations of namespaces/classes/structs/typedefs/macros) and main source files (for documenting tools and tests)
- Use double forward slash for short comments in the code
C++
General
- Don't use non-standard functions, like itoa
- Dynamic loading of shared libraries
Creating libraries with Autotools
- Prepare two sets of headers:
- includes
include_HEADERS = ...
- sources (internal C data structures and C++ template classes)
library_SOURCES = library.h ...
-
library.h
is a precompiled header (contains common headers), which is included in most of source files of the library
-
- includes