Boost logo

Boost :

Subject: Re: [boost] [guidelines] why template errors suck
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2010-09-27 03:15:04


On Mon, Sep 27, 2010 at 12:54 PM, David Abrahams <dave_at_[hidden]> wrote:
> At Mon, 27 Sep 2010 11:40:31 +0800,
> Dean Michael Berris wrote:
>>
>> The way concepts are done now is to define the syntactic requirements
>> (not so much the semantics)
>
> I think I know what you mean, but I wouldn't say it that way.

I was looking for a better way to say it, but the way it is done now
with Boost.Concept_check is pretty much by trying out the interface of
the type being checked whether it models a given concept. I'm not sure
how to define a model using pure C++ code to say that a given
expression should have O(n) computational complexity with regards to
`n` being the size of the input -- of course, you can define this in
documentation, which I'm not sure really helps with better compiler
error messages. :D

> Notwithstanding the fact that the compiler can never verify semantic
> conformance to a concept, the semantics are a required part of any
> concept definition.  If your concept omits semantics, it's broken.
>

Definitely true in the strict sense that Concepts in the STL
documentation are defined. I was referring to the way it's done with
Boost.Concept_check and with regards to better compiler error
messages. :)

-- 
Dean Michael Berris
deanberris.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk