From: "William E. Kempf" <[EMAIL PROTECTED]> > David Abrahams said: > > "William E. Kempf" <[EMAIL PROTECTED]> 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.
While it may well be a programmer error to misuse the template, I prefer solutions that allow the compiler to diagnose the problem insofar as practicable. > 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. Use a traits class. -- Rob Stewart [EMAIL PROTECTED] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer; _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost