Library-related strategies

Library related strategies include:

Stream-Based Classes

MSL C++ stream-based classes initialize several instances of direct and indirect objects. When code size is critical, do not use stream-based classes, which include standard input (cin), standard output (cout), and standard error (cerr). There are also wide-character equivalents for the normal input and output routines. Use only standard C input and output functions unless stream-based classes are absolutely necessary.

In addition to the standard C++ stream classes, avoid using string streams for in-core formatting because they generate heavy overhead. If size is critical, use C’s sprintf or sscanf functions instead.

The EC++ proposal does not support templatized classes or functions. MSL adheres to the ISO proposed standards that are template-based.

Alternative Class Libraries

MSL C++ is based on the ISO proposed C++ standard, which is implemented using templates that have a large initial overhead for specialization.

To avoid this overhead, consider devising your own commonly-used vector, string, or utility classes. You can also use other class libraries, such as the NIH's (National Institute of Health) Class Library. If you do use an alternative library, beware of potential problems with virtual inheritance, RTTI, or other causes of larger code size as described above.