|
Boost : |
Subject: Re: [boost] [contract] Mixin Boost.Contract and Boost.STM
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2010-03-21 13:01:53
Hi Vicente,
>> You have no comented my suggestion to don't duplicate the signature. Instead of letting the C++ signature, generate it from the macro, so
>>
>> void push_back(const T& element)
>> CONTRACT_FUNCTION( (inherit)(pushable<T>) // No class type.
>> (public) (void) (push_back)( (const T&)(element) )
>>
>> will become
>>
>> // NO NEED OF THE C++ SIGNATURE
>> // void push_back(const T& element)
>> CONTRACT_FUNCTION( (inherit)(pushable<T>) // No class type.
>> (public) (void) (push_back)( (const T&)(element) )
>>
>
> Hi, please could you comment my suggestion?
This is possible (I will have to extend the signature-sequence just a
bit to include default argument values, exception specifications,
member list initializations, and absolutely anything else you can
program in a C++ function declaration -- but most of the declaration
tokens are already there).
There is a question of what syntax is more readable vs. which syntax
requires more programmers' coding work. I have asked this question to
all Boosters -- see separate email thread.
Thanks,
Lorenzo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk