|
Boost : |
From: William E. Kempf (wekempf_at_[hidden])
Date: 2002-12-17 09:53:33
David Abrahams said:
> "William E. Kempf" <wekempf_at_[hidden]> writes:
>
>> Augustus Saunders said:
>
>> I wouldn't be overly concerned. I'd find this to be a programmer
>> error (passing a type to a template that doesn't meet the template's
>> requirements). Concept checking libraries can even be employed to
>> insure such mistakes don't happen (assuming the concepts are well
>> defined enough for such checks to be written), though this would be a
>> QoI issue in the implementation of the template.
>
> Those concept checks can only look at syntactic and type constraints,
> not semantic (behavioral) ones like the ones they're worried about.
That's why I said "assuming the concepts are well defined enough for such
checks to be written". What I'm thinking is that a type with deep
comparison semantics might be required (by the concept definition) to
include a typedef or some other public interface that could be used to
distinguish it.
However, thinking this through more carefully, such a concept definition
would exclude pointers needlessly, so you are right, there's probably not
a way to do this.
William E. Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk