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> 2001-01-23 Gabriel Dos Reis <gdr@codesourcery.com>
* testsuite/lib/libstdc++.exp: Improve. Add support for @xxx# * testsuite/lib/libstdc++.exp: Improve. Add support for @xxx#
......
...@@ -356,7 +356,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [ ...@@ -356,7 +356,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
dnl dnl
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of 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 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. dnl Doing it this way saves significant configure time.
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_MSG_CHECKING([for $1 functions]) AC_MSG_CHECKING([for $1 functions])
...@@ -365,8 +365,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [ ...@@ -365,8 +365,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <math.h>], AC_TRY_COMPILE([#include <math.h>],
[ `for x in $3; do echo "$x (0);"; done` ], [ `for x in $3; do echo "$x (0);"; done` ],
[glibcpp_cv_func_$2_use=yes], [glibcpp_cv_func_$2_use=yes],
[glibcpp_cv_func_$2_use=no]) [glibcpp_cv_func_$2_use=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
AC_MSG_RESULT($glibcpp_cv_func_$2_use) AC_MSG_RESULT($glibcpp_cv_func_$2_use)
if test x$glibcpp_cv_func_$2_use = x"yes"; then if test x$glibcpp_cv_func_$2_use = x"yes"; then
...@@ -633,12 +633,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -633,12 +633,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have float versions. dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
float_trig, float_trig,
acosf asinf atanf \ acosf asinf atanf \
cosf sinf tanf \ cosf sinf tanf \
coshf sinhf tanhf) coshf sinhf tanhf)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
float_round, float_round,
ceilf floorf) ceilf floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
...@@ -656,12 +656,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -656,12 +656,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have long double versions. dnl Check to see if basic C math functions have long double versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
long_double_trig, long_double_trig,
acosl asinl atanl \ acosl asinl atanl \
cosl sinl tanl \ cosl sinl tanl \
coshl sinhl tanhl) coshl sinhl tanhl)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
long_double_round, long_double_round,
ceill floorl) ceill floorl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
...@@ -694,12 +694,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -694,12 +694,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have float versions. dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
_float_trig, _float_trig,
_acosf _asinf _atanf \ _acosf _asinf _atanf \
_cosf _sinf _tanf \ _cosf _sinf _tanf \
_coshf _sinhf _tanhf) _coshf _sinhf _tanhf)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
_float_round, _float_round,
_ceilf _floorf) _ceilf _floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff)
...@@ -717,12 +717,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -717,12 +717,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have long double versions. dnl Check to see if basic C math functions have long double versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
_long_double_trig, _long_double_trig,
_acosl _asinl _atanl \ _acosl _asinl _atanl \
_cosl _sinl _tanl \ _cosl _sinl _tanl \
_coshl _sinhl _tanhl) _coshl _sinhl _tanhl)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
_long_double_round, _long_double_round,
_ceill _floorl) _ceill _floorl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl)
...@@ -1398,13 +1398,13 @@ changequote(<<, >>)dnl ...@@ -1398,13 +1398,13 @@ changequote(<<, >>)dnl
changequote([, ]) changequote([, ])
[case "$enableval" in [case "$enableval" in
c) c)
enable_cheaders=c enable_cheaders=c
;; ;;
c_std) c_std)
enable_cheaders=c_std enable_cheaders=c_std
;; ;;
c_shadow) c_shadow)
enable_cheaders=c_shadow enable_cheaders=c_shadow
;; ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers]) *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
;; ;;
......
...@@ -368,7 +368,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [ ...@@ -368,7 +368,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
dnl dnl
dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of 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 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. dnl Doing it this way saves significant configure time.
AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_MSG_CHECKING([for $1 functions]) AC_MSG_CHECKING([for $1 functions])
...@@ -377,8 +377,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [ ...@@ -377,8 +377,8 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <math.h>], AC_TRY_COMPILE([#include <math.h>],
[ `for x in $3; do echo "$x (0);"; done` ], [ `for x in $3; do echo "$x (0);"; done` ],
[glibcpp_cv_func_$2_use=yes], [glibcpp_cv_func_$2_use=yes],
[glibcpp_cv_func_$2_use=no]) [glibcpp_cv_func_$2_use=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
AC_MSG_RESULT($glibcpp_cv_func_$2_use) AC_MSG_RESULT($glibcpp_cv_func_$2_use)
if test x$glibcpp_cv_func_$2_use = x"yes"; then if test x$glibcpp_cv_func_$2_use = x"yes"; then
...@@ -645,12 +645,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -645,12 +645,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have float versions. dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
float_trig, float_trig,
acosf asinf atanf \ acosf asinf atanf \
cosf sinf tanf \ cosf sinf tanf \
coshf sinhf tanhf) coshf sinhf tanhf)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
float_round, float_round,
ceilf floorf) ceilf floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
...@@ -668,12 +668,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -668,12 +668,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have long double versions. dnl Check to see if basic C math functions have long double versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
long_double_trig, long_double_trig,
acosl asinl atanl \ acosl asinl atanl \
cosl sinl tanl \ cosl sinl tanl \
coshl sinhl tanhl) coshl sinhl tanhl)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
long_double_round, long_double_round,
ceill floorl) ceill floorl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
...@@ -706,12 +706,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -706,12 +706,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have float versions. dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
_float_trig, _float_trig,
_acosf _asinf _atanf \ _acosf _asinf _atanf \
_cosf _sinf _tanf \ _cosf _sinf _tanf \
_coshf _sinhf _tanhf) _coshf _sinhf _tanhf)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
_float_round, _float_round,
_ceilf _floorf) _ceilf _floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinff)
...@@ -729,12 +729,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [ ...@@ -729,12 +729,12 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
dnl Check to see if basic C math functions have long double versions. dnl Check to see if basic C math functions have long double versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
_long_double_trig, _long_double_trig,
_acosl _asinl _atanl \ _acosl _asinl _atanl \
_cosl _sinl _tanl \ _cosl _sinl _tanl \
_coshl _sinhl _tanhl) _coshl _sinhl _tanhl)
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round, GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
_long_double_round, _long_double_round,
_ceill _floorl) _ceill _floorl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isnanl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl) GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(_isinfl)
...@@ -1410,13 +1410,13 @@ changequote(<<, >>)dnl ...@@ -1410,13 +1410,13 @@ changequote(<<, >>)dnl
changequote([, ]) changequote([, ])
[case "$enableval" in [case "$enableval" in
c) c)
enable_cheaders=c enable_cheaders=c
;; ;;
c_std) c_std)
enable_cheaders=c_std enable_cheaders=c_std
;; ;;
c_shadow) c_shadow)
enable_cheaders=c_shadow enable_cheaders=c_shadow
;; ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers]) *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
;; ;;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# glibcpp_cxxflags Special CXXFLAGS to use when building # glibcpp_cxxflags Special CXXFLAGS to use when building
# cpu_include_dir CPU-specific include directory, relative to srcdir # cpu_include_dir CPU-specific include directory, relative to srcdir
# os_include_dir OS-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. # The first two are set in configure.host and modified here.
......
...@@ -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 20</TITLE> <TITLE>libstdc++-v3 HOWTO: Chapter 20</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css"> <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> </HEAD>
<BODY> <BODY>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<H1>Contents</H1> <H1>Contents</H1>
<UL> <UL>
<LI><A HREF="#1"><TT>auto_ptr</TT> is not omnipotent</A> <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="#3">Functors</A>
<LI><A HREF="#4">Pairs</A> <LI><A HREF="#4">Pairs</A>
</UL> </UL>
...@@ -82,32 +82,61 @@ ...@@ -82,32 +82,61 @@
to one or many things. If it points to many things, you are about 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 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 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>
<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>
<H2><A NAME="2">Automatically-generated operators</A></H2> <H2><A NAME="2"><TT>auto_ptr</TT> inside container classes</A></H2>
<P>Many programs (for that matter, many of the Standard algorithms <P>All of the <A HREF="../23_containers/howto.html">containers</A>
and containers) require that you write comparison operators for described in the standard library require their contained types
your classes, like <TT>operator&gt;=</TT>. As any mathmatician to have, among other things, a copy contructor like this:
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:
<PRE> <PRE>
#include &lt;header_with_my_op==_and_op&lt;_defined&gt; struct My_Type
#include &lt;utility&gt; {
using std::rel_ops; // note the nested namespace! My_Type (My_Type const&amp;);
};
... </PRE>
if ((obj1 != obj2) || (obj3 >= obj4)) foo(); 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;
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> </PRE>
See the highlighted error? It starts with a message in all caps
to get your attention.
</P> </P>
<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>.
...@@ -185,7 +214,7 @@ ...@@ -185,7 +214,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: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: Chapter 27</TITLE> <TITLE>libstdc++-v3 HOWTO: Chapter 27</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css"> <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> </HEAD>
<BODY> <BODY>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<LI><A HREF="#3">Binary I/O</A> <LI><A HREF="#3">Binary I/O</A>
<LI><A HREF="#4">Iostreams class hierarchy diagram</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="#5">What is this &lt;sstream&gt;/stringstreams thing?</A>
<LI><A HREF="#6">Deriving a stream buffer</A>
</UL> </UL>
<HR> <HR>
...@@ -327,6 +328,61 @@ ...@@ -327,6 +328,61 @@
support them, and 2) if you use them, people will laugh at you. support them, and 2) if you use them, people will laugh at you.
</P> </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 @@ ...@@ -335,7 +391,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: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.10 2000/12/03 23:47:49 jsm28 Exp $ --> <!-- $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
</HEAD> </HEAD>
<BODY> <BODY>
...@@ -53,6 +53,7 @@ http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P> ...@@ -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 <LI><A HREF="#3_1">Can libstdc++-v3 be used with &lt;my
favorite compiler&gt;?</A> favorite compiler&gt;?</A>
<LI><A HREF="#3_2">Building under Cygwin hangs/explodes!?</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> </OL>
<LI><A HREF="#4_0">Known Bugs and Non-Bugs</A> <LI><A HREF="#4_0">Known Bugs and Non-Bugs</A>
...@@ -370,6 +371,22 @@ HREF="http://sources.redhat.com/automake/">automake</A>. ...@@ -370,6 +371,22 @@ HREF="http://sources.redhat.com/automake/">automake</A>.
</P> </P>
<HR> <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> <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 <EM>Note that this section can get rapdily outdated -- such is the
nature of an open-source project. For the latest information, join 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 ...@@ -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 necessarily trying to be OO. There are multiple solutions
under discussion. under discussion.
</P> </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 <H3><A NAME="4_4_interface">The g++-3 headers are
<EM>not ours</EM></A></H3> <EM>not ours</EM></A></H3>
<P>If you have found an extremely broken header file which is <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>. ...@@ -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. is merged into libstdc++-v3 with changes as necessary.
Currently release 3.3 is being used. Changes in the STL Currently release 3.3 is being used. Changes in the STL
usually produce some weird bugs and lots of changes in the 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>
<P>In particular, <TT>string</TT> is not from SGI and makes no <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 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>. ...@@ -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 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.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> </EM></P>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers"> <META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 Installation Instructions</TITLE> <TITLE>libstdc++-v3 Installation Instructions</TITLE>
<LINK REL=StyleSheet HREF="lib3styles.css"> <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> </HEAD>
<BODY> <BODY>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<P><B>...with a gcc-2.9[67] snapshot</B> <P><B>...with a gcc-2.9[67] snapshot</B>
<P>Unpack the <EM>gccsrcdir</EM> and go into that directory. For <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 Once in <EM>gccsrcdir</EM>, you'll need to rename the libstdc++-v3
directory which comes with that snapshot: directory which comes with that snapshot:
<PRE> <PRE>
...@@ -370,7 +370,7 @@ X instance, <TT>gcc-2.95.2</TT> is a valid <EM>gccsrcdir</EM>. ...@@ -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 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: 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> </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