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

Dima S spiridenok at tut.by
Mon Feb 18 10:53:40 CET 2008


Excluding the aspect from the pointcut solves the problem. Thanks!

Fri, 15 Feb 2008 16:55:12 +0100, Olaf Spinczyk <os at aspectc.org> писал(а):

> 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://www.pizza.by
(017) 266-35-07, (029) 690-93-93, 555-93-93







More information about the aspectc-user mailing list