Program Listing for File streams.hpp

Return to documentation for file (/tmp/ws/src/ecl_core/ecl_concepts/include/ecl/concepts/streams.hpp)

/*****************************************************************************
** Ifdefs
*****************************************************************************/

#ifndef ECL_CONCEPTS_STREAMS_HPP_
#define ECL_CONCEPTS_STREAMS_HPP_

/*****************************************************************************
** Includes
*****************************************************************************/

#include "macros.hpp"

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace ecl {

/*****************************************************************************
** Concept [Stream]
*****************************************************************************/

template <typename Implementation>
class StreamConcept {
    public:

        ecl_compile_time_concept_test(StreamConcept)
        {
            stream << 'a';
            stream.flush();
        }

    private:
        // Putting instantiations here actually saves instantiation (which can cause a
        // problem if there is no default constructor).
        Implementation stream;
};

} // namespace ecl

#endif /* ECL_CONCEPTS_STREAMS_HPP_ */