|
Boost : |
Subject: Re: [boost] [contract] concepts: pseudo-signatures vs. usage patterns
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2012-10-14 15:44:18
2012/10/14 Dave Abrahams <dave_at_[hidden]>
>
> on Sun Oct 14 2012, Andrzej Krzemienski <akrzemi1-AT-gmail.com> wrote:
>
>
> > Can you help me understand one thing about pseudo-signatures? If I have
> the
> > following concept:
> >
> > concept MyIter<typename It>
> > {
> > It& operator++(It&);
> > bool It::is_valid();
> > }
> >
> > Does this say preincrement returns exactly reference to It or only
> > something convertible to It?
>
> It says that
>
> * the preincrement of a /model/ of MyIter must return something
> convertible to It&
>
> * WHen a function constrained to using the MyIter concept preincrements
> an instance of MyIter, it sees exactly It& returned, regardless of
> what is actually returned by the model's preincrement operation.
>
>
Thanks for this explanation. Now I feel I finally understood the
pseudo-signatures.
Regards,
&rzej
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk