Commit 537286a2 by Phil Edwards

howto.html: HTML fixup.

2001-03-24  Phil Edwards  <pme@sources.redhat.com>

	* docs/html/19_diagnostics/howto.html:  HTML fixup.  Describe
	concept-checking code and current status of same.
	* docs/html/ext/howto.html:  Ditto.
	* docs/html/faq/index.html:  Ditto.
	* docs/html/faq/index.txt:  Regenerated.

From-SVN: r40821
parent 2c085782
2001-03-24 Phil Edwards <pme@sources.redhat.com> 2001-03-24 Phil Edwards <pme@sources.redhat.com>
* docs/html/19_diagnostics/howto.html: HTML fixup. Describe
concept-checking code and current status of same.
* docs/html/ext/howto.html: Ditto.
* docs/html/faq/index.html: Ditto.
* docs/html/faq/index.txt: Regenerated.
2001-03-24 Phil Edwards <pme@sources.redhat.com>
* include/bits/std_bitset.h: Include ostream and istream headers * include/bits/std_bitset.h: Include ostream and istream headers
instead of iostream. instead of iostream.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers"> <META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 19</TITLE> <TITLE>libstdc++-v3 HOWTO: Chapter 19</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css"> <LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:47 jsm28 Exp $ --> <!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
</HEAD> </HEAD>
<BODY> <BODY>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
struct My_Exception : public runtime_error struct My_Exception : public runtime_error
{ {
public: public:
My_Exception (const string& whatarg) My_Exception (const string&amp; whatarg)
: runtime_error(whatarg), e(errno), id(GetDataBaseID()) { } : runtime_error(whatarg), e(errno), id(GetDataBaseID()) { }
int errno_at_time_of_throw() const { return e; } int errno_at_time_of_throw() const { return e; }
DBID id_of_thing_that_threw() const { return id; } DBID id_of_thing_that_threw() const { return id; }
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
<HR> <HR>
<H2><A NAME="3">Concept checkers</A></H2> <H2><A NAME="3">Concept checkers</A></H2>
<P>As part of their 3.3 release, SGI added some nifty macros which <P>First the good news, then the bad news.</P>
<P><STRONG>Good news:</STRONG> As part of their 3.3 release, SGI
added some nifty macros which
perform assertions on type properties. For example, the Standard perform assertions on type properties. For example, the Standard
requires that types passed as template parameters to <TT>vector</TT> requires that types passed as template parameters to <TT>vector</TT>
be &quot;Assignable&quot; (which means what you think it means). be &quot;Assignable&quot; (which means what you think it means).
...@@ -83,15 +85,45 @@ ...@@ -83,15 +85,45 @@
<TT>vector&lt;MyType&gt;</TT>, compile-time checking can be done on <TT>vector&lt;MyType&gt;</TT>, compile-time checking can be done on
whether MyType meets the requirements for vectors. whether MyType meets the requirements for vectors.
</P> </P>
<P>This is an extension to the library. This documentation needs updating.</P> <P>Most (all?) of the containers and sequences are capable of performing
concept checking during compilation, not just vector.
</P>
<P>If a concept is violated (thus causing a compilation failure), the
error messages printed by the compiler will be of the form
<PRE>
_STL_ERROR::__<EM>foo</EM>_violation
</PRE> where <EM>foo</EM> is a description of the precise violation.
For example, if a type is required to support the preincrement
operator but doesn't, then you will see
_STL_ERROR::__postincrement_operator_requirement_violation, which
should give you a hint as to the nature of the problem.
</P>
<P>Other names might be seen for more specific errors, for example,
_ERROR_IN_STL_CONTAINER::__begin_iterator_accessor_requirement_violation.
</P>
<P>You will probably also see other errors as the malformed code is
actually used. The concept checking error messages should be printed
before the others, so start at the top and work your way down.
</P>
<P><STRONG>Bad news:</STRONG> The current checking code is somewhat
messy. It results in no runtime overhead, but there is a space
penalty (sometimes a very large one) in the generated code. And the
code itself has bugs.
</P>
<P>Concept checking can be disabled when you build your code. Just
define (via -D or #define) the macro
<TT>_STL_NO_CONCEPT_CHECKS</TT> (yes, with the leading underscore).
In fact, this may already be defined in the library by default,
depending on what decision we come to.
</P>
<P><STRONG>More good news:</STRONG> Replacement code has already been
written by the same author of the original code. It's available at
Boost and we hope to integrate it into the library.
<P>Return <A HREF="#top">to top of page</A> or <P>Return <A HREF="#top">to top of page</A> or
<A HREF="../faq/index.html">to the FAQ</A>. <A HREF="../faq/index.html">to the FAQ</A>.
</P> </P>
<!-- ####################################################### --> <!-- ####################################################### -->
<HR> <HR>
...@@ -99,7 +131,7 @@ ...@@ -99,7 +131,7 @@
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or <A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>. <A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:47 jsm28 Exp $ <BR> $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $
</EM></P> </EM></P>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers"> <META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Extensions</TITLE> <TITLE>libstdc++-v3 HOWTO: Extensions</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css"> <LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.4 2000/12/03 23:47:49 jsm28 Exp $ --> <!-- $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
</HEAD> </HEAD>
<BODY> <BODY>
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<LI><A HREF="#1">Ropes and trees and hashes, oh my!</A> <LI><A HREF="#1">Ropes and trees and hashes, oh my!</A>
<LI><A HREF="#2">Added members</A> <LI><A HREF="#2">Added members</A>
<LI><A HREF="#3">Allocators</A> <LI><A HREF="#3">Allocators</A>
<LI><A HREF="#4">Compile-time checks</A>
</UL> </UL>
<HR> <HR>
...@@ -56,7 +57,8 @@ ...@@ -56,7 +57,8 @@
&lt;tree&gt; &lt;tree&gt;
</PRE> are all here; <TT>&lt;bvector&gt;</TT> exposes the old bit_vector </PRE> are all here; <TT>&lt;bvector&gt;</TT> exposes the old bit_vector
class that was used before specialization of vector&lt;bool&gt; was class that was used before specialization of vector&lt;bool&gt; was
available. <TT>&lt;hash_map&gt;</TT> and <TT>&lt;hash_set&gt;</TT> available (it's actually a typedef for the specialization now).
<TT>&lt;hash_map&gt;</TT> and <TT>&lt;hash_set&gt;</TT>
are discussed further below. <TT>&lt;rope&gt;</TT> is the SGI are discussed further below. <TT>&lt;rope&gt;</TT> is the SGI
specialization for large strings (&quot;rope,&quot; &quot;large specialization for large strings (&quot;rope,&quot; &quot;large
strings,&quot; get it? love those SGI folks). strings,&quot; get it? love those SGI folks).
...@@ -137,6 +139,16 @@ ...@@ -137,6 +139,16 @@
<A HREF="../faq/index.html">to the FAQ</A>. <A HREF="../faq/index.html">to the FAQ</A>.
</P> </P>
<HR>
<H2><A NAME="4">Compile-time checks</A></H2>
<P>Currently libstdc++-v3 uses the concept checkers from SGI's STL
3.3 to perform <A HREF="../19_diagnostics/howto.html#3">optional
compile-time checking</A> of template instantiations of the standard
containers. They are described in the linked-to page.
</P>
<P>Return <A HREF="#top">to top of page</A> or
<A HREF="../faq/index.html">to the FAQ</A>.
</P>
...@@ -148,7 +160,7 @@ ...@@ -148,7 +160,7 @@
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or <A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>. <A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.4 2000/12/03 23:47:49 jsm28 Exp $ <BR> $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $
</EM></P> </EM></P>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
** Locations of "the most recent snapshot is the Nth" text are ** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, 1_4, 4_1, 5_6. ** answers 1_1, 1_4, 4_1, 5_6.
--> -->
<!-- $Id: index.html,v 1.3 2001/02/15 22:21:12 pme Exp $ --> <!-- $Id: index.html,v 1.4 2001/03/01 22:32:23 pme Exp $ -->
</HEAD> </HEAD>
<BODY> <BODY>
...@@ -69,6 +69,7 @@ http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P> ...@@ -69,6 +69,7 @@ http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P>
<LI><A HREF="#4_4_interface">The g++-3 headers are <LI><A HREF="#4_4_interface">The g++-3 headers are
<STRONG>not ours</STRONG></A> <STRONG>not ours</STRONG></A>
<LI><A HREF="#4_4_glibc">compilation errors from streambuf.h</A> <LI><A HREF="#4_4_glibc">compilation errors from streambuf.h</A>
<LI><A HREF="#4_4_checks">_STL_ERROR::__something_huge_...</A>
</UL> </UL>
<LI><A HREF="#4_5">Aw, that's easy to fix!</A> <LI><A HREF="#4_5">Aw, that's easy to fix!</A>
</OL> </OL>
...@@ -555,6 +556,21 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff ...@@ -555,6 +556,21 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
maintained. maintained.
</P> </P>
</A> </A>
<A NAME="4_4_checks">
<P>If you see compilation errors containing messages which begin
with _STL_ERROR:: followed by a very verbose name, then most
likely you have violated one of the requirements for types used
during instantiation of template containers. For example,
_STL_ERROR::__equality_comparable_requirement_violation appears
if your types must be comparable with == and you have not
provided this capability (a typo, or wrong visibility, or you
just plain forgot, etc).
</P>
<P>More information, including how to optionally disable the checks,
is available <A HREF="../19_diagnostics/howto.html#3">here</A>.
The code itself might be disabled or replaced already.
</P>
</A>
<HR> <HR>
<H2><A NAME="4_5">4.5 Aw, that's easy to fix!</A></H2> <H2><A NAME="4_5">4.5 Aw, that's easy to fix!</A></H2>
...@@ -706,7 +722,7 @@ HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>. ...@@ -706,7 +722,7 @@ HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or <A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>. <A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: index.html,v 1.3 2001/02/15 22:21:12 pme Exp $ <BR> $Id: index.html,v 1.4 2001/03/01 22:32:23 pme Exp $
</EM></P> </EM></P>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment