Using uSTL in eCos applications

To build an eCos library with uSTL support, you can start from the default template and then add the uSTL package CYGPKG_USTL. If you need file streams support or would like to build all uSTL tests, then you must also add the File I/O package CYGPKG_IO_FILEIO.

To use uSTL in your eCos application, simply include the file <ustl.h>. All uSTL classes are in the ustl namespace.

#include <ustl.h>
using namespace ustl;

int main (int argc, char* argv[])
{
    cout << "Hello world!\n";
    cout.flush();
    return EXIT_SUCCESS;
}

Note: If you use cout for printing to the console, then data will be flushed only if you finish the output with endl or '\n' and then call cout.flush() as in the example above.

The uSTL library is subject of copyright under MIT license. For the license text see LICENSE file.