Topic: Concept Checking with intefaces [was Interfaces proposal (version 4.0)]


Author: cdiggins@videotron.ca ("christopher diggins")
Date: Thu, 29 Apr 2004 22:08:23 +0000 (UTC)
Raw View
"Faisal Vali" <faisalv@yahoo.com> wrote in message
news:f1c0a779.0404290832.5761b857@posting.google.com...
> christopher diggins wrote:
> > This is the most recent version of the interfaces proposal, taken from
> > http://www.heron-language.com/cpp-iop.html .
>
>
> Could you please compare and contrast your 'interface' approach to the
> 'concepts' approach as delineated by Stroustrup & Dos Reis in the
> following papers:
> 1) http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf
> 2) http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1522.pdf
> 3) http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1536.pdf
>
> I have not studied the papers and proposal in detail but at first
> glance it seems that there is some overlap between the concept
> approach and the interface approach (although i'm not sure whether the
> issues raised in your later sections on assignment etc. are fully
> addressed in the concept papers - though a more detailed study of the
> papers might prove that they are).
>
> The following:.
> concept IFuBar {
>   contraints( IFuBar ifb )
>   {
>     ifb.FuBar();
>   }
> };
>
> void fun( IFuBar ifb );
>
> regards,
> Faisal Vali

Interfaces could be used easily to provide template parameter requirements
checking, in a manner that is congruent to the "function-matching approach"
described in the first paper:
http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf . This paper
describes advantages and disadvantages of this approach with regards to
other methods of template parameter requirements checking (i.e. cocnept
checking / constraints classes etc.)

Concepts as outlined in the papers (as far as I understand them) are not
intended be used as variables, only as descriptions of template parameters.

--
Christopher Diggins
http://www.cdiggins.com
http://www.heron-language.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]