Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
AutomatonToStringComposerCommon.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <ostream>
9#include <alib/vector>
10
11#include <core/stringApi.hpp>
12
13namespace automaton {
14
16 template < class Type >
17 static void composeList ( ext::ostream & output, const ext::vector < Type > & list );
18};
19
20template < class Type >
22 output << '[';
23 bool first = true;
24 for ( const Type & value : list ) {
25 if ( ! first )
26 output << ", ";
27 first = false;
28
29 core::stringApi < Type >::compose ( output, value );
30 }
31 output << ']';
32}
33
34} /* namespace automaton */
35
Definition: ostream.h:14
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: ToGrammar.h:31
Type
Definition: MeasurementTypes.hpp:20
Definition: AutomatonToStringComposerCommon.h:15
static void composeList(ext::ostream &output, const ext::vector< Type > &list)
Definition: AutomatonToStringComposerCommon.h:21
Definition: stringApi.hpp:26