[aspectc-user] advice that(type) : ..() {..} gives compiler error

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Tue Jun 21 18:16:12 CEST 2005


Hello Hans,

Hans VB wrote:
> Hi again,
> 
>> It does work when i do
>> advice execution("% %::%(...)") && that("Worker") {}
>> (but that woulnd't be exactly the same functionality)
>>
> I gives the same error when i do :
> 
> advice call("% %::%(...)") && that("Worker") {}
> 
> which kinda makes sense because of the non-definition of 'this' in a 
> *call* I guess.
> But is this intended behaviour?
> 
> 
> Greets,
> Hans
> 
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user

I tried the following Code with ac++ 0.9.3 in the ACDT and it works
perfectly!

---
#include <iostream>
using namespace std;

class Worker {
public:
    void work() {
        cout << "working" << endl;
    }
};

class Manager {
Worker w;
public:
    void manage() {
        w.work();
    }
};

aspect Foo {
   advice that("Worker") : after() {
     cout << "that Worker" << endl;
   }
};

int main () {
   Manager m;
   m.manage ();
}
---

Do you use 0.9.2 or an even older version? There were some fixes related
to "context binding functions" such as "that()".

Cheers,

Olaf




More information about the aspectc-user mailing list