#ifndef __Trace_ah__ #define __Trace_ah__ #include using namespace std; template struct ArgPrinter { template static inline void work (JP &tjp) { ArgPrinter::work (tjp); cout << "Arg " << I << ": " << *tjp.template arg () << endl; } }; template <> struct ArgPrinter<0> { template static inline void work (JP &tjp) {} }; aspect Trace { template void print_args (JP &tjp) { ArgPrinter::work (tjp); } advice call("% A::%(...)" || "% no_args()") : before() { tjp->arg(0); // TODO: a workaround, because on demand code generation // does not check the instantiated template cout << JoinPoint::filename () << ":" << JoinPoint::line () << endl; print_args (*tjp); } }; #endif // __Trace_ah__