003-Folien: Standard Template Library und Templates
003-Folien: Standard Template Library und Templates
003-Folien: Standard Template Library und Templates
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
Implementierungen (2/3)<br />
template <br />
Automaton::Automaton(State const & startState) :<br />
pCurrentState(&startState), currentStateTicks(0),<br />
first(true) { }<br />
template <br />
void Automaton::add(Transition const & t) {<br />
}<br />
tt.push_back(new Transition(t));<br />
template <br />
Automaton::~Automaton() {<br />
}<br />
for (typename list::iterator it=tt.begin();<br />
it != tt.end(); ++it) delete (*it);<br />
tt.clear(); // eventually clear tt<br />
Hier benötigt der<br />
Compiler unsere<br />
Hilfe: er kann nicht<br />
selbst entscheiden<br />
ob er einen Typ<br />
oder eine Instanz<br />
anlegen soll.<br />
24.04.2013 MRT2 (c) 2013, UR Folie 29