streams.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_CONCEPTS_STREAMS_HPP_
13 #define ECL_CONCEPTS_STREAMS_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 #include "macros.hpp"
20 
21 /*****************************************************************************
22 ** Namespaces
23 *****************************************************************************/
24 
25 namespace ecl {
26 
27 /*****************************************************************************
28 ** Concept [Stream]
29 *****************************************************************************/
30 
37 template <typename Implementation>
38 class StreamConcept {
39  public:
40 
49  ecl_compile_time_concept_test(StreamConcept)
50  {
51  stream << 'a';
52  stream.flush();
53  }
54 
55  private:
56  // Putting instantiations here actually saves instantiation (which can cause a
57  // problem if there is no default constructor).
58  Implementation stream;
59 };
60 
61 }; // namespace ecl
62 
63 #endif /* ECL_CONCEPTS_STREAMS_HPP_ */
ecl::StreamConcept::stream
Implementation stream
Definition: streams.hpp:72
ecl::StreamConcept::ecl_compile_time_concept_test
ecl_compile_time_concept_test(StreamConcept)
Implements a concept test for streams.
Definition: streams.hpp:63
macros.hpp
Mechanisms enabling compile time checking of metaprogramming concepts.
ecl
Embedded control libraries.


ecl_concepts
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:24