Contract Programming

Discussion in 'C++' started by mathieu, Jul 24, 2009.

  1. mathieu

    mathieu Guest

    Hi there,

    I found some contradicting information on the web. So my question
    is: Will there be support for Design by Contract at language level in C
    ++0x ?

    Thanks,
     
    mathieu, Jul 24, 2009
    #1
    1. Advertising

  2. mathieu wrote:
    > I found some contradicting information on the web. So my question
    > is: Will there be support for Design by Contract at language level in C
    > ++0x ?


    Uh... Do you mean concepts? They have been deferred (IOW will not
    appear in the next Standard).

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jul 24, 2009
    #2
    1. Advertising

  3. mathieu

    mathieu Guest

    On Jul 24, 2:26 pm, Victor Bazarov <> wrote:
    > mathieu wrote:
    > >   I found some contradicting information on the web. So my question
    > > is: Will there be support for Design by Contract at language level in C
    > > ++0x ?

    >
    > Uh...  Do you mean concepts?  They have been deferred (IOW will not
    > appear in the next Standard).


    No, I meant DbC:

    http://en.wikipedia.org/wiki/Design_by_contract

    For instance in D, you have:

    http://www.digitalmars.com/d/2.0/dbc.html

    Some compiler allow Pre/Post condition as an extension (not sure how
    it works internally):

    http://msdn.microsoft.com/en-us/library/d3bbz7tz(VS.80).aspx

    <quote>
    [Post( MustCheck=SA_Yes )] double* CalcSquareRoot
    (
    [Pre( Null=SA_No )] double* source,
    unsigned int size
    );

    In the preceding example:
    [Post ( MustCheck=SA_Yes)] requires caller to check the return value
    of CalcSquareRoot
    [Pre ( Null=SA_No)] requires caller to pass non-null parameter
    "source" to CalcSquareRoot
    </quote>

    I am guessing this is a no, since I cannot see it anywhere on the
    wikipage for C++0x.

    Thanks anyway,
     
    mathieu, Jul 24, 2009
    #3
  4. mathieu wrote:
    > On Jul 24, 2:26 pm, Victor Bazarov <> wrote:
    >> mathieu wrote:
    >>> I found some contradicting information on the web. So my question
    >>> is: Will there be support for Design by Contract at language level in C
    >>> ++0x ?

    >> Uh... Do you mean concepts? They have been deferred (IOW will not
    >> appear in the next Standard).

    >
    > No, I meant DbC:
    >
    > http://en.wikipedia.org/wiki/Design_by_contract
    > [..]
    > I am guessing this is a no, since I cannot see it anywhere on the
    > wikipage for C++0x.


    Correct. It's a no. And I think you can check with the Committee
    website for the language development. There are also publications by
    the members of the Committee that might hint at where the language
    is/will be going.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jul 24, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael D. Crawford
    Replies:
    0
    Views:
    711
    Michael D. Crawford
    Feb 22, 2005
  2. CorporateRebel.com
    Replies:
    2
    Views:
    428
    Whitecrest
    May 2, 2004
  3. BCC
    Replies:
    6
    Views:
    432
    Geniousoverhere
    May 9, 2004
  4. expecthealth

    Programming/Modeling Contract

    expecthealth, Dec 16, 2004, in forum: Python
    Replies:
    1
    Views:
    272
    Steve Holden
    Dec 16, 2004
  5. Specialist Verilog Engineers Roles
    Replies:
    0
    Views:
    488
    Specialist Verilog Engineers Roles
    Jun 27, 2007
Loading...

Share This Page