#ifndef __a_ah__ #define __a_ah__ #include struct GlobalMsg { bool instantiate; GlobalMsg (int id) { static int last_id = -1; if (last_id == -1) { printf ("GlobalIds: checks whether a JPID is globally unique\n"); printf ("===================================================\n"); printf ("IDs are fine if no other message follows.\n", id); } else if (last_id != id) printf ("IDs of two translation units differ!\n", id); last_id = id; } }; template struct Tester { static GlobalMsg msg; }; template GlobalMsg Tester::msg (ID); aspect IdChecker { advice execution ("void f()") : after () { Tester::msg.instantiate = true; } }; #endif // __a_ah__