[aspectc-user] non-inline introduction

Arnd-Hendrik Mathias arnd-hendrik.mathias at nefkom.net
Tue Mar 25 21:18:13 CET 2008


I just tried this, resulting in our friendly ag++ claiming:

warning: cannot introduce non-inline function or static attribute into 
"class Device". It has to contain link-once code.

which I don't understand.

Francisco Afonso wrote:
> And if you use named slices?
>
> //------------------------------
>
> slice class mySlice{
> public:
>    static unsigned int counter;
> };
>
> slice unsigned int mySlice::counter = 0;
>
>
> aspect Counter{
>    advice "Device": slice mySlice;
> };
> //--------------------------------------------------
>
> Regards,
>
> Francisco Afonso
>
>
> > Date: Tue, 25 Mar 2008 10:36:50 +0100
> > From: arnd-hendrik.mathias at nefkom.net
> > To: aspectc-user at aspectc.org
> > Subject: [aspectc-user] non-inline introduction
> >
> > Hi,
> > I'm tryin' to introduce a new static member to a class including the
> > corresponding non-inline introduction. The code I'm using looks like
> > this:
> >
> > /** \code */
> >
> > class Device
> > {
> > unsigned char devspeed;
> > unsigned char devclass;
> > unsigned char devsubclass;
> > unsigned char devprotocol;
> > };
> >
> > aspect Counter
> > {
> > advice "Device" : slice class
> > {
> > public : static unsigned int counter;
> > };
> > };
> >
> > slice unsigned int Device::counter = 0;
> >
> > /** \endcode */
> >
> > Which looks pretty much like the example given in section 5 of the
> > ac-language-reference page 27. Nevertheless ag++ reports an "error:
> > invalid introduction" to me.
> > I also tried to put the non-inline introduction into the aspect. Which
> > only makes things different but not better. Can anyone give me some
> > good advice (or at least some better slice than mine ;-)
> > Best regards
> >
> > Arnd-Hendrik
> >
> >
> > _______________________________________________
> > aspectc-user mailing list
> > aspectc-user at aspectc.org
> > http://www.aspectc.org/mailman/listinfo/aspectc-user
>
> ------------------------------------------------------------------------
> How well do you know your celebrity gossip? Talk celebrity smackdowns 
> here. <http://originals.msn.com/thebigdebate?ocid=T002MSN03N0707A>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20080325/718e5523/attachment.html>


More information about the aspectc-user mailing list