This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Sophisticated constraint checks
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: "Stephen M. Webb" <stephenw at xandros dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 03 Mar 2005 19:44:53 +0000
- Subject: Re: Sophisticated constraint checks
- References: <200503031441.51442.stephenw@xandros.com>
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