This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sophisticated constraint checks


Stephen M. Webb wrote:
Hello all

I'm beavering away trying to implement the TR1 [5.1] random stuff and I need to add a number of constraint checks. I'm using concept requirements where possible and __enable_if<> where I need to constrain a templated type based on a type trait, but I need more.

First, some functions have strict constraints on input domain at runtime, which to me says throw an exception but TR1 seems to forbid this. Is using _GLIBCXX_DEBUG_ASSERT() to raise an assertion only in debug mode really the best that can be done?

I think thats what is done in other places. Without looking at the specific section, in general C++ assumes if you give invalid input to a function, invalid behaviour occurs, but it's nice to put a debugging check in.

Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]