Commit 9b8fd32c by Phil Edwards

acinclude.m4: Cosmetic changes only.

2001-01-23  Phil Edwards  <pme@sources.redhat.com>

	* acinclude.m4:  Cosmetic changes only.
	* aclocal.m4:  Regenerated.
	* configure:  Regenerated.
	* configure.target:  Update documented list of changed variables.
	* docs/html/install.html:  Fix typo.
	* docs/html/20_util/howto.html:  More notes on auto_ptr.
	* docs/html/27_io/howto.html:  More notes on streabufs.
	* docs/html/faq/index.html:  Add rel_ops problem and mention the
	  DEC as(1) .subsection difficulty.
	* docs/html/faq/index.txt:  Regenerated.

From-SVN: r39200
parent 44f715c8
2001-01-23 Phil Edwards <pme@sources.redhat.com>
* acinclude.m4: Cosmetic changes only.
* aclocal.m4: Regenerated.
* configure: Regenerated.
* configure.target: Update documented list of changed variables.
* docs/html/install.html: Fix typo.
* docs/html/20_util/howto.html: More notes on auto_ptr.
* docs/html/27_io/howto.html: More notes on streabufs.
* docs/html/faq/index.html: Add rel_ops problem and mention the
DEC as(1) .subsection difficulty.
* docs/html/faq/index.txt: Regenerated.
2001-01-23 Mark Mitchell <mark@codesourcery.com>
* ainclude.m4 (GLIBCPP_CHEC_MATH_DECLS_AND_LINKAGE_1): New macro.
(GLIBCPP_CHECK_MATH_SUPPORT): Use it.
(GLIBCPP_CHECK_TYPE_SUPPORT): Don't autoconf ctype information if
its already provided in config.target.
* aclocal.m4: Regenerated.
* configure: Likewise.
* configure.target: Set ctype_include_dir for lots of systems.
* libsupc++/Makefile.am: Explicitly include --tag disable-shared.
* libsupc++/Makefile.in: Regenerated.
2001-01-23 Gabriel Dos Reis <gdr@codesourcery.com>
* testsuite/lib/libstdc++.exp: Improve. Add support for @xxx#
......
......@@ -356,7 +356,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
dnl
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
dnl of functions at once. It's an all-or-nothing check -- either
dnl HAVE_XYZ is defined for each of the functions, or for none of them
dnl HAVE_XYZ is defined for each of the functions, or for none of them.
dnl Doing it this way saves significant configure time.
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_MSG_CHECKING([for $1 functions])
......
......@@ -368,7 +368,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
dnl
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
dnl of functions at once. It's an all-or-nothing check -- either
dnl HAVE_XYZ is defined for each of the functions, or for none of them
dnl HAVE_XYZ is defined for each of the functions, or for none of them.
dnl Doing it this way saves significant configure time.
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_MSG_CHECKING([for $1 functions])
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,6 +20,7 @@
# glibcpp_cxxflags Special CXXFLAGS to use when building
# cpu_include_dir CPU-specific include directory, relative to srcdir
# os_include_dir OS-specific include directory, relative to srcdir
# ctype_include_dir Platform-specific (usually OS) ctype include dir
# The first two are set in configure.host and modified here.
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 20</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.4 2000/12/03 23:47:47 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
</HEAD>
<BODY>
......@@ -24,7 +24,7 @@
<H1>Contents</H1>
<UL>
<LI><A HREF="#1"><TT>auto_ptr</TT> is not omnipotent</A>
<LI><A HREF="#2">Automatically-generated operators</A>
<LI><A HREF="#2"><TT>auto_ptr</TT> inside container classes</A>
<LI><A HREF="#3">Functors</A>
<LI><A HREF="#4">Pairs</A>
</UL>
......@@ -82,32 +82,61 @@
to one or many things. If it points to many things, you are about
to die. AP is trivial to write, however, so you could write your
own <TT>auto_array_ptr</TT> for that situation (in fact, this has
been done many times; check the newsgroups, Usenet, Boost, etc).
been done many times; check the mailing lists, Usenet, Boost, etc).
</P>
<P>Return <A HREF="#top">to top of page</A> or
<A HREF="../faq/index.html">to the FAQ</A>.
</P>
<HR>
<H2><A NAME="2">Automatically-generated operators</A></H2>
<P>Many programs (for that matter, many of the Standard algorithms
and containers) require that you write comparison operators for
your classes, like <TT>operator&gt;=</TT>. As any mathmatician
will tell you, once you have defined equality and ordering, all
of the other comparisons are easily defined in terms of those two.
</P>
<P>The Committee agrees. So, once you have written
<TT>operator==</TT> and <TT>operator&lt;</TT> for your class
(whether they are global or member functions is up to you), you
can have the compiler do the grunt-work of generating the rest:
<H2><A NAME="2"><TT>auto_ptr</TT> inside container classes</A></H2>
<P>All of the <A HREF="../23_containers/howto.html">containers</A>
described in the standard library require their contained types
to have, among other things, a copy contructor like this:
<PRE>
#include &lt;header_with_my_op==_and_op&lt;_defined&gt;
#include &lt;utility&gt;
using std::rel_ops; // note the nested namespace!
struct My_Type
{
My_Type (My_Type const&amp;);
};
</PRE>
Note the const keyword; the object being copied shouldn't change.
The template class <TT>auto_ptr</TT> (called AP here) does not
meet this requirement. Creating a new AP by copying an existing
one transfers ownership of the pointed-to object, which means that
the AP being copied must change, which in turn means that the
copy ctors of AP do not take const objects.
</P>
<P>The resulting rule is simple: <EM>Never ever use a container of
auto_ptr objects.</EM> The standard says that undefined behavior
is the result, but it is guaranteed to be messy.
</P>
<P>To prevent you from doing this to yourself, the
<A HREF="../19_diagnostics/howto.html#3">concept checks</A> built
in to this implementation will issue an error if you try to
compile code like this:
<PRE>
#include &lt;vector&gt;
#include &lt;memory&gt;
...
if ((obj1 != obj2) || (obj3 >= obj4)) foo();
void f()
{
std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
}
</PRE>
Should you try this, you will see an error along the lines of the
following (look through the ugly line-wrapping):
<PRE>
/installdir/include/g++-v3/bits/concept_checks.h: In
static member function `static _Type
<B>_STL_ERROR::__const_parameter_required_for_copy_constructor</B>(_Type, const
_Type&amp;) [with _Type = std::auto_ptr&lt;int&gt;]':
/installdir/include/g++-v3/bits/concept_checks.h:383: passing
`const std::auto_ptr&lt;int&gt;' as `this' argument of
`std::auto_ptr&lt;_Tp&gt;::operator std::auto_ptr_ref&lt;_Tp1&gt;()
[with _Tp1 = int, _Tp = int]' discards qualifiers
</PRE>
See the highlighted error? It starts with a message in all caps
to get your attention.
</P>
<P>Return <A HREF="#top">to top of page</A> or
<A HREF="../faq/index.html">to the FAQ</A>.
......@@ -185,7 +214,7 @@
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.4 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>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 27</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:49 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
</HEAD>
<BODY>
......@@ -28,6 +28,7 @@
<LI><A HREF="#3">Binary I/O</A>
<LI><A HREF="#4">Iostreams class hierarchy diagram</A>
<LI><A HREF="#5">What is this &lt;sstream&gt;/stringstreams thing?</A>
<LI><A HREF="#6">Deriving a stream buffer</A>
</UL>
<HR>
......@@ -327,6 +328,61 @@
support them, and 2) if you use them, people will laugh at you.
</P>
<HR>
<H2><A NAME="6">Deriving a stream buffer</A></H2>
<P>Creating your own stream buffers for I/O can be remarkably easy.
If you are interested in doing so, we highly recommend two very
excellent books: <EM>Standard C++ IOStreams and Locales</EM> by
Langer and Kreft, ISBN 0-201-18395-1, and
<A HREF="http://www.josuttis.com/libbook/">The C++ Standard Library</A>
by Nicolai Josuttis, ISBN 0-201-37926-0. Both are published by
Addison-Wesley, who isn't paying us a cent for saying that, honest.
</P>
<P>Here is a simple example, io/outbuf1, from the Josuttis text. It
transforms everything sent through it to uppercase. This version
assumes many things about the nature of the character type being
used (for more information, read the books or the newsgroups):
<PRE>
#include &lt;iostream&gt;
#include &lt;streambuf&gt;
#include &lt;locale&gt;
#include &lt;cstdio&gt;
class outbuf : public std::streambuf
{
protected:
/* central output function
* - print characters in uppercase mode
*/
virtual int_type overflow (int_type c) {
if (c != EOF) {
// convert lowercase to uppercase
c = std::toupper(static_cast&lt;char&gt;(c),getloc());
// and write the character to the standard output
if (putchar(c) == EOF) {
return EOF;
}
}
return c;
}
};
int main()
{
// create special output buffer
outbuf ob;
// initialize output stream with that output buffer
std::ostream out(&ob);
out &lt;&lt; "31 hexadecimal: "
&lt;&lt; std::hex &lt;&lt; 31 &lt;&lt; std::endl;
return 0;
}
</PRE>
Try it yourself!
</P>
<!-- ####################################################### -->
......@@ -335,7 +391,7 @@
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.5 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>
......
......@@ -9,7 +9,7 @@
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, 1_4, 4_1, 5_6.
-->
<!-- $Id: index.html,v 1.10 2000/12/03 23:47:49 jsm28 Exp $ -->
<!-- $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
</HEAD>
<BODY>
......@@ -53,6 +53,7 @@ http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P>
<LI><A HREF="#3_1">Can libstdc++-v3 be used with &lt;my
favorite compiler&gt;?</A>
<LI><A HREF="#3_2">Building under Cygwin hangs/explodes!?</A>
<LI><A HREF="#3_3">Building under DEC OSF kills the assembler</A>
</OL>
<LI><A HREF="#4_0">Known Bugs and Non-Bugs</A>
......@@ -370,6 +371,22 @@ HREF="http://sources.redhat.com/automake/">automake</A>.
</P>
<HR>
<H2><A NAME="3_3">3.3 Building DEC OSF kills the assembler</A></H2>
<P>The <TT>atomicity.h</TT> header for the Alpha processor
currently uses pseudo-operators which the DEC assembler
doesn't understand (in particular, .subsection and .previous).
The simple solution is to install GNU <TT>as</TT> and arrange
for the GCC build to use it (or merge the sources and build
it during the bootstrap).
</P>
<P>Anyone who
<A HREF="http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html">knows
the DEC assembler well enough</A> to provide the equivalent of
these two pseudos would win praise and accolades from many.
</P>
<HR>
<H1><A NAME="4_0">4.0 Known Bugs and Non-Bugs</A></H1>
<EM>Note that this section can get rapdily outdated -- such is the
nature of an open-source project. For the latest information, join
......@@ -482,6 +499,15 @@ to the list</A>, Nathan Myers announced that he has started a list of
necessarily trying to be OO. There are multiple solutions
under discussion.
</P>
<P>Another is the <TT>rel_ops</TT> namespace and the template
comparison operator functions contained therein. If they become
visible in the same namespace as other comparison functions
(e.g., '<TT>using</TT>' them and the &lt;iterator&gt; header),
then you will suddenly be faced with huge numbers of ambiguity
errors. This was discussed on the -v3 list; Nathan Myers
<A HREF="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
things up here</A>.
</P>
<H3><A NAME="4_4_interface">The g++-3 headers are
<EM>not ours</EM></A></H3>
<P>If you have found an extremely broken header file which is
......@@ -572,7 +598,7 @@ HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>.
is merged into libstdc++-v3 with changes as necessary.
Currently release 3.3 is being used. Changes in the STL
usually produce some weird bugs and lots of changes in the
rest of the libstd++ source as we scramble to keep up. :-)
rest of the libstdc++ source as we scramble to keep up. :-)
</P>
<P>In particular, <TT>string</TT> is not from SGI and makes no
use of their &quot;rope&quot; class (which is included as an
......@@ -652,7 +678,7 @@ HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>.
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: index.html,v 1.10 2000/12/03 23:47:49 jsm28 Exp $
<BR> $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $
</EM></P>
......
......@@ -7,7 +7,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 Installation Instructions</TITLE>
<LINK REL=StyleSheet HREF="lib3styles.css">
<!-- $Id: install.html,v 1.1 2000/12/10 04:03:08 pme Exp $ -->
<!-- $Id: install.html,v 1.2 2001/01/21 09:36:09 pme Exp $ -->
</HEAD>
<BODY>
......@@ -150,7 +150,7 @@
<P><B>...with a gcc-2.9[67] snapshot</B>
<P>Unpack the <EM>gccsrcdir</EM> and go into that directory. For
X instance, <TT>gcc-2.95.2</TT> is a valid <EM>gccsrcdir</EM>.
instance, <TT>gcc-2.95.2</TT> is a valid <EM>gccsrcdir</EM>.
Once in <EM>gccsrcdir</EM>, you'll need to rename the libstdc++-v3
directory which comes with that snapshot:
<PRE>
......@@ -370,7 +370,7 @@ X instance, <TT>gcc-2.95.2</TT> is a valid <EM>gccsrcdir</EM>.
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: install.html,v 1.1 2000/12/10 04:03:08 pme Exp $
<BR> $Id: install.html,v 1.2 2001/01/21 09:36:09 pme Exp $
</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