1 CppUnit's coding guidelines for portability:
2 --------------------------------------------
4 - don't explicitly declare CppUnit namespace, instead use macro
5 CPPUNIT_NS_BEGIN and CPPUNIT_NS_END.
7 - don't explicitly use 'CppUnit' to refer to class in CppUnit namespace,
8 instead use macro CPPUNIT_NS which expands to either 'CppUnit' or
9 nothing depending on the configuration.
11 - don't use the 'using directive', always use full qualification. For STL,
14 - don't use C++ style cast directly, instead use CppUnit's cast macro
17 - don't use the mutable keyword, instead do a const cast.
19 - don't use the typename keyword in template declaration, instead use 'class'.
21 - don't make use of RTTI (typeid) or dynamic_cast mandatory.
23 - don't use STL container directly, instead use CppUnit's wrapper located
24 in include/cppunit/portability. This help support compilers that don't
25 support default template parameter and require an allocator to be
28 - don't use default template parameters. If needed, use STLPort wrapper
29 technic (see include/cppunit/portability/).
31 - don't use templatized member functions (template method declared inside a
32 class), instead declares them as simple template functions (even
33 mainstream compiler such as VC++ 6 as trouble with them).
35 - don't use default parameter value in template function. Not supported
36 by all compiler (on OS/390 for instance).
38 - don't use STL container at() method, instead use the array accessor [].
39 at() is not supported on some gcc versions.
41 - dereferencing containers must be done by (*ref_ptr).data instead of
44 In brief, it should be possible to compile CppUnit on a C++ compiler that do
45 not have the following features:
47 - mutable and typename keyword
49 - template default parameters
50 - templatized member functions (that is a template function declared within a
54 As such, usage of those features should always be optional.
56 Following those guidelines should allow to compile on most compilers, as long
57 as STL are available (in std namespace or not), with some form of strstream and
58 iostream, as well as exception support.
61 Baptiste Lepilleur <gaiacrtn@free.fr>