[aspectc-user] Advice for constructors/destructors with any name

Olaf Spinczyk os at aspectc.org
Fri Feb 15 16:55:12 CET 2008


Hi,

there could of course be a code generation problem involved, but the 
first think that I would try is to exclude the aspect from the pointcut, 
e.g. construction("%" && !"MyAspects").

- Olaf

Dima S wrote:
> Hello,
>  
> I'm pretty new to AspectC++. I want to define an aspect that can be 
> used for any constructor/destructor in my code base. With "any" i mean 
> that class name can begin with any letter and is not limited to a 
> predefined letter combination.
>  
> So i try something like that, but the resulting executable crashes:
> advice construction ("%") : before () { printf( "constructor\n" ); }
>  
> Doing something like following works fine (it's also in exmaples), but 
> limits me to specific letter combinations (in this case starting with 
> "C"):
> advice construction ("C%") : before () { printf( "constructor\n" ); }
>  
> How can i define a constructor/destructor that can be used with any 
> class name?
>
> Thanks in advance! DimaS.
>                 
> ----------
> Все блоги - тут: http://blogs.tut.by
>
>
>
> _______________________________________________
> 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