OKlibrary  0.2.1.6
InputOutput.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 23.12.2005 (Swansea)
00002 /* Copyright 2005 - 2007 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00013 #ifndef INPUTOUTPUT_88uUHhbg
00014 #define INPUTOUTPUT_88uUHhbg
00015 
00016 #include <ostream>
00017 //#include <istream>
00018 
00019 #include <OKlib/Concepts/LibraryBasics.hpp>
00020 
00021 namespace OKlib {
00022   namespace Concepts {
00023 
00024     struct OutputStreamable_tag : ConceptsBase_tag {};
00025 
00026     template <class X>
00027     struct OutputStreamable {
00028       void constraints() {
00029         static_cast<std::ostream&>(out << x_c);
00030       }
00031       std::ostream out;
00032       const X x_c;
00033     };
00034 
00035     class OutputStreamable_Archetype {
00036       typedef OutputStreamable_tag concept_tag;
00037       OutputStreamable_Archetype();
00038       ~OutputStreamable_Archetype();
00039       OutputStreamable_Archetype(const OutputStreamable_Archetype&);
00040       OutputStreamable_Archetype& operator =(const OutputStreamable_Archetype&);
00041       friend std::ostream& operator <<(std::ostream& out, const OutputStreamable_Archetype&) { return out; }
00042     };
00043 
00044   }
00045 
00046 }
00047 
00048 #endif