[aspectc-user] weaving in templates

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri May 26 17:45:46 CEST 2006


Hello Martin,

I'm sorry, but weaving *in* templates still does not work. The only 
template-related feature that should work, although experimental, is 
advice for calls to member functions of template instances, if the call 
itself is not located within the template. For example, if there is a 
call to Client<Something>::run() within your main() function, call 
advice should work.

Best regards,

Olaf


Martin Kuhlemann wrote:
> Hello AspectC++ -Team,
> 
> I failed, when I tried to weave into a template-class following the ac++ 
> -quick-reference. Reading that AspectC++ had problems in former releases 
> concerning that feature (mailing-list: 10.03.2006) and that in the 
> current release it is in experimental state, I'd like to know, what is 
> applicable at present (1.0pre3). Could you please send an example?
> To avoid talking about already resolved problems, I'd ask you to read 
> the following code-lines. The problem is, that the aspect is not 
> applied. Is there a bug in my code?
> 
> Thank you very much and best regards.
> Martin
> 
> ===================
>  #pragma once
>  #include <iostream>
>  using namespace std;
> template<class A>class Client{
> public:
>     void run(){cout<<"hello"<<endl; }};
> ===================
>  #pragma once
>  #include <iostream>
>  using namespace std;
> aspect deco{
> public:
>     pointcut decoration() = execution("% ...::%<...>::%(...)");
>     advice decoration(): before(){    cout<<"Aspect"<<endl;    }};
> ===================
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user




More information about the aspectc-user mailing list