Many of the ecl classes are streamable, in order to provide quick visual debugging of its contents. Typically in c++ the default streaming object is the ostream object, however the io module here extends streaming functionalities to almost every device. The important caveat though, is they do not use the c++ iostream overheads (these are very costly).

In order to accomodate both (and also perhaps third party streams), the streams concept has been defined so streaming with a generalised template function is convenient.


Include the following at the top of any translation unit for which you are running compile time checks on your blueprint classes.

#include <ecl/concepts.hpp>

using ecl::StreamsConcept;

Since it only uses macros and templatised objects, no linking is required for just this feature.

Concept Definition

A streaming class just has to satisfy the following conditions:

Note that the object instance cout automatically satisfies these.


A simple example of a streaming function definition and the concept check usage is outlined below.

#include <ecl/concepts/streams.hpp>

using ecl::Stream;

class MyMatrix {
    template <typename OutputStream>
    friend OutputStream& operator << (OutputStream &ostream, MyMatrix &matrix);

template <typename OutputStream>
OutputStream& operator << (OutputStream &ostream, MyMatrix &matrix) {

    ostream << "Hello Dudes, this is a matrix\n";
    return ostream;

Author(s): Daniel Stonier (
autogenerated on Thu Jan 2 2014 11:12:03