#include #include #include "JLang/JPointer.hh" #include "JLang/JReference.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test JLANG::JReference class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; int debug; try { JParser<> zap("Example program to test referencing of objects."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; cout << "JPointer p(new int());" << endl; JPointer p(new int()); cout << "JReference o(p);" << endl; JReference o(p); cout << "*p = 123;" << endl; *p = 123; cout << setw(3) << left << "*o" << " == " << setw(3) << left << "*p" << "?" << endl; cout << setw(3) << right << *o << " == " << setw(3) << right << *p << endl; }