Generating Software from Specifications WS 2013/14 - File trywrapper.cc
#include <iostream> #include "example.h" int main () { Object *io = new intWrapper (42); int i = io->getintValue (); Object *fo = new PairPtrWrapper (new Pair (4, 2)); PairPtr f = fo->getPairPtrValue (); std::cout << i << ' ' << f->getleft() <<"\n"; try { f = io->getPairPtrValue (); } catch (Object::WrapperExcept) { std::cout << "non PairPtr\n";} }
Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 15.10.2013