Difference between revisions of "C/C++"

From HCL
Jump to: navigation, search
Line 18: Line 18:
 
== Creating libraries with [[Autotools]] ==
 
== Creating libraries with [[Autotools]] ==
 
* Prepare two sets of headers:
 
* Prepare two sets of headers:
** includes <code>include_HEADERS = ...</code>
+
** includes (for the include directory): <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 (contains common headers and symbols), which is included in most of source files of the library
 
*** <code>library.h</code> is a precompiled header (contains common headers and symbols), which is included in most of source files of the library

Revision as of 19:24, 5 February 2010

Coding

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

Creating libraries with Autotools

  • Prepare two sets of headers:
    • includes (for the include directory): include_HEADERS = ...
    • sources (internal C data structures and C++ template classes): library_SOURCES = library.h ...
      • library.h is a precompiled header (contains common headers and symbols), which is included in most of source files of the library