[aspectc-user] Problem with using arg<i>()
Sander Kersten
spkersten at gmail.com
Sat Aug 23 15:25:55 CEST 2014
Hi,
I'm completely new to ac++, I'm trying to make a simple tracing aspect as
practice. I've created the following aspect:
#include <iostream>
aspect Tracing {
advice execution ("% ...::%(...)") : before () {
std::cout << "in " << JoinPoint::signature() << std::endl;
for (int i = 0; i < JoinPoint::ARGS; i++) {
std::cout << (i ? ", " : "") << *tjp->arg<i>();
}
std::cout << std::endl;
}
};
When I run ag++ test.cpp, I get this error message:
tracing.ah:8: error: no matching function for call to `arg'
tracing.ah:8: error: invalid operand to unary `*'
tracing.ah:8: error: invalid operand to binary `<<'
tracing.ah:8: error: undefined type
error: Execution failed: "ac++" --config "/tmp/agxx_pcfgdGZPhu" -p. -c
"test.cpp" -o "/tmp/test.cpp_agxx_v4z2Sl"
If I leave the <i> part out, then I get a dereferencing void pointer error.
Can someone help with fixing this?
Regards,
Sander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20140823/0fa4b920/attachment.html>
More information about the aspectc-user
mailing list