On 2/16/06, David Abrahams <dave@boost-consulting.com> wrote:
Which is why we assume pointers may be NULL. Not so with references. Everything you've just said misses the point by such a wide margin that I don't know where to begin, and I don't have time to finish right now, so I'll just say this:
When a precondition is violated, the programmer that violates it "is the problem." I advocate a system that requires fewer preconditions, and thus offers fewer opportunities for anyone to "be the problem." It looks to me that you are talking about different things. I think Ion agrees about invariants but advocating an interface that can be used without exceptions, to make the library accessible to the platforms with no exception available. And without exceptions, you can't ensure that no object with invalid state is constructed. So there is two choices - or to provide an exception-only interface and strong invariants, or to allow the library to be used in a restricting embedded environment.
Please correct me if I'm wrong. -- Best regards, Zigmar