C++: Difference between revisions

From bone.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 26: Line 26:


===Fixed length integers===
===Fixed length integers===
==Advanced Topics==
===Forcing a C++ header to use C calling convention===
===Careful of the library link order on Linux===
===Declaring functions for shared libraries on Windows===

Revision as of 00:17, 8 December 2009

Tips

Minimize includes in headers

to write (reasons: compilation speed, robustness, debugging, wrapping)

Minimize use of macros

inline functions, overloaded functions or templated functions

Prefer iostreams to printf and scanf

Don't ignore compiler warnings

Put comments in the appropriate place

Don't reinvent the wheel

boost

-string manipulation - platform-independent file path handling - fixed-length integers (e.g 64 bit) See next section.

numerical especially important: lapack

Fixed length integers

Advanced Topics

Forcing a C++ header to use C calling convention

Declaring functions for shared libraries on Windows