[aspectc-user] Aspect templating

Manuel Menezes de Sequeira Manuel.Sequeira at iscte.pt
Tue May 3 13:15:34 CEST 2005


Hi Olav,

> Template aspects are a nice idea. However, aspects are instantiated 
> implicitly by default and therefore the programmer doesn't have a 
> chance to pass the template parameter.

Right.  On the other hand, aspect templates could be defined in 
AspectC++ to have no implicit instantiation.  They would have to be 
instantiated explicitely.  For instance, something like:

    // file1
    // No effect unless instantiated explicitelly:
    template <class T>
    aspect MakeSingletonOf {
        ...
    };

    // file2

    class MyClass {
        ...

    };

    template aspect MakeSingletonOf<MyClass>; // using C++ explicit
    template instantiation syntax.

In a sense, this is achievable with abstract aspects.  However, it would 
be more powerful, since T might be used in a consistent way in several 
different contexts within the aspect template.

Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20050503/e29d4243/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3198 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20050503/e29d4243/attachment.bin>


More information about the aspectc-user mailing list