Commit 03a32789 by Benjamin Kosnik Committed by Benjamin Kosnik

faq.xml: Adjust structure for pdf index.

2010-02-24  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/xml/faq.xml: Adjust structure for pdf index.
	* doc/xml/manual/mt_allocator.xml: Same.
	* doc/xml/manual/allocator.xml: Same.
	* doc/xml/manual/ctype.xml: Same.
	* doc/xml/manual/numerics.xml: Same.
	* doc/xml/manual/codecvt.xml: Same.
	* doc/xml/manual/intro.xml: Same.
	* doc/xml/manual/shared_ptr.xml: Same.
	* doc/xml/manual/status_cxxtr1.xml: Same.
	* doc/xml/manual/auto_ptr.xml: Same.
	* doc/xml/manual/internals.xml: Same.
	* doc/xml/manual/status_cxx1998.xml: Same.
	* doc/xml/manual/parallel_mode.xml: Same.
	* doc/xml/manual/profile_mode.xml: Same.
	* doc/xml/manual/containers.xml: Same.
	* doc/xml/manual/io.xml: Same.
	* doc/xml/manual/concurrency_extensions.xml: Same.
	* doc/xml/manual/appendix_porting.xml: Same.
	* doc/xml/manual/utilities.xml: Same.
	* doc/xml/manual/support.xml: Same.
	* doc/xml/manual/bitmap_allocator.xml: Same.
	* doc/xml/manual/configure.xml: Same.
	* doc/xml/manual/build_hacking.xml: Same.
	* doc/xml/manual/evolution.xml: Same.
	* doc/xml/manual/using.xml: Same.
	* doc/xml/manual/debug.xml: Same.
	* doc/xml/manual/localization.xml: Same.
	* doc/xml/manual/strings.xml: Same.
	* doc/xml/manual/debug_mode.xml: Same.
	* doc/xml/manual/locale.xml: Same.
	* doc/xml/manual/extensions.xml: Same.
	* doc/xml/manual/appendix_contributing.xml: Same.
	* doc/xml/manual/prerequisites.xml: Same.
	* doc/xml/manual/messages.xml: Same.
	* doc/xml/manual/diagnostics.xml: Same.
	* doc/xml/manual/algorithms.xml: Same.
	* doc/xml/manual/appendix_free.xml: Same.
	* doc/xml/manual/iterators.xml: Same.
	* doc/xml/manual/spine.xml: Same.
	* doc/xml/manual/status_cxxtr24733.xml: Same.
	* doc/xml/manual/status_cxx200x.xml: Same.
	* doc/Makefile.am: Refactor.
	* doc/Makefile.in: Regenerate.

	* include/bits/c++0x_warning.h: Tweak doxygen file markup.

From-SVN: r157059
parent 72c2ffd3
2010-02-24 Benjamin Kosnik <bkoz@redhat.com>
* doc/xml/faq.xml: Adjust structure for pdf index.
* doc/xml/manual/mt_allocator.xml: Same.
* doc/xml/manual/allocator.xml: Same.
* doc/xml/manual/ctype.xml: Same.
* doc/xml/manual/numerics.xml: Same.
* doc/xml/manual/codecvt.xml: Same.
* doc/xml/manual/intro.xml: Same.
* doc/xml/manual/shared_ptr.xml: Same.
* doc/xml/manual/status_cxxtr1.xml: Same.
* doc/xml/manual/auto_ptr.xml: Same.
* doc/xml/manual/internals.xml: Same.
* doc/xml/manual/status_cxx1998.xml: Same.
* doc/xml/manual/parallel_mode.xml: Same.
* doc/xml/manual/profile_mode.xml: Same.
* doc/xml/manual/containers.xml: Same.
* doc/xml/manual/io.xml: Same.
* doc/xml/manual/concurrency_extensions.xml: Same.
* doc/xml/manual/appendix_porting.xml: Same.
* doc/xml/manual/utilities.xml: Same.
* doc/xml/manual/support.xml: Same.
* doc/xml/manual/bitmap_allocator.xml: Same.
* doc/xml/manual/configure.xml: Same.
* doc/xml/manual/build_hacking.xml: Same.
* doc/xml/manual/evolution.xml: Same.
* doc/xml/manual/using.xml: Same.
* doc/xml/manual/debug.xml: Same.
* doc/xml/manual/localization.xml: Same.
* doc/xml/manual/strings.xml: Same.
* doc/xml/manual/debug_mode.xml: Same.
* doc/xml/manual/locale.xml: Same.
* doc/xml/manual/extensions.xml: Same.
* doc/xml/manual/appendix_contributing.xml: Same.
* doc/xml/manual/prerequisites.xml: Same.
* doc/xml/manual/messages.xml: Same.
* doc/xml/manual/diagnostics.xml: Same.
* doc/xml/manual/algorithms.xml: Same.
* doc/xml/manual/appendix_free.xml: Same.
* doc/xml/manual/iterators.xml: Same.
* doc/xml/manual/spine.xml: Same.
* doc/xml/manual/status_cxxtr24733.xml: Same.
* doc/xml/manual/status_cxx200x.xml: Same.
* doc/Makefile.am: Refactor.
* doc/Makefile.in: Regenerate.
* include/bits/c++0x_warning.h: Tweak doxygen file markup.
2010-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/ext/new_allocator/deallocate_global.cc: Require
......
......@@ -22,44 +22,50 @@
include $(top_srcdir)/fragment.am
# Documentation Overview
#
# There are two main source materials for libstdc++ documentation.
# The first is the doxygen markup in libstdc++ sources. And the second
# is the docbook markup in doc/xml/. A third and more obscure option
# deals with charting performance tests.
# Default, points to current best sub-rule that is the best conversion.
# MAN
doc-man: doc-man-doxygen
# PDF
doc-pdf: doc-pdf-dblatex-docbook
# HTML
doc-html: doc-html-docbook
# Doxygen configuration
# Assumes doxygen, graphviz (with dot) installed
doc_doxygen_script=${top_srcdir}/scripts/run_doxygen
doxygen_script=${top_srcdir}/scripts/run_doxygen
doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
doc-html-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
doc-man-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
doc-xml-doxygen:
doc-xml-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
doxygen_xmldir = ${glibcxx_builddir}/doc/doxygen/xml
doc-xml-doxygen-single: doc-xml-doxygen
doc-xml-single-doxygen:
@echo "Generating doxygen xml single file..."
$(XSLTPROC) ${doxygen_xmldir}/combine.xslt ${doxygen_xmldir}/spine.xml > ${doxygen_xmldir}/all.xml;
# Performance doc and graph configuration.
# Assumes pychart, beautiful soup installed.
# Generates the plots and graphs for performance testing.
doc_performance_script=${top_srcdir}/scripts/make_graphs.py
doc-html-performance:
-@(chmod + ${doc_performance_script}; \
${doc_performance_script} ${top_srcdir} \
${glibcxx_builddir}/testsuite \
${top_srcdir}/testsuite/data/make_graph_htmls.xml \
${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
$(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
${doxygen_outdir}/xml/spine.xml > ${doxygen_outdir}/xml/all.xml;
# Docbook configuration.
......@@ -68,6 +74,7 @@ doc-html-performance:
# docbook-style-xsl
# emacs-nxml-mode
# xmlto passivetex
docbook_outdir = ${glibcxx_builddir}/doc/docbook
xml_srcdir = ${glibcxx_srcdir}/doc/xml
xml_sources = \
${xml_srcdir}/spine.xml \
......@@ -112,6 +119,7 @@ xml_sources = \
${xml_srcdir}/manual/support.xml \
${xml_srcdir}/manual/test.xml \
${xml_srcdir}/manual/using.xml \
${xml_srcdir}/manual/using_exceptions.xml \
${xml_srcdir}/manual/utilities.xml \
${xml_srcdir}/manual/appendix_free.xml \
${xml_srcdir}/manual/appendix_contributing.xml \
......@@ -137,17 +145,17 @@ XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
#XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
${glibcxx_builddir}/doc/html:
mkdir ${glibcxx_builddir}/doc/html
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
${glibcxx_builddir}/doc/pdf:
mkdir ${glibcxx_builddir}/doc/pdf
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
${glibcxx_builddir}/doc/fo:
mkdir ${glibcxx_builddir}/doc/fo
${docbook_outdir}/fo:
mkdir -p ${docbook_outdir}/fo
${glibcxx_builddir}/doc/xml:
mkdir ${glibcxx_builddir}/doc/xml
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
# Validate existing XML structure.
XMLLINT = xmllint
......@@ -156,57 +164,53 @@ XMLLINT = xmllint
LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks --nonet --noout
VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
doc-xml-validate: $(xml_sources)
doc-xml-validate-docbook: $(xml_sources)
@echo "Generating XML validation log..."
$(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
doc-xml-single: $(xml_sources) ${glibcxx_builddir}/doc/xml
doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
@echo "Generating XML single..."
$(XMLLINT) --xinclude --noent --noblanks \
-o ${glibcxx_builddir}/doc/xml/spine-single.xml \
-o ${docbook_outdir}/xml/spine-single.xml \
${top_srcdir}/doc/xml/spine.xml
# HTML, index plus chapters
doc-html: $(xml_sources) ${glibcxx_builddir}/doc/html
doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/html/ \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
$(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
# HTML, all one page
doc-html-single: $(xml_sources) ${glibcxx_builddir}/doc/html
doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html single file..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/html/ \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
$(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
# FO
doc-fo: $(xml_sources) ${glibcxx_builddir}/doc/fo
doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
@echo "Generating FO files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/fo/spine.fo \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
$(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
# PDF
# Points to current best xml to PDF generation process.
doc-pdf: doc-pdf-dblatex
# PDF 1
# fop
FOP = fop
FOP_FLAGS = -d -r
doc-pdf-fop-xml: $(xml_sources) ${glibcxx_builddir}/doc/pdf
doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
@echo "Generating pdf fop files from xml..."
$(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
-xsl $(XSL_FO_STYLE) -pdf ${glibcxx_builddir}/doc/pdf/spine.pdf
-xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
doc-pdf-fop-fo: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
@echo "Generating pdf fop files from fo..."
$(FOP) $(FOP_FLAGS) -fo ${glibcxx_builddir}/doc/fo/spine.fo \
-pdf ${glibcxx_builddir}/doc/pdf/spine.pdf
$(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
-pdf ${docbook_outdir}/pdf/spine.pdf
# PDF 2
# xmlto
XML2PDF = xmlto
XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
doc-pdf-xmlto: $(xml_sources) ${glibcxx_builddir}/doc/pdf
doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf xmlto files..."
$(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
......@@ -214,26 +218,37 @@ doc-pdf-xmlto: $(xml_sources) ${glibcxx_builddir}/doc/pdf
# xmlroff
XMLROFF = xmlroff
XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
doc-pdf-xmlroff: $(xml_sources) doc-fo
doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
@echo "Generating pdf xmlroff files..."
$(XMLROFF) $(XMLROFF_FLAGS) ${glibcxx_builddir}/doc/fo/spine.fo
$(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
# PDF 4
# prince
PRINCE = prince
PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
doc-pdf-prince: $(xml_sources) ${glibcxx_builddir}/doc/pdf
doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf prince files..."
$(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/doc/xml/spine.xml
$(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
# PDF 5
# dblatex
DBLATEX_FLAGS = --dump --verbose --pdf -o pdf/manual.pdf
doc-pdf-dblatex: $(xml_sources) ${glibcxx_builddir}/doc/pdf
DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf dblatex files..."
dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
# Performance doc and graph configuration.
# Assumes pychart, beautiful soup installed.
# Generates the plots and graphs for performance testing.
doc_performance_script=${top_srcdir}/scripts/make_graphs.py
doc-html-performance:
-@(chmod + ${doc_performance_script}; \
${doc_performance_script} ${top_srcdir} \
${glibcxx_builddir}/testsuite \
${top_srcdir}/testsuite/data/make_graph_htmls.xml \
${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
.PHONY: doc-doxygen-html doc-doxygen-man doc-performance
# By adding these files here, automake will remove them for 'make clean'
......@@ -241,4 +256,4 @@ CLEANFILES = *.log
# To remove directories.
clean-local:
rm -rf man html pdf fo doxygen xml
rm -rf man html pdf fo xml doxygen docbook
......@@ -265,13 +265,8 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# Doxygen configuration
# Assumes doxygen, graphviz (with dot) installed
doc_doxygen_script = ${top_srcdir}/scripts/run_doxygen
doxygen_xmldir = ${glibcxx_builddir}/doc/doxygen/xml
# Performance doc and graph configuration.
# Assumes pychart, beautiful soup installed.
# Generates the plots and graphs for performance testing.
doc_performance_script = ${top_srcdir}/scripts/make_graphs.py
doxygen_script = ${top_srcdir}/scripts/run_doxygen
doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
# Docbook configuration.
# Assumes
......@@ -279,6 +274,7 @@ doc_performance_script = ${top_srcdir}/scripts/make_graphs.py
# docbook-style-xsl
# emacs-nxml-mode
# xmlto passivetex
docbook_outdir = ${glibcxx_builddir}/doc/docbook
xml_srcdir = ${glibcxx_srcdir}/doc/xml
xml_sources = \
${xml_srcdir}/spine.xml \
......@@ -323,6 +319,7 @@ xml_sources = \
${xml_srcdir}/manual/support.xml \
${xml_srcdir}/manual/test.xml \
${xml_srcdir}/manual/using.xml \
${xml_srcdir}/manual/using_exceptions.xml \
${xml_srcdir}/manual/utilities.xml \
${xml_srcdir}/manual/appendix_free.xml \
${xml_srcdir}/manual/appendix_contributing.xml \
......@@ -377,7 +374,12 @@ PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
# PDF 5
# dblatex
DBLATEX_FLAGS = --dump --verbose --pdf -o pdf/manual.pdf
DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
# Performance doc and graph configuration.
# Assumes pychart, beautiful soup installed.
# Generates the plots and graphs for performance testing.
doc_performance_script = ${top_srcdir}/scripts/make_graphs.py
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.log
......@@ -567,102 +569,117 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am
# Documentation Overview
#
# There are two main source materials for libstdc++ documentation.
# The first is the doxygen markup in libstdc++ sources. And the second
# is the docbook markup in doc/xml/. A third and more obscure option
# deals with charting performance tests.
# Default, points to current best sub-rule that is the best conversion.
# MAN
doc-man: doc-man-doxygen
# PDF
doc-pdf: doc-pdf-dblatex-docbook
# HTML
doc-html: doc-html-docbook
doc-html-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
doc-man-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
doc-xml-doxygen:
doc-xml-doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
builddir=`cd ..; ${PWD_COMMAND}`; \
${SHELL} ${doc_doxygen_script} \
${SHELL} ${doxygen_script} \
--host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
doc-xml-doxygen-single: doc-xml-doxygen
doc-xml-single-doxygen:
@echo "Generating doxygen xml single file..."
$(XSLTPROC) ${doxygen_xmldir}/combine.xslt ${doxygen_xmldir}/spine.xml > ${doxygen_xmldir}/all.xml;
doc-html-performance:
-@(chmod + ${doc_performance_script}; \
${doc_performance_script} ${top_srcdir} \
${glibcxx_builddir}/testsuite \
${top_srcdir}/testsuite/data/make_graph_htmls.xml \
${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
$(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
${doxygen_outdir}/xml/spine.xml > ${doxygen_outdir}/xml/all.xml;
${glibcxx_builddir}/doc/html:
mkdir ${glibcxx_builddir}/doc/html
${docbook_outdir}/html:
mkdir -p ${docbook_outdir}/html
${glibcxx_builddir}/doc/pdf:
mkdir ${glibcxx_builddir}/doc/pdf
${docbook_outdir}/pdf:
mkdir -p ${docbook_outdir}/pdf
${glibcxx_builddir}/doc/fo:
mkdir ${glibcxx_builddir}/doc/fo
${docbook_outdir}/fo:
mkdir -p ${docbook_outdir}/fo
${glibcxx_builddir}/doc/xml:
mkdir ${glibcxx_builddir}/doc/xml
doc-xml-validate: $(xml_sources)
${docbook_outdir}/xml:
mkdir -p ${docbook_outdir}/xml
doc-xml-validate-docbook: $(xml_sources)
@echo "Generating XML validation log..."
$(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
doc-xml-single: $(xml_sources) ${glibcxx_builddir}/doc/xml
doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
@echo "Generating XML single..."
$(XMLLINT) --xinclude --noent --noblanks \
-o ${glibcxx_builddir}/doc/xml/spine-single.xml \
-o ${docbook_outdir}/xml/spine-single.xml \
${top_srcdir}/doc/xml/spine.xml
# HTML, index plus chapters
doc-html: $(xml_sources) ${glibcxx_builddir}/doc/html
doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/html/ \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
$(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
# HTML, all one page
doc-html-single: $(xml_sources) ${glibcxx_builddir}/doc/html
doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
@echo "Generating html single file..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/html/ \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
$(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
# FO
doc-fo: $(xml_sources) ${glibcxx_builddir}/doc/fo
doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
@echo "Generating FO files..."
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${glibcxx_builddir}/doc/fo/spine.fo \
$(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
$(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
# PDF
# Points to current best xml to PDF generation process.
doc-pdf: doc-pdf-dblatex
doc-pdf-fop-xml: $(xml_sources) ${glibcxx_builddir}/doc/pdf
doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
@echo "Generating pdf fop files from xml..."
$(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
-xsl $(XSL_FO_STYLE) -pdf ${glibcxx_builddir}/doc/pdf/spine.pdf
-xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
doc-pdf-fop-fo: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
@echo "Generating pdf fop files from fo..."
$(FOP) $(FOP_FLAGS) -fo ${glibcxx_builddir}/doc/fo/spine.fo \
-pdf ${glibcxx_builddir}/doc/pdf/spine.pdf
doc-pdf-xmlto: $(xml_sources) ${glibcxx_builddir}/doc/pdf
$(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
-pdf ${docbook_outdir}/pdf/spine.pdf
doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf xmlto files..."
$(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
doc-pdf-xmlroff: $(xml_sources) doc-fo
doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
@echo "Generating pdf xmlroff files..."
$(XMLROFF) $(XMLROFF_FLAGS) ${glibcxx_builddir}/doc/fo/spine.fo
doc-pdf-prince: $(xml_sources) ${glibcxx_builddir}/doc/pdf
$(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf prince files..."
$(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/doc/xml/spine.xml
doc-pdf-dblatex: $(xml_sources) ${glibcxx_builddir}/doc/pdf
$(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
@echo "Generating pdf dblatex files..."
dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
doc-html-performance:
-@(chmod + ${doc_performance_script}; \
${doc_performance_script} ${top_srcdir} \
${glibcxx_builddir}/testsuite \
${top_srcdir}/testsuite/data/make_graph_htmls.xml \
${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
.PHONY: doc-doxygen-html doc-doxygen-man doc-performance
# To remove directories.
clean-local:
rm -rf man html pdf fo doxygen xml
rm -rf man html pdf fo xml doxygen docbook
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
......@@ -400,7 +400,7 @@
<para>
If the only functions from <filename>libstdc++.a</filename>
which you need are language support functions (those listed in
<link linkend="manual.support">clause 18</link> of the
<link linkend="std.support">clause 18</link> of the
standard, e.g., <function>new</function> and
<function>delete</function>), then try linking against
<filename>libsupc++.a</filename>, which is a subset of
......@@ -896,7 +896,7 @@
<para>
More information, including how to optionally enable/disable the
checks, is available
<link linkend="manual.diagnostics.concept_checking">here</link>.
<link linkend="std.diagnostics.concept_checking">here</link>.
</para>
</answer>
</qandaentry>
......@@ -962,7 +962,7 @@
<answer id="a-list_size_on">
<para>
See
the <link linkend="manual.containers">Containers</link>
the <link linkend="std.containers">Containers</link>
chapter.
</para>
</answer>
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.algorithms" xreflabel="Algorithms">
<chapter id="std.algorithms" xreflabel="Algorithms">
<?dbhtml filename="algorithms.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -18,71 +18,69 @@
algorithm
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Algorithms
<indexterm><primary>Algorithms</primary></indexterm>
</title>
<preface>
<title></title>
<para>
The neatest accomplishment of the algorithms chapter is that all the
The neatest accomplishment of the algorithms sect1 is that all the
work is done via iterators, not containers directly. This means two
important things:
</para>
<orderedlist>
<listitem>
<para>
Anything that behaves like an iterator can be used in one of
these algorithms. Raw pointers make great candidates, thus
built-in arrays are fine containers, as well as your own iterators.
</para>
</listitem>
<listitem>
<para>
The algorithms do not (and cannot) affect the container as a
whole; only the things between the two iterator endpoints. If
you pass a range of iterators only enclosing the middle third of
a container, then anything outside that range is inviolate.
</para>
</listitem>
</orderedlist>
<para>
Even strings can be fed through the algorithms here, although the
string class has specialized versions of many of these functions
(for example, <code>string::find()</code>). Most of the examples
on this page will use simple arrays of integers as a playground
for algorithms, just to keep things simple. The use of
<emphasis>N</emphasis> as a size in the examples is to keep
things easy to read but probably won't be valid code. You can
use wrappers such as those described in the <link
linkend="manual.containers">containers chapter</link> to
keep real code readable.
</para>
<para>
The single thing that trips people up the most is the definition
of <emphasis>range</emphasis> used with iterators; the famous
&quot;past-the-end&quot; rule that everybody loves to hate. The
<link linkend="manual.iterators">iterators
chapter</link> of this document has a complete explanation of
this simple rule that seems to cause so much confusion. Once you
get <emphasis>range</emphasis> into your head (it's not that
hard, honest!), then the algorithms are a cakewalk.
</para>
</preface>
<listitem>
<para>
Anything that behaves like an iterator can be used in one of
these algorithms. Raw pointers make great candidates, thus
built-in arrays are fine containers, as well as your own
iterators.
</para>
</listitem>
<listitem>
<para>
The algorithms do not (and cannot) affect the container as a
whole; only the things between the two iterator endpoints. If
you pass a range of iterators only enclosing the middle third of
a container, then anything outside that range is inviolate.
</para>
</listitem>
</orderedlist>
<para>
Even strings can be fed through the algorithms here, although the
string class has specialized versions of many of these functions
(for example, <code>string::find()</code>). Most of the examples
on this page will use simple arrays of integers as a playground
for algorithms, just to keep things simple. The use of
<emphasis>N</emphasis> as a size in the examples is to keep things
easy to read but probably won't be valid code. You can use wrappers
such as those described in
the <link linkend="std.containers">containers sect1</link> to keep
real code readable.
</para>
<para>
The single thing that trips people up the most is the definition
of <emphasis>range</emphasis> used with iterators; the famous
&quot;past-the-end&quot; rule that everybody loves to hate. The
<link linkend="std.iterators">iterators sect1</link> of this
document has a complete explanation of this simple rule that seems
to cause so much confusion. Once you
get <emphasis>range</emphasis> into your head (it's not that hard,
honest!), then the algorithms are a cakewalk.
</para>
<!-- Chapter 01 : Non Modifying -->
<!-- Sect1 01 : Non Modifying -->
<!-- Chapter 02 : Mutating -->
<chapter id="manual.algorithms.mutating" xreflabel="Mutating">
<!-- Sect1 02 : Mutating -->
<sect1 id="std.algorithms.mutating" xreflabel="Mutating">
<title>Mutating</title>
<sect1 id="algorithms.mutating.swap" xreflabel="swap">
<sect2 id="algorithms.mutating.swap" xreflabel="swap">
<title><function>swap</function></title>
<sect2 id="algorithms.swap.specializations" xreflabel="Specializations">
<sect3 id="algorithms.swap.specializations" xreflabel="Specializations">
<title>Specializations</title>
<para>If you call <code> std::swap(x,y); </code> where x and y are standard
......@@ -98,10 +96,10 @@
internal pointers to storage need to be exchanged.
</para>
</sect2>
</sect1>
</chapter>
</sect3>
</sect2>
</sect1>
<!-- Chapter 03 : Sorting -->
<!-- Sect1 03 : Sorting -->
</part>
</chapter>
<sect1 id="manual.util.memory.allocator" xreflabel="Allocator">
<section id="std.util.memory.allocator" xreflabel="Allocator">
<?dbhtml filename="allocator.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,7 +10,7 @@
allocator
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>Allocators</title>
......@@ -24,7 +24,7 @@
management classes.
</para>
<sect2 id="allocator.req">
<section id="allocator.req">
<title>Requirements</title>
<para>
......@@ -85,9 +85,9 @@
<constant>[20.4 Memory]</constant>.
</para>
</sect2>
</section>
<sect2 id="allocator.design_issues">
<section id="allocator.design_issues">
<title>Design Issues</title>
<para>
......@@ -136,12 +136,12 @@
<function>abi::__cxa_atexit</function> is not recommended.
</para>
</sect2>
</section>
<sect2 id="allocator.impl">
<section id="allocator.impl">
<title>Implementation</title>
<sect3>
<section>
<title>Interface Design</title>
<para>
......@@ -163,9 +163,9 @@
may not be user-configurable.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Selecting Default Allocation Policy</title>
<para>
......@@ -229,9 +229,9 @@
<classname>__gnu_cxx::new_allocator</classname>.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Disabling Memory Caching</title>
<para>
......@@ -281,11 +281,11 @@
cached allocations...).
</para>
</sect3>
</section>
</sect2>
</section>
<sect2 id="allocator.using">
<section id="allocator.using">
<title>Using a Specific Allocator</title>
<para>
......@@ -303,9 +303,9 @@
<programlisting>
std::deque &lt;int, __gnu_cxx::debug_allocator&lt;std::allocator&lt;int&gt; &gt; &gt; debug_deque;
</programlisting>
</sect2>
</section>
<sect2 id="allocator.custom">
<section id="allocator.custom">
<title>Custom Allocators</title>
<para>
......@@ -321,9 +321,9 @@
<classname>new_allocator</classname>.
</para>
</sect2>
</section>
<sect2 id="allocator.ext">
<section id="allocator.ext">
<title>Extension Allocators</title>
<para>
......@@ -489,7 +489,7 @@
</para>
</listitem>
</orderedlist>
</sect2>
</section>
<bibliography id="allocator.biblio">
......@@ -615,4 +615,4 @@
</biblioentry>
</bibliography>
</sect1>
</section>
<?xml version='1.0'?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<appendix id="appendix.free" xreflabel="Free">
......@@ -64,7 +64,7 @@ Given that writing good English is a rare skill among programmers, we
can ill afford to lose manuals this way.
</para>
<para>
<para>
Free documentation, like free software, is a matter of freedom,
not price. The problem with these manuals was not that O'Reilly
Associates charged a price for printed copies--that in itself is fine.
......@@ -170,7 +170,7 @@ prefer copylefted manuals to non-copylefted ones.
[Note: We now maintain a <ulink url="http://www.fsf.org/licensing/doc/other-free-books.html">web page
that lists free books available from other publishers</ulink>].
</para>
<para>Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</para>
<para>Verbatim copying and distribution of this entire article are
......
<?xml version='1.0'?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<appendix id="appendix.porting" xreflabel="Porting">
<?dbhtml filename="appendix_porting.html"?>
<appendixinfo>
<keywordset>
<keyword>
......@@ -26,32 +26,32 @@
</title>
<!-- Hacking the Build System -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="build_hacking.xml">
</xi:include>
<!-- Internals: Porting to New Hardware or Operating Systems -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="internals.xml">
</xi:include>
<!-- Test -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="test.xml">
</xi:include>
<!-- ABI Policy and Guidelines -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="abi.xml">
</xi:include>
<!-- API Evolution and Deprecation History -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="evolution.xml">
</xi:include>
<!-- Backwards Compatibility -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="backwards_compatibility.xml">
</xi:include>
......
<sect1 id="manual.util.memory.auto_ptr" xreflabel="auto_ptr">
<section id="std.util.memory.auto_ptr" xreflabel="auto_ptr">
<?dbhtml filename="auto_ptr.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,11 +10,11 @@
auto_ptr
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>auto_ptr</title>
<sect2 id="auto_ptr.limitations">
<section id="auto_ptr.limitations">
<title>Limitations</title>
<para>Explaining all of the fun and delicious things that can
......@@ -48,11 +48,11 @@
void func (int data)
{
APMC ap (new MyClass(data));
APMC ap (new MyClass(data));
some_throwable_function(); // this will throw an exception
some_throwable_function(); // this will throw an exception
function_taking_MyClass_pointer (ap.get());
function_taking_MyClass_pointer (ap.get());
}
</programlisting>
<para>When an exception gets thrown, the instance of MyClass that's
......@@ -62,15 +62,15 @@
<para>Changing that code as follows is not <acronym>AP</acronym>-friendly:
</para>
<programlisting>
APMC ap (new MyClass[22]);
APMC ap (new MyClass[22]);
</programlisting>
<para>You will get the same problems as you would without the use
of <acronym>AP</acronym>:
</para>
<programlisting>
char* array = new char[10]; // array new...
...
delete array; // ...but single-object delete
char* array = new char[10]; // array new...
...
delete array; // ...but single-object delete
</programlisting>
<para>
AP cannot tell whether the pointer you've passed at creation points
......@@ -79,21 +79,21 @@
own <code>auto_array_ptr</code> for that situation (in fact, this has
been done many times; check the mailing lists, Usenet, Boost, etc).
</para>
</sect2>
<sect2 id="auto_ptr.using">
</section>
<section id="auto_ptr.using">
<title>Use in Containers</title>
<para>
</para>
<para>All of the <link linkend="manual.containers">containers</link>
<para>All of the <link linkend="std.containers">containers</link>
described in the standard library require their contained types
to have, among other things, a copy constructor like this:
</para>
<programlisting>
struct My_Type
{
My_Type (My_Type const&amp;);
My_Type (My_Type const&amp;);
};
</programlisting>
<para>
......@@ -119,15 +119,15 @@
<programlisting>
#include &lt;vector&gt;
#include &lt;memory&gt;
void f()
{
std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
}
</programlisting>
<para>
Should you try this with the checks enabled, you will see an error.
</para>
</sect2>
</section>
</sect1>
</section>
<sect1 id="manual.ext.allocator.bitmap" xreflabel="bitmap_allocator">
<?dbhtml filename="bitmap_allocator.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -81,7 +81,7 @@
the search would go up given an increasing size, for 64 entries
however, lg(64) == 6 comparisons are enough to locate the correct
free list if it exists.
</para>
</para>
<para>
Suppose the free list size has reached it's threshold, then the
largest block from among those in the list and the new block will
......@@ -223,7 +223,7 @@ else return false.</para></listitem>
<sect3 id="bitmap.impl.max_wasted" xreflabel="Max Wasted Percentage">
<title>Maximum Wasted Percentage</title>
<para>
This has nothing to do with the algorithm per-se,
only with some vales that must be chosen correctly to ensure that the
......@@ -328,12 +328,12 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
<listitem>
<para>
Gets more memory from the Global Free List of the Required
size.
size.
</para>
</listitem>
<listitem>
<para>
Adjusts the size for the next call to itself.
Adjusts the size for the next call to itself.
</para>
</listitem>
<listitem>
......@@ -344,7 +344,7 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
<listitem>
<para>
Sets the use count for that super-block just allocated to 0
(zero).
(zero).
</para>
</listitem>
<listitem>
......@@ -353,7 +353,7 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
for the allocator. If the invariant is maintained, we are
sure that all is well. Now, the same process is applied on
the newly acquired free blocks, which are dispatched
accordingly.
accordingly.
</para>
</listitem>
</itemizedlist>
......@@ -378,7 +378,7 @@ single object allocations.
<para>
However for n == 1, a series of steps are performed:
</para>
<orderedlist>
<listitem><para>
We first need to locate that super-block which holds the memory
......@@ -504,7 +504,7 @@ Block a bitmap as well?
testing, I've decided to keep these bitmaps close to the actual
blocks. This will help in 2 ways.
</para>
<orderedlist>
<listitem><para>Constant time access for the bitmap themselves, since no kind of
look up will be needed to find the correct bitmap list or it's
......@@ -555,5 +555,5 @@ equivalent.</para></listitem>
</sect3>
</sect2>
</sect1>
<sect1 id="appendix.porting.build_hacking" xreflabel="Build Hacking">
<?dbhtml filename="build_hacking.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -25,7 +25,7 @@
<sect2 id="build_hacking.prereq">
<title>Prerequisites</title>
<para>
<para>
As noted <ulink
url="http://gcc.gnu.org/install/prerequisites.html">previously</ulink>,
certain other tools are necessary for hacking on files that
......@@ -42,7 +42,7 @@
<sect2 id="build_hacking.map">
<title>Overview: What Comes from Where</title>
<screen>
<inlinemediaobject>
<imageobject>
......
<sect1 id="manual.localization.facet.codecvt" xreflabel="codecvt">
<section id="std.localization.facet.codecvt" xreflabel="codecvt">
<?dbhtml filename="codecvt.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,7 +10,7 @@
codecvt
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>codecvt</title>
......@@ -30,7 +30,7 @@ specializations for wide and narrow characters and the
implementation-provided extended functionality are given.
</para>
<sect2 id="facet.codecvt.req">
<section id="facet.codecvt.req">
<title>Requirements</title>
<para>
......@@ -108,12 +108,12 @@ Two: The required conversions, by specifying mbstate_t as the third
template parameter, imply an implementation strategy that is mostly
(or wholly) based on the underlying C library, and the functions
mcsrtombs and wcsrtombs in particular.</para>
</sect2>
</section>
<sect2 id="facet.codecvt.design">
<section id="facet.codecvt.design">
<title>Design</title>
<sect3 id="codecvt.design.wchar_t_size">
<section id="codecvt.design.wchar_t_size">
<title><type>wchar_t</type> Size</title>
<para>
......@@ -131,9 +131,9 @@ mcsrtombs and wcsrtombs in particular.</para>
<para>
Thus, portable C++ code cannot assume a byte size (or endianness) either.
</para>
</sect3>
</section>
<sect3 id="codecvt.design.unicode">
<section id="codecvt.design.unicode">
<title>Support for Unicode</title>
<para>
Probably the most frequently asked question about code conversion
......@@ -236,9 +236,9 @@ mechanism may be required.
external types will need to be known.
</para></listitem>
</itemizedlist>
</sect3>
</section>
<sect3 id="codecvt.design.issues">
<section id="codecvt.design.issues">
<title>Other Issues</title>
<para>
In addition, multi-threaded and multi-locale environments also impact
......@@ -284,11 +284,11 @@ on GNU/Linux) and whatever the currently selected locale for the
LC_CTYPE category implements.
</para>
</sect3>
</section>
</sect2>
</section>
<sect2 id="facet.codecvt.impl">
<section id="facet.codecvt.impl">
<title>Implementation</title>
<para>
......@@ -432,9 +432,9 @@ external character type, encoding_state&gt; is consistent with other
codecvt usage.
</para>
</sect2>
</section>
<sect2 id="facet.codecvt.use">
<section id="facet.codecvt.use">
<title>Use</title>
<para>A conversions involving string literal.</para>
......@@ -477,9 +477,9 @@ codecvt usage.
VERIFY( ito_next == i_arr + size );
</programlisting>
</sect2>
</section>
<sect2 id="facet.codecvt.future">
<section id="facet.codecvt.future">
<title>Future</title>
<itemizedlist>
<listitem>
......@@ -532,7 +532,7 @@ codecvt usage.
</itemizedlist>
</listitem>
</itemizedlist>
</sect2>
</section>
<bibliography id="facet.codecvt.biblio">
......@@ -702,4 +702,4 @@ codecvt usage.
</bibliography>
</sect1>
</section>
<?xml version='1.0'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<chapter id="manual.ext.concurrency" xreflabel="Concurrency Extensions">
......@@ -85,7 +85,7 @@ critical sections, while retaining exception-safety.
<para>
Two functions and one type form the base of atomic support.
Two functions and one type form the base of atomic support.
</para>
......@@ -130,7 +130,7 @@ __atomic_add_dispatch
<para>
These functions forward to one of several specialized helper
functions, depending on the circumstances. For instance,
functions, depending on the circumstances. For instance,
</para>
<para>
......@@ -152,7 +152,7 @@ sequence.
</para>
</listitem>
<listitem><para><code>__exchange_and_add_single</code>
<listitem><para><code>__exchange_and_add_single</code>
</para>
<para>Single threaded version. Inlined.</para>
</listitem>
......@@ -173,12 +173,12 @@ In addition, there are two macros
<para>
<code>
_GLIBCXX_READ_MEM_BARRIER
_GLIBCXX_READ_MEM_BARRIER
</code>
</para>
<para>
<code>
_GLIBCXX_WRITE_MEM_BARRIER
_GLIBCXX_WRITE_MEM_BARRIER
</code>
</para>
......@@ -195,7 +195,7 @@ host hardware and operating system.
<title>Implementation</title>
<sect2 id="manual.ext.concurrency.impl.atomic_fallbacks" xreflabel="Atomic F">
<title>Using Builtin Atomic Functions</title>
<para>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is
capable) or by library fallbacks.</para>
......@@ -214,7 +214,7 @@ usage vary depending on the target hardware and the flags used during
compile.
</para>
<para>
<para>
If builtins are possible for bool-sized integral types,
<code>_GLIBCXX_ATOMIC_BUILTINS_1</code> will be defined.
If builtins are possible for int-sized integral types,
......@@ -285,7 +285,7 @@ including <code>pthread_t</code>, <code>pthread_once_t</code>, <code>pthread_cre
etc.
</para>
</sect2>
</sect2>
</sect1>
<sect1 id="manual.ext.concurrency.use" xreflabel="Use">
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.containers" xreflabel="Containers">
<chapter id="std.containers" xreflabel="Containers">
<?dbhtml filename="containers.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,22 +15,22 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Containers
<indexterm><primary>Containers</primary></indexterm>
</title>
<!-- Chapter 01 : Sequences -->
<chapter id="manual.containers.sequences" xreflabel="Sequences">
<!-- Sect1 01 : Sequences -->
<sect1 id="std.containers.sequences" xreflabel="Sequences">
<?dbhtml filename="sequences.html"?>
<title>Sequences</title>
<sect1 id="containers.sequences.list" xreflabel="list">
<sect2 id="containers.sequences.list" xreflabel="list">
<?dbhtml filename="list.html"?>
<title>list</title>
<sect2 id="sequences.list.size" xreflabel="list::size() is O(n)">
<sect3 id="sequences.list.size" xreflabel="list::size() is O(n)">
<title>list::size() is O(n)</title>
<para>
Yes it is, and that's okay. This is a decision that we preserved
......@@ -64,29 +64,29 @@
<para>
One implication of linear time size(): you should never write
</para>
<programlisting>
if (L.size() == 0)
...
<programlisting>
if (L.size() == 0)
...
</programlisting>
<para>
Instead, you should write
Instead, you should write
</para>
<programlisting>
if (L.empty())
...
<programlisting>
if (L.empty())
...
</programlisting>
</blockquote>
</sect2>
</sect1>
</sect3>
</sect2>
<sect1 id="containers.sequences.vector" xreflabel="vector">
<sect2 id="containers.sequences.vector" xreflabel="vector">
<?dbhtml filename="vector.html"?>
<title>vector</title>
<para>
</para>
<sect2 id="sequences.vector.management" xreflabel="Space Overhead Management">
<sect3 id="sequences.vector.management" xreflabel="Space Overhead Management">
<title>Space Overhead Management</title>
<para>
In <ulink
......@@ -103,15 +103,15 @@
url="http://gcc.gnu.org/ml/libstdc++/2002-07/msg00111.html">here</ulink>.
</para>
</sect2></sect1>
</chapter>
</sect3></sect2>
</sect1>
<!-- Chapter 02 : Associative -->
<chapter id="manual.containers.associative" xreflabel="Associative">
<!-- Sect1 02 : Associative -->
<sect1 id="std.containers.associative" xreflabel="Associative">
<?dbhtml filename="associative.html"?>
<title>Associative</title>
<sect1 id="containers.associative.insert_hints" xreflabel="Insertion Hints">
<sect2 id="containers.associative.insert_hints" xreflabel="Insertion Hints">
<title>Insertion Hints</title>
<para>
Section [23.1.2], Table 69, of the C++ standard lists this
......@@ -170,7 +170,7 @@
<code>end()</code>, then the item being inserted should have
a key greater than all the other keys in the container. The
item will be inserted at the end of the container, becoming
the new entry before <code>end()</code>.
the new entry before <code>end()</code>.
</para>
</listitem>
<listitem>
......@@ -216,13 +216,13 @@
point to the correct place, then no further local searching is
done; the search begins from scratch in logarithmic time.
</para>
</sect1>
</sect2>
<sect1 id="containers.associative.bitset" xreflabel="bitset">
<sect2 id="containers.associative.bitset" xreflabel="bitset">
<?dbhtml filename="bitset.html"?>
<title>bitset</title>
<sect2 id="associative.bitset.size_variable" xreflabel="Variable">
<sect3 id="associative.bitset.size_variable" xreflabel="Variable">
<title>Size Variable</title>
<para>
No, you cannot write code of the form
......@@ -233,9 +233,9 @@
void foo (size_t n)
{
std::bitset&lt;n&gt; bits;
....
}
std::bitset&lt;n&gt; bits;
....
}
</programlisting>
<para>
because <code>n</code> must be known at compile time. Your
......@@ -245,12 +245,12 @@
<para>
There are a couple of ways to handle this kind of thing. Please
consider all of them before passing judgement. They include, in
no particular order:
no chaptericular order:
</para>
<itemizedlist>
<listitem><para>A very large N in <code>bitset&lt;N&gt;</code>.</para></listitem>
<listitem><para>A container&lt;bool&gt;.</para></listitem>
<listitem><para>Extremely weird solutions.</para></listitem>
<listitem><para>A very large N in <code>bitset&lt;N&gt;</code>.</para></listitem>
<listitem><para>A container&lt;bool&gt;.</para></listitem>
<listitem><para>Extremely weird solutions.</para></listitem>
</itemizedlist>
<para>
<emphasis>A very large N in
......@@ -329,8 +329,8 @@
<link linkend="manual.ext.containers.sgi">some extensions</link>.
</para>
</sect2>
<sect2 id="associative.bitset.type_string" xreflabel="Type String">
</sect3>
<sect3 id="associative.bitset.type_string" xreflabel="Type String">
<title>Type String</title>
<para>
</para>
......@@ -349,7 +349,7 @@
<programlisting>
std::bitset&lt;5&gt; b ( std::string(<quote>10110</quote>) );
</programlisting>
<para>
instead of
</para>
......@@ -357,17 +357,17 @@
<programlisting>
std::bitset&lt;5&gt; b ( <quote>10110</quote> ); // invalid
</programlisting>
</sect2>
</sect1>
</sect3>
</sect2>
</chapter>
</sect1>
<!-- Chapter 03 : Interacting with C -->
<chapter id="manual.containers.c" xreflabel="Interacting with C">
<!-- Sect1 03 : Interacting with C -->
<sect1 id="std.containers.c" xreflabel="Interacting with C">
<?dbhtml filename="containers_and_c.html"?>
<title>Interacting with C</title>
<sect1 id="containers.c.vs_array" xreflabel="Containers vs. Arrays">
<sect2 id="containers.c.vs_array" xreflabel="Containers vs. Arrays">
<title>Containers vs. Arrays</title>
<para>
You're writing some code and can't decide whether to use builtin
......@@ -422,27 +422,27 @@ template&lt;typename T&gt;
{ return v.begin(); }
template&lt;typename T, unsigned int sz&gt;
inline T*
inline T*
beginof(T (&amp;array)[sz]) { return array; }
// endof
template&lt;typename T&gt;
inline typename vector&lt;T&gt;::iterator
inline typename vector&lt;T&gt;::iterator
endof(vector&lt;T&gt; &amp;v)
{ return v.end(); }
template&lt;typename T, unsigned int sz&gt;
inline T*
inline T*
endof(T (&amp;array)[sz]) { return array + sz; }
// lengthof
template&lt;typename T&gt;
inline typename vector&lt;T&gt;::size_type
inline typename vector&lt;T&gt;::size_type
lengthof(vector&lt;T&gt; &amp;v)
{ return v.size(); }
template&lt;typename T, unsigned int sz&gt;
inline unsigned int
inline unsigned int
lengthof(T (&amp;)[sz]) { return sz; }
</programlisting>
......@@ -459,13 +459,13 @@ template&lt;typename T, unsigned int sz&gt;
Second, the line
</para>
<programlisting>
inline unsigned int lengthof (T (&amp;)[sz]) { return sz; }
inline unsigned int lengthof (T (&amp;)[sz]) { return sz; }
</programlisting>
<para>
looks just weird! Hint: unused parameters can be left nameless.
</para>
</sect1>
</chapter>
</sect2>
</sect1>
</part>
</chapter>
<sect1 id="manual.localization.facet.ctype" xreflabel="ctype">
<section id="std.localization.facet.ctype" xreflabel="ctype">
<?dbhtml filename="ctype.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,14 +10,14 @@
ctype
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>ctype</title>
<sect2 id="facet.ctype.impl">
<section id="facet.ctype.impl">
<title>Implementation</title>
<sect3>
<section>
<title>Specializations</title>
<para>
......@@ -57,10 +57,10 @@ Neither of these two required specializations deals with Unicode
characters.
</para>
</sect3>
</sect2>
</section>
</section>
<sect2 id="facet.ctype.future">
<section id="facet.ctype.future">
<title>Future</title>
......@@ -114,7 +114,7 @@ characters.
</itemizedlist>
</sect2>
</section>
<bibliography id="facet.ctype.biblio">
......@@ -236,4 +236,4 @@ characters.
</bibliography>
</sect1>
</section>
<sect1 id="manual.intro.using.debug" xreflabel="Debugging Support">
<?dbhtml filename="debug.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -22,11 +22,11 @@
<sect2 id="debug.compiler">
<title>Using <command>g++</command></title>
<para>
<para>
Compiler flags determine how debug information is transmitted
between compilation and debug or analysis tools.
</para>
<para>
The default optimizations and debug flags for a libstdc++ build
are <code>-g -O2</code>. However, both debug and optimization
......@@ -84,7 +84,7 @@
</para>
<para>
A second approach is to use the configuration flags
A second approach is to use the configuration flags
</para>
<programlisting>
make CXXFLAGS='-g3 -fno-inline -O0' all
......@@ -95,7 +95,7 @@
debugging tasks, when you cannot or don't want to recompile your
application to use the <link linkend="manual.ext.debug_mode">debug mode</link>.</para>
</sect2>
<sect2 id="debug.memory">
<title>Memory Leak Hunting</title>
......@@ -174,8 +174,8 @@
int main()
{
extern void* __dso_handle __attribute__ ((__weak__));
__cxa_atexit((void (*) (void *)) __libc_freeres, NULL,
&amp;__dso_handle ? __dso_handle : NULL);
__cxa_atexit((void (*) (void *)) __libc_freeres, NULL,
&amp;__dso_handle ? __dso_handle : NULL);
do_test();
return 0;
}
......@@ -185,7 +185,7 @@
Suggested valgrind flags, given the suggestions above about setting
up the runtime environment, library, and test file, might be:
</para>
<programlisting>
<programlisting>
valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
</programlisting>
......@@ -193,7 +193,7 @@
<sect2 id="debug.gdb">
<title>Using <command>gdb</command></title>
<para>
<para>
</para>
<para>
......@@ -228,7 +228,7 @@
</para>
<programlisting>
svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
</programlisting>
<para>
......@@ -295,8 +295,8 @@
<sect2 id="debug.profile_mode" xreflabel="debug.profile_mode">
<title>Profile-based Performance Analysis</title>
<para> The <link linkend="manual.ext.profile_mode">Profile-based
Performance Analysis</link> Extension has performance checks for many
<para> The <link linkend="manual.ext.profile_mode">Profile-based
Performance Analysis</link> Extension has performance checks for many
algorithms.
</para>
</sect2>
......
<?xml version='1.0'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<chapter id="manual.ext.debug_mode" xreflabel="Debug Mode">
<?dbhtml filename="debug_mode.html"?>
<chapterinfo>
<keywordset>
<keyword>
......@@ -36,7 +36,7 @@
library facilities, and will report errors in the use of libstdc++
as soon as they can be detected by emitting a description of the
problem to standard error and aborting the program. This debug
mode is available with GCC 3.4.0 and later versions.
mode is available with GCC 3.4.0 and later versions.
</para>
<para>
......@@ -51,7 +51,7 @@
incrementing a past-the-end iterator or dereferencing an iterator
that points to a container that has been destructed are diagnosed
immediately.</para></listitem>
<listitem><para><emphasis>Algorithm preconditions</emphasis>: Algorithms attempt to
validate their input parameters to detect errors as early as
possible. For instance, the <code>set_intersection</code>
......@@ -81,7 +81,7 @@
instance, erasing an element in a <code>std::list</code> is a
constant-time operation in normal library, but in debug mode it is
linear in the number of iterators that reference that particular
list. So while your (correct) program won't change its results, it
list. So while your (correct) program won't change its results, it
is likely to execute more slowly.</para>
<para>libstdc++ includes many extensions to the C++ standard library. In
......@@ -375,7 +375,7 @@ containers have additional debug capability.
own usability and implementation characteristics. In general, the
higher-numbered conformance levels are more usable (i.e., require
less recompilation) but are more complicated to implement than
the lower-numbered conformance levels.
the lower-numbered conformance levels.
<orderedlist>
<listitem><para><emphasis>Full recompilation</emphasis>: The user must recompile his or
her entire application and all C++ libraries it depends on,
......@@ -486,7 +486,7 @@ containers have additional debug capability.
<listitem><para><code>Iterator</code>: The underlying iterator type, which must
be either the <code>iterator</code> or <code>const_iterator</code>
typedef from the sequence type this iterator can reference.</para></listitem>
<listitem><para><code>Sequence</code>: The type of sequence that this iterator
references. This sequence must be a safe sequence (discussed below)
whose <code>iterator</code> or <code>const_iterator</code> typedef
......@@ -511,7 +511,7 @@ containers have additional debug capability.
instantiated with the type of the safe container itself (an instance
of the curiously recurring template pattern).</para>
<para>The iterators of a container wrapper will be
<para>The iterators of a container wrapper will be
<link linkend="debug_mode.design.methods.safe_iter">safe
iterators</link> that reference sequences of this type and wrap the
iterators provided by the release-mode base class. The debugging
......@@ -627,7 +627,7 @@ namespace std
};
} // namespace std
</programlisting>
<para>In debug mode we include the release-mode container (which is now
defined in the namespace <code>__norm</code>) and also the
debug-mode container. The debug-mode container is defined within the
......@@ -646,7 +646,7 @@ namespace std
template&lt;typename _Tp, typename _Alloc = allocator&lt;_Tp&gt; &gt;
class list
{
// ...
// ...
};
} // namespace __gnu_norm
......@@ -655,9 +655,9 @@ namespace std
template&lt;typename _Tp, typename _Alloc = allocator&lt;_Tp&gt; &gt;
class list
: public __norm::list&lt;_Tp, _Alloc&gt;,
public __gnu_debug::_Safe_sequence&lt;list&lt;_Tp, _Alloc&gt; &gt;
public __gnu_debug::_Safe_sequence&lt;list&lt;_Tp, _Alloc&gt; &gt;
{
// ...
// ...
};
} // namespace __norm
......@@ -694,12 +694,12 @@ runtime errors. A simplified example of this problem is as follows.
#include &lt;string&gt;
std::string test02();
std::string test01()
{
return test02();
}
int main()
{
test01();
......@@ -711,7 +711,7 @@ int main()
<programlisting>
#include &lt;string&gt;
std::string
test02()
{
......@@ -831,7 +831,7 @@ test02()
include ordering. Two, ODR issues remained with container member
functions taking no arguments in mixed-mode settings resulting in
equivalent link names, <code> vector::push_back() </code> being
one example.
one example.
See <ulink url="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00177.html">link
name</ulink> </para></listitem>
</itemizedlist>
......@@ -850,7 +850,7 @@ test02()
mode implementations.</para>
</sect4>
</sect3>
</sect2>
</sect2>
<sect2 id="debug_mode.design.other" xreflabel="Other">
<title>Other Implementations</title>
......@@ -885,7 +885,7 @@ test02()
guarantee.</para></listitem>
</itemizedlist>
</sect2>
</sect2>
</sect1>
</chapter>
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.diagnostics" xreflabel="Diagnostics">
<chapter id="std.diagnostics" xreflabel="Diagnostics">
<?dbhtml filename="diagnostics.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,18 +15,18 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Diagnostics
<indexterm><primary>Diagnostics</primary></indexterm>
</title>
<chapter id="manual.diagnostics.exceptions" xreflabel="Exceptions">
<sect1 id="std.diagnostics.exceptions" xreflabel="Exceptions">
<?dbhtml filename="exceptions.html"?>
<title>Exceptions</title>
<sect1 id="manual.diagnostics.exceptions.hierarchy" xreflabel="Exception Classes">
<sect2 id="std.diagnostics.exceptions.hierarchy" xreflabel="Exception Classes">
<title>Exception Classes</title>
<para>
All exception objects are defined in one of the standard header
......@@ -47,8 +47,8 @@
found in the <ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00460.html">source documentation</ulink>.
</para>
</sect1>
<sect1 id="manual.diagnostics.exceptions.data" xreflabel="Adding Data to Exceptions">
</sect2>
<sect2 id="std.diagnostics.exceptions.data" xreflabel="Adding Data to Exceptions">
<title>Adding Data to Exceptions</title>
<para>
The standard exception classes carry with them a single string as
......@@ -61,7 +61,7 @@
{
public:
My_Exception (const string&amp; whatarg)
: std::runtime_error(whatarg), e(errno), id(GetDataBaseID()) { }
: std::runtime_error(whatarg), e(errno), id(GetDataBaseID()) { }
int errno_at_time_of_throw() const { return e; }
DBID id_of_thing_that_threw() const { return id; }
protected:
......@@ -70,10 +70,10 @@
};
</programlisting>
</sect1>
</chapter>
</sect2>
</sect1>
<chapter id="manual.diagnostics.concept_checking" xreflabel="Concept Checking">
<sect1 id="std.diagnostics.concept_checking" xreflabel="Concept Checking">
<title>Concept Checking</title>
<para>
In 1999, SGI added <quote>concept checkers</quote> to their
......@@ -112,7 +112,7 @@
You can enable them on a per-translation-unit basis with
<literal>-D_GLIBCXX_CONCEPT_CHECKS</literal>.
</para>
<para>
Please note that the upcoming C++ standard has first-class
support for template parameter constraints based on concepts in the core
......@@ -120,6 +120,6 @@
checking described above.
</para>
</chapter>
</sect1>
</part>
</chapter>
<sect1 id="appendix.porting.api" xreflabel="api">
<?dbhtml filename="api.html"?>
<sect1info>
<keywordset>
<keyword>ISO C++</keyword>
......@@ -80,10 +80,10 @@ Removal of <filename class="headerfile">ext/tree</filename>, moved to <filename
<para> For GCC releases from 2.95 through the 3.1 series, defining
<literal>__USE_MALLOC</literal> on the gcc command line would change the
default allocation strategy to instead use <code> malloc</code> and
<function>free</function>. (This same functionality is now spelled <literal>_GLIBCXX_FORCE_NEW</literal>, see
<link linkend="manual.intro.using.macros">this page</link>
<function>free</function>. (This same functionality is now spelled <literal>_GLIBCXX_FORCE_NEW</literal>, see
<link linkend="manual.intro.using.macros">this page</link>
for details.
</para>
</para>
<para>Error handling in iostreams cleaned up, made consistent. </para>
......@@ -431,7 +431,7 @@ Parallel mode first appears.
</para>
<para>Variadic template implementations of items in <filename class="headerfile">tuple</filename> and
<filename class="headerfile">functional</filename>.
<filename class="headerfile">functional</filename>.
</para>
<para>Default <code>what</code> implementations give more elaborate
......@@ -441,7 +441,7 @@ Parallel mode first appears.
</para>
<para>
PCH binary files no longer installed. Instead, the source files are installed.
PCH binary files no longer installed. Instead, the source files are installed.
</para>
<para>
......@@ -604,7 +604,7 @@ Profile mode first appears.
</para>
<para>
Support for decimal floating-point arithmetic, including <classname>decimal32</classname>, <classname>decimal64</classname>, and <classname>decimal128</classname>.
Support for decimal floating-point arithmetic, including <classname>decimal32</classname>, <classname>decimal64</classname>, and <classname>decimal128</classname>.
</para>
<para>
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.ext" xreflabel="Extensions">
<?dbhtml filename="extensions.html"?>
<partinfo>
<keywordset>
<keyword>
......@@ -35,7 +35,7 @@ extensions, be aware of two things:
<orderedlist>
<listitem>
<para>
Non-Standard means exactly that.
Non-Standard means exactly that.
</para>
<para>
The behavior, and the very
......@@ -43,12 +43,12 @@ extensions, be aware of two things:
warning. (Ideally, the really good ones will appear in the next
revision of C++.) Also, other platforms, other compilers, other
versions of g++ or libstdc++ may not recognize these names, or
treat them differently, or...
treat them differently, or...
</para>
</listitem>
<listitem>
<para>
You should know how to access these headers properly.
You should know how to access these headers properly.
</para>
</listitem>
</orderedlist>
......@@ -104,17 +104,17 @@ extensions, be aware of two things:
</chapter>
<!-- Chapter 02 : Debug Mode -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="debug_mode.xml">
</xi:include>
<!-- Chapter 03 : Parallel Mode -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="parallel_mode.xml">
</xi:include>
<!-- Chapter 04 : Profile Mode -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="profile_mode.xml">
</xi:include>
......@@ -125,12 +125,12 @@ extensions, be aware of two things:
<title>Allocators</title>
<!-- Section 01 : __mt_alloc -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="mt_allocator.xml">
</xi:include>
<!-- Section 02 : bitmap_allocator -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="bitmap_allocator.xml">
</xi:include>
......@@ -186,7 +186,7 @@ extensions, be aware of two things:
no present plans to do so (and there doesn't seem to be any immediate
reason to).
</para>
<para>The semantics of member function <code>operator[]</code> are not specified
<para>The semantics of member function <code>operator[]</code> are not specified
in the C++ standard. A long-standing defect report calls for sensible
obvious semantics, which are already implemented here: <code>op[]</code>
on a const bitset returns a bool, and for a non-const bitset returns a
......@@ -269,7 +269,7 @@ extensions, be aware of two things:
</para>
</blockquote>
</sect1>
</sect1>
</chapter>
<!-- Chapter 07 : Utilities -->
......@@ -283,22 +283,22 @@ extensions, be aware of two things:
</para>
<itemizedlist>
<listitem>
<para><code>identity_element</code> for addition and multiplication. *
<para><code>identity_element</code> for addition and multiplication. *
</para>
</listitem>
<listitem>
<para>The functor <code>identity</code>, whose <code>operator()</code>
returns the argument unchanged. *
returns the argument unchanged. *
</para>
</listitem>
<listitem>
<para>Composition functors <code>unary_function</code> and
<code>binary_function</code>, and their helpers <code>compose1</code>
and <code>compose2</code>. *
and <code>compose2</code>. *
</para>
</listitem>
<listitem>
<para><code>select1st</code> and <code>select2nd</code>, to strip pairs. *
<para><code>select1st</code> and <code>select2nd</code>, to strip pairs. *
</para>
</listitem>
<listitem><para><code>project1st</code> and <code>project2nd</code>. * </para></listitem>
......@@ -368,13 +368,13 @@ get_temporary_buffer(5, (int*)0);
<itemizedlist>
<listitem><para><code>is_heap</code> tests whether or not a range is a heap.</para></listitem>
<listitem><para><code>is_sorted</code> tests whether or not a range is sorted in
nondescending order.</para></listitem>
nondescending order.</para></listitem>
</itemizedlist>
<para>25.3.8 (lexicographical_compare) is extended with
</para>
<programlisting>
lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,
_InputIter2 first2, _InputIter2 last2)</programlisting>
_InputIter2 first2, _InputIter2 last2)</programlisting>
<para>which does... what?
</para>
......@@ -451,41 +451,41 @@ get_temporary_buffer(5, (int*)0);
</para>
<itemizedlist>
<listitem><para>3.0.x <code>filebuf</code>s have another ctor with this signature:
<code>basic_filebuf(__c_file_type*, ios_base::openmode, int_type);
<code>basic_filebuf(__c_file_type*, ios_base::openmode, int_type);
</code>
This comes in very handy in a number of places, such as
attaching Unix sockets, pipes, and anything else which uses file
descriptors, into the IOStream buffering classes. The three
arguments are as follows:
<itemizedlist>
<listitem><para><code>__c_file_type* F </code>
// the __c_file_type typedef usually boils down to stdio's FILE
</para></listitem>
<listitem><para><code>ios_base::openmode M </code>
// same as all the other uses of openmode
</para></listitem>
<listitem><para><code>int_type B </code>
// buffer size, defaults to BUFSIZ if not specified
</para></listitem>
</itemizedlist>
For those wanting to use file descriptors instead of FILE*'s, I
invite you to contemplate the mysteries of C's <code>fdopen()</code>.
This comes in very handy in a number of places, such as
attaching Unix sockets, pipes, and anything else which uses file
descriptors, into the IOStream buffering classes. The three
arguments are as follows:
<itemizedlist>
<listitem><para><code>__c_file_type* F </code>
// the __c_file_type typedef usually boils down to stdio's FILE
</para></listitem>
<listitem><para><code>ios_base::openmode M </code>
// same as all the other uses of openmode
</para></listitem>
<listitem><para><code>int_type B </code>
// buffer size, defaults to BUFSIZ if not specified
</para></listitem>
</itemizedlist>
For those wanting to use file descriptors instead of FILE*'s, I
invite you to contemplate the mysteries of C's <code>fdopen()</code>.
</para></listitem>
<listitem><para>In library snapshot 3.0.95 and later, <code>filebuf</code>s bring
back an old extension: the <code>fd()</code> member function. The
integer returned from this function can be used for whatever file
descriptors can be used for on your platform. Naturally, the
library cannot track what you do on your own with a file descriptor,
so if you perform any I/O directly, don't expect the library to be
aware of it.
back an old extension: the <code>fd()</code> member function. The
integer returned from this function can be used for whatever file
descriptors can be used for on your platform. Naturally, the
library cannot track what you do on your own with a file descriptor,
so if you perform any I/O directly, don't expect the library to be
aware of it.
</para></listitem>
<listitem><para>Beginning with 3.1, the extra <code>filebuf</code> constructor and
the <code>fd()</code> function were removed from the standard
filebuf. Instead, <code>&lt;ext/stdio_filebuf.h&gt;</code> contains
a derived class called
<ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></ulink>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
the <code>fd()</code> function were removed from the standard
filebuf. Instead, <code>&lt;ext/stdio_filebuf.h&gt;</code> contains
a derived class called
<ulink url="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html"><code>__gnu_cxx::stdio_filebuf</code></ulink>.
This class can be constructed from a C <code>FILE*</code> or a file
descriptor, and provides the <code>fd()</code> function.
</para></listitem>
</itemizedlist>
<para>If you want to access a <code>filebuf</code>'s file descriptor to
......@@ -572,7 +572,7 @@ int main()
<screen>
<computeroutput>
St13bad_exception =&gt; std::bad_exception : 0
3barI5emptyLi17EE =&gt; bar&lt;empty, 17&gt; : 0
3barI5emptyLi17EE =&gt; bar&lt;empty, 17&gt; : 0
</computeroutput>
</screen>
......@@ -586,7 +586,7 @@ int main()
</chapter>
<!-- Chapter 13 : Concurrency -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="concurrency_extensions.xml">
</xi:include>
......
<sect1 id="appendix.porting.internals" xreflabel="Portin Internals">
<?dbhtml filename="internals.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -73,7 +73,7 @@ OS portion of the triplet (the default), then nothing needs to be changed.
<para>The first file to create in this directory, should be called
<code>os_defines.h</code>. This file contains basic macro definitions
that are required to allow the C++ library to work with your C library.
that are required to allow the C++ library to work with your C library.
</para>
<para>Several libstdc++ source files unconditionally define the macro
......@@ -140,7 +140,7 @@ it must be 0 while bootstrapping the compiler/rebuilding the library.
this:
</para>
<programlisting>
<programlisting>
#ifndef _GLIBCXX_OS_DEFINES
#define _GLIBCXX_OS_DEFINES
......@@ -207,7 +207,7 @@ masks. You will have to peer at your own <code>&lt;ctype.h&gt;</code> to figure
how to define the values required by this file.
</para>
<para>The <code>ctype_base.h</code> header file does not need include guards.
<para>The <code>ctype_base.h</code> header file does not need include guards.
It should contain a single <code>struct</code> definition called
<code>ctype_base</code>. This <code>struct</code> should contain two type
declarations, and one enumeration declaration, like this example, taken
......@@ -219,20 +219,20 @@ from the IRIX configuration:
{
typedef unsigned int mask;
typedef int* __to_type;
enum
{
space = _ISspace,
print = _ISprint,
cntrl = _IScntrl,
upper = _ISupper,
lower = _ISlower,
alpha = _ISalpha,
digit = _ISdigit,
punct = _ISpunct,
xdigit = _ISxdigit,
alnum = _ISalnum,
graph = _ISgraph
space = _ISspace,
print = _ISprint,
cntrl = _IScntrl,
upper = _ISupper,
lower = _ISlower,
alpha = _ISalpha,
digit = _ISdigit,
punct = _ISpunct,
xdigit = _ISxdigit,
alnum = _ISalnum,
graph = _ISgraph
};
};
</programlisting>
......@@ -262,14 +262,14 @@ constructor. Here is the IRIX example:
<programlisting>
ctype&lt;char&gt;::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0)
size_t __refs = 0)
: _Ctype_nois&lt;char&gt;(__refs), _M_del(__table != 0 &amp;&amp; __del),
_M_toupper(NULL),
_M_tolower(NULL),
_M_ctable(NULL),
_M_table(!__table
? (const mask*) (__libc_attr._ctype_tbl-&gt;_class + 1)
: __table)
_M_toupper(NULL),
_M_tolower(NULL),
_M_ctable(NULL),
_M_table(!__table
? (const mask*) (__libc_attr._ctype_tbl-&gt;_class + 1)
: __table)
{ }
</programlisting>
......@@ -291,7 +291,7 @@ lower-case, and vice versa. Here are the IRIX versions:
char
ctype&lt;char&gt;::do_toupper(char __c) const
{ return _toupper(__c); }
char
ctype&lt;char&gt;::do_tolower(char __c) const
{ return _tolower(__c); }
......@@ -313,21 +313,21 @@ machinery to do that on your system:
ctype&lt;char&gt;::do_toupper(char* __low, const char* __high) const
{
while (__low &lt; __high)
{
*__low = do_toupper(*__low);
++__low;
}
{
*__low = do_toupper(*__low);
++__low;
}
return __high;
}
const char*
ctype&lt;char&gt;::do_tolower(char* __low, const char* __high) const
{
while (__low &lt; __high)
{
*__low = do_tolower(*__low);
++__low;
}
{
*__low = do_tolower(*__low);
++__low;
}
return __high;
}
</programlisting>
......@@ -352,7 +352,7 @@ properties; they are analogous to the functions like <code>isalpha</code> and
{ return (_M_table)[(unsigned char)(__c)] &amp; __m; }
</programlisting>
<para>The <code>_M_table</code> is the table passed in above, in the constructor.
<para>The <code>_M_table</code> is the table passed in above, in the constructor.
This is the table that contains the bitmasks for each character. The
implementation here should work on all systems.
</para>
......@@ -366,7 +366,7 @@ implementation here should work on all systems.
is(const char* __low, const char* __high, mask* __vec) const throw()
{
while (__low &lt; __high)
*__vec++ = (_M_table)[(unsigned char)(*__low++)];
*__vec++ = (_M_table)[(unsigned char)(*__low++)];
return __high;
}
</programlisting>
......@@ -385,16 +385,16 @@ from <code>__low</code> up until <code>__high</code> into the vector given by
scan_is(mask __m, const char* __low, const char* __high) const throw()
{
while (__low &lt; __high &amp;&amp; !this-&gt;is(__m, *__low))
++__low;
++__low;
return __low;
}
const char*
ctype&lt;char&gt;::
scan_not(mask __m, const char* __low, const char* __high) const throw()
{
while (__low &lt; __high &amp;&amp; this-&gt;is(__m, *__low))
++__low;
++__low;
return __low;
}
</programlisting>
......@@ -454,7 +454,7 @@ type, and two functions.
typedef long _Atomic_word;
</programlisting>
<para>This type must be a signed integral type supporting atomic operations.
<para>This type must be a signed integral type supporting atomic operations.
If you're using the OS approach, use the same type used by your system's
primitives. Otherwise, use the type for which your CPU provides atomic
primitives.
......@@ -473,7 +473,7 @@ must be equivalent to those provided here, but using atomic operations:
*__mem += __val;
return __result;
}
static inline void
__attribute__ ((__unused__))
__atomic_add (_Atomic_word* __mem, int __val)
......@@ -489,17 +489,17 @@ must be equivalent to those provided here, but using atomic operations:
<title>Numeric Limits</title>
<para>The C++ library requires information about the fundamental data types,
such as the minimum and maximum representable values of each type.
such as the minimum and maximum representable values of each type.
You can define each of these values individually, but it is usually
easiest just to indicate how many bits are used in each of the data
types and let the library do the rest. For information about the
macros to define, see the top of <code>include/bits/std_limits.h</code>.
</para>
<para>If you need to define any macros, you can do so in <code>os_defines.h</code>.
<para>If you need to define any macros, you can do so in <code>os_defines.h</code>.
However, if all operating systems for your CPU are likely to use the
same values, you can provide a CPU-specific file instead so that you
do not have to provide the same definitions for each operating system.
do not have to provide the same definitions for each operating system.
To take that approach, create a new file called <code>cpu_limits.h</code> in
your CPU configuration directory (see <link linkend="internals.cpu">CPU</link>).
</para>
......@@ -510,7 +510,7 @@ your CPU configuration directory (see <link linkend="internals.cpu">CPU</link>).
<sect2 id="internals.libtool">
<title>Libtool</title>
<para>The C++ library is compiled, archived and linked with libtool.
<para>The C++ library is compiled, archived and linked with libtool.
Explaining the full workings of libtool is beyond the scope of this
document, but there are a few, particular bits that are necessary for
porting.
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.iterators" xreflabel="Iterators">
<chapter id="std.iterators" xreflabel="Iterators">
<?dbhtml filename="iterators.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,18 +15,18 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Iterators
<indexterm><primary>Iterators</primary></indexterm>
</title>
<!-- Chapter 01 : Predefined -->
<chapter id="manual.iterators.predefined" xreflabel="Predefined">
<!-- Sect1 01 : Predefined -->
<sect1 id="std.iterators.predefined" xreflabel="Predefined">
<title>Predefined</title>
<sect1 id="iterators.predefined.vs_pointers" xreflabel="Versus Pointers">
<sect2 id="iterators.predefined.vs_pointers" xreflabel="Versus Pointers">
<title>Iterators vs. Pointers</title>
<para>
The following
......@@ -35,39 +35,45 @@ iterators are not implemented as pointers. They are a generalization
of pointers, but they are implemented in libstdc++ as separate
classes.
</para>
<para>Keeping that simple fact in mind as you design your code will
<para>
Keeping that simple fact in mind as you design your code will
prevent a whole lot of difficult-to-understand bugs.
</para>
<para>You can think of it the other way 'round, even. Since iterators
are a generalization, that means that <emphasis>pointers</emphasis> are
<emphasis>iterators</emphasis>, and that pointers can be used whenever an
iterator would be. All those functions in the Algorithms chapter
of the Standard will work just as well on plain arrays and their
pointers.
</para>
<para>That doesn't mean that when you pass in a pointer, it gets wrapped
into some special delegating iterator-to-pointer class with a layer
of overhead. (If you think that's the case anywhere, you don't
understand templates to begin with...) Oh, no; if you pass
in a pointer, then the compiler will instantiate that template
using T* as a type, and good old high-speed pointer arithmetic as
its operations, so the resulting code will be doing exactly the same
things as it would be doing if you had hand-coded it yourself (for
the 273rd time).
</para>
<para>How much overhead <emphasis>is</emphasis> there when using an iterator class?
Very little. Most of the layering classes contain nothing but
typedefs, and typedefs are &quot;meta-information&quot; that simply
tell the compiler some nicknames; they don't create code. That
information gets passed down through inheritance, so while the
compiler has to do work looking up all the names, your runtime code
does not. (This has been a prime concern from the beginning.)
</para>
<para>
You can think of it the other way 'round, even. Since iterators
are a generalization, that means
that <emphasis>pointers</emphasis> are
<emphasis>iterators</emphasis>, and that pointers can be used
whenever an iterator would be. All those functions in the
Algorithms sect1 of the Standard will work just as well on plain
arrays and their pointers.
</para>
<para>
That doesn't mean that when you pass in a pointer, it gets
wrapped into some special delegating iterator-to-pointer class
with a layer of overhead. (If you think that's the case
anywhere, you don't understand templates to begin with...) Oh,
no; if you pass in a pointer, then the compiler will instantiate
that template using T* as a type, and good old high-speed
pointer arithmetic as its operations, so the resulting code will
be doing exactly the same things as it would be doing if you had
hand-coded it yourself (for the 273rd time).
</para>
<para>
How much overhead <emphasis>is</emphasis> there when using an
iterator class? Very little. Most of the layering classes
contain nothing but typedefs, and typedefs are
&quot;meta-information&quot; that simply tell the compiler some
nicknames; they don't create code. That information gets passed
down through inheritance, so while the compiler has to do work
looking up all the names, your runtime code does not. (This has
been a prime concern from the beginning.)
</para>
</sect1>
</sect2>
<sect1 id="iterators.predefined.end" xreflabel="end() Is One Past the End">
<sect2 id="iterators.predefined.end" xreflabel="end() Is One Past the End">
<title>One Past the End</title>
<para>This starts off sounding complicated, but is actually very easy,
......@@ -85,23 +91,23 @@ classes.
<orderedlist>
<listitem>
<para>You can point anywhere in the array, <emphasis>or to the first element
past the end of the array</emphasis>. A pointer that points to one
past the end of the array is guaranteed to be as unique as a
pointer to somewhere inside the array, so that you can compare
such pointers safely.
past the end of the array</emphasis>. A pointer that points to one
past the end of the array is guaranteed to be as unique as a
pointer to somewhere inside the array, so that you can compare
such pointers safely.
</para>
</listitem>
<listitem>
<para>You can only dereference a pointer that points into an array.
If your array pointer points outside the array -- even to just
one past the end -- and you dereference it, Bad Things happen.
If your array pointer points outside the array -- even to just
one past the end -- and you dereference it, Bad Things happen.
</para>
</listitem>
<listitem>
<para>Strictly speaking, simply pointing anywhere else invokes
undefined behavior. Most programs won't puke until such a
pointer is actually dereferenced, but the standards leave that
up to the platform.
undefined behavior. Most programs won't puke until such a
pointer is actually dereferenced, but the standards leave that
up to the platform.
</para>
</listitem>
</orderedlist>
......@@ -121,7 +127,7 @@ classes.
| | remember to add or subtract one.
| | Off-by-one bugs very common here.
V V
array of N elements
array of N elements
|---|---|--...--|---|---|
| 0 | 1 | ... |N-2|N-1|
|---|---|--...--|---|---|
......@@ -134,7 +140,7 @@ classes.
beginning end
</programlisting>
<para>See? Everything between the boundary markers is part of the array.
<para>See? Everything between the boundary markers is chapter of the array.
Simple.
</para>
<para>Now think back to your junior-high school algebra course, when you
......@@ -175,9 +181,9 @@ classes.
<para>Just don't dereference <code>end()</code>.
</para>
</sect1>
</chapter>
</sect2>
</sect1>
<!-- Chapter 02 : Stream -->
<!-- Sect1 02 : Stream -->
</part>
</chapter>
<sect1 id="manual.localization.locales.locale" xreflabel="Locale">
<section id="std.localization.locales.locale" xreflabel="Locale">
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -9,7 +9,7 @@
locale
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>locale</title>
......@@ -19,7 +19,7 @@ classes id, facet, and the reference-counted implementation object,
class _Impl.
</para>
<sect2 id="locales.locale.req">
<section id="locales.locale.req">
<title>Requirements</title>
<para>
......@@ -87,9 +87,9 @@ class id
<para>
Provides an index for looking up specific facets.
</para>
</sect2>
</section>
<sect2 id="locales.locale.design">
<section id="locales.locale.design">
<title>Design</title>
<para>
......@@ -103,12 +103,12 @@ Because C and earlier versions of POSIX fall down so completely,
portability is an issue.
</para>
</sect2>
</section>
<sect2 id="locales.locale.impl">
<section id="locales.locale.impl">
<title>Implementation</title>
<sect3 id="locale.impl.c">
<section id="locale.impl.c">
<title>Interacting with &quot;C&quot; locales</title>
<itemizedlist>
......@@ -467,10 +467,10 @@ global locale" (emphasis Paolo), that is:
practice, the set of LC_ALL, LANG, etc. variable of the shell.
</para>
</sect3>
</sect2>
</section>
</section>
<sect2 id="locales.locale.future">
<section id="locales.locale.future">
<title>Future</title>
<itemizedlist>
......@@ -508,7 +508,7 @@ global locale" (emphasis Paolo), that is:
</para>
</listitem>
</itemizedlist>
</sect2>
</section>
<bibliography id="locales.locale.biblio">
<title>Bibliography</title>
......@@ -634,4 +634,4 @@ global locale" (emphasis Paolo), that is:
</bibliography>
</sect1>
</section>
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.localization" xreflabel="Localization">
<chapter id="std.localization" xreflabel="Localization">
<?dbhtml filename="localization.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,45 +15,45 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Localization
<indexterm><primary>Localization</primary></indexterm>
</title>
<!-- Chapter 01 : Locale -->
<chapter id="manual.localization.locales" xreflabel="Locales">
<!-- Section 01 : Locale -->
<section id="std.localization.locales" xreflabel="Locales">
<?dbhtml filename="locales.html"?>
<title>Locales</title>
<!-- Section 01 : locale -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="locale.xml">
</xi:include>
</chapter>
</section>
<!-- Chapter 02 : Facet -->
<chapter id="manual.localization.facet" xreflabel="Facets">
<!-- Section 02 : Facet -->
<section id="std.localization.facet" xreflabel="Facets">
<?dbhtml filename="facets.html"?>
<title>Facets aka Categories</title>
<title>Facets</title>
<!-- Section 01 : ctype -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="ctype.xml">
</xi:include>
<!-- Section 02 : codecvt -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="codecvt.xml">
</xi:include>
<!-- Section 03 : messages -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="messages.xml">
</xi:include>
</chapter>
</section>
<!-- Chapter 03 : Interacting with C -->
<!-- Section 03 : Interacting with C -->
</part>
</chapter>
<sect1 id="manual.localization.facet.messages" xreflabel="Messages">
<section id="manual.localization.facet.messages" xreflabel="Messages">
<?dbhtml filename="messages.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,7 +10,7 @@
messages
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>messages</title>
......@@ -20,7 +20,7 @@ equivalent to Java's java.text.MessageFormat .using either GNU gettext
or IEEE 1003.1-200 functions.
</para>
<sect2 id="facet.messages.req">
<section id="facet.messages.req">
<title>Requirements</title>
<para>
......@@ -106,9 +106,9 @@ be found, returns dfault.
</blockquote>
</sect2>
</section>
<sect2 id="facet.messages.design">
<section id="facet.messages.design">
<title>Design</title>
<para>
......@@ -155,12 +155,12 @@ to be written in English, so translations are always from "en_US" to
other, explicitly named locales.
</para>
</sect2>
</section>
<sect2 id="facet.messages.impl">
<section id="facet.messages.impl">
<title>Implementation</title>
<sect3 id="messages.impl.models">
<section id="messages.impl.models">
<title>Models</title>
<para>
This is a relatively simple class, on the face of it. The standard
......@@ -226,9 +226,9 @@ message catalog. This simplifies calling conventions for the gnu
model.
</para>
</sect3>
</section>
<sect3 id="messages.impl.gnu">
<section id="messages.impl.gnu">
<title>The GNU Model</title>
<para>
......@@ -318,10 +318,10 @@ model.
</listitem>
</itemizedlist>
</sect3>
</sect2>
</section>
</section>
<sect2 id="facet.messages.use">
<section id="facet.messages.use">
<title>Use</title>
<para>
A simple example using the GNU model of message conversion.
......@@ -349,9 +349,9 @@ void test01()
}
</programlisting>
</sect2>
</section>
<sect2 id="facet.messages.future">
<section id="facet.messages.future">
<title>Future</title>
<itemizedlist>
......@@ -436,7 +436,7 @@ void test01()
</listitem>
</itemizedlist>
</sect2>
</section>
<bibliography id="facet.messages.biblio">
<title>Bibliography</title>
......@@ -585,4 +585,4 @@ Library and Tools.
</bibliography>
</sect1>
</section>
<sect1 id="manual.ext.allocator.mt" xreflabel="mt allocator">
<?dbhtml filename="mt_allocator.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -20,7 +20,7 @@
<sect2 id="allocator.mt.intro">
<title>Intro</title>
<para>
<para>
The mt allocator [hereinafter referred to simply as "the allocator"]
is a fixed size (power of two) allocator that was initially
developed specifically to suit the needs of multi threaded
......@@ -57,7 +57,7 @@ individual pools, and a class inheriting from the policy class that is
the actual allocator.
</para>
<para>The datum describing pools characteristics is
<para>The datum describing pools characteristics is
</para>
<programlisting>
template&lt;bool _Thread&gt;
......@@ -151,9 +151,9 @@ int main()
tune_type t_single(16, 5120, 32, 5120, 1, 10, false);
tune_type t;
t = allocator_type::_M_get_options();
t = allocator_type::_M_get_options();
allocator_type::_M_set_options(t_opt);
t = allocator_type::_M_get_options();
t = allocator_type::_M_get_options();
allocator_type a;
allocator_type::pointer p1 = a.allocate(128);
......@@ -193,18 +193,18 @@ The _S_initialize() function:
</para>
<para>
- If the GLIBCXX_FORCE_NEW environment variable is not set, both ST and MT
- If the GLIBCXX_FORCE_NEW environment variable is not set, both ST and MT
applications will:
- Calculate the number of bins needed. A bin is a specific power of two size
of bytes. I.e., by default the allocator will deal with requests of up to
128 bytes (or whatever the value of _S_max_bytes is when _S_init() is
called). This means that there will be bins of the following sizes
(in bytes): 1, 2, 4, 8, 16, 32, 64, 128.
- Create the _S_binmap array. All requests are rounded up to the next
"large enough" bin. I.e., a request for 29 bytes will cause a block from
the "32 byte bin" to be returned to the application. The purpose of
_S_binmap is to speed up the process of finding out which bin to use.
of bytes. I.e., by default the allocator will deal with requests of up to
128 bytes (or whatever the value of _S_max_bytes is when _S_init() is
called). This means that there will be bins of the following sizes
(in bytes): 1, 2, 4, 8, 16, 32, 64, 128.
- Create the _S_binmap array. All requests are rounded up to the next
"large enough" bin. I.e., a request for 29 bytes will cause a block from
the "32 byte bin" to be returned to the application. The purpose of
_S_binmap is to speed up the process of finding out which bin to use.
I.e., the value of _S_binmap[ 29 ] is initialized to 5 (bin 5 = 32 bytes).
</para>
<para>
......@@ -213,37 +213,37 @@ The _S_initialize() function:
earlier. I.e., if _S_max_bytes = 128 there will be 8 entries.
Each bin_record is then initialized:
- bin_record-&gt;first = An array of pointers to block_records. There will be
as many block_records pointers as there are maximum number of threads
(in a ST application there is only 1 thread, in a MT application there
as many block_records pointers as there are maximum number of threads
(in a ST application there is only 1 thread, in a MT application there
are _S_max_threads).
This holds the pointer to the first free block for each thread in this
bin. I.e., if we would like to know where the first free block of size 32
for thread number 3 is we would look this up by: _S_bin[ 5 ].first[ 3 ]
The above created block_record pointers members are now initialized to
The above created block_record pointers members are now initialized to
their initial values. I.e. _S_bin[ n ].first[ n ] = NULL;
</para>
<para>
- Additionally a MT application will:
- Create a list of free thread id's. The pointer to the first entry
is stored in _S_thread_freelist_first. The reason for this approach is
that the __gthread_self() call will not return a value that corresponds to
is stored in _S_thread_freelist_first. The reason for this approach is
that the __gthread_self() call will not return a value that corresponds to
the maximum number of threads allowed but rather a process id number or
something else. So what we do is that we create a list of thread_records.
This list is _S_max_threads long and each entry holds a size_t thread_id
which is initialized to 1, 2, 3, 4, 5 and so on up to _S_max_threads.
Each time a thread calls allocate() or deallocate() we call
Each time a thread calls allocate() or deallocate() we call
_S_get_thread_id() which looks at the value of _S_thread_key which is a
thread local storage pointer. If this is NULL we know that this is a newly
created thread and we pop the first entry from this list and saves the
pointer to this record in the _S_thread_key variable. The next time
we will get the pointer to the thread_record back and we use the
thread_record-&gt;thread_id as identification. I.e., the first thread that
pointer to this record in the _S_thread_key variable. The next time
we will get the pointer to the thread_record back and we use the
thread_record-&gt;thread_id as identification. I.e., the first thread that
calls allocate will get the first record in this list and thus be thread
number 1 and will then find the pointer to its first free 32 byte block
in _S_bin[ 5 ].first[ 1 ]
When we create the _S_thread_key we also define a destructor
When we create the _S_thread_key we also define a destructor
(_S_thread_key_destr) which means that when the thread dies, this
thread_record is returned to the front of this list and the thread id
can then be reused if a new thread is created.
......@@ -262,7 +262,7 @@ The _S_initialize() function:
has made 678 requests (and no deallocations...) of 32-byte blocks this
counter will read 678.
The above created arrays are now initialized with their initial values.
The above created arrays are now initialized with their initial values.
I.e. _S_bin[ n ].free[ n ] = 0;
</para>
<para>
......@@ -368,7 +368,7 @@ This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
<para>
With this in mind we simplify things a bit for a while and say that there is
only one thread (a ST application). In this case all operations are made to
only one thread (a ST application). In this case all operations are made to
what is referred to as the global pool - thread id 0 (No thread may be
assigned this id since they span from 1 to _S_max_threads in a MT application).
</para>
......@@ -377,28 +377,28 @@ When the application requests memory (calling allocate()) we first look at the
requested size and if this is &gt; _S_max_bytes we call new() directly and return.
</para>
<para>
If the requested size is within limits we start by finding out from which
If the requested size is within limits we start by finding out from which
bin we should serve this request by looking in _S_binmap.
</para>
<para>
A quick look at _S_bin[ bin ].first[ 0 ] tells us if there are any blocks of
this size on the freelist (0). If this is not NULL - fine, just remove the
block that _S_bin[ bin ].first[ 0 ] points to from the list,
block that _S_bin[ bin ].first[ 0 ] points to from the list,
update _S_bin[ bin ].first[ 0 ] and return a pointer to that blocks data.
</para>
<para>
If the freelist is empty (the pointer is NULL) we must get memory from the
If the freelist is empty (the pointer is NULL) we must get memory from the
system and build us a freelist within this memory. All requests for new memory
is made in chunks of _S_chunk_size. Knowing the size of a block_record and
the bytes that this bin stores we then calculate how many blocks we can create
is made in chunks of _S_chunk_size. Knowing the size of a block_record and
the bytes that this bin stores we then calculate how many blocks we can create
within this chunk, build the list, remove the first block, update the pointer
(_S_bin[ bin ].first[ 0 ]) and return a pointer to that blocks data.
(_S_bin[ bin ].first[ 0 ]) and return a pointer to that blocks data.
</para>
<para>
Deallocation is equally simple; the pointer is casted back to a block_record
pointer, lookup which bin to use based on the size, add the block to the front
of the global freelist and update the pointer as needed
pointer, lookup which bin to use based on the size, add the block to the front
of the global freelist and update the pointer as needed
(_S_bin[ bin ].first[ 0 ]).
</para>
......@@ -414,8 +414,8 @@ faster than maintaining a set of "last pointers" as well.
<title>Multiple Thread Example</title>
<para>
In the ST example we never used the thread_id variable present in each block.
Let's start by explaining the purpose of this in a MT application.
In the ST example we never used the thread_id variable present in each block.
Let's start by explaining the purpose of this in a MT application.
</para>
<para>
......@@ -454,12 +454,12 @@ directly and return.
</para>
<para>
If the requested size is within limits we start by finding out from which
If the requested size is within limits we start by finding out from which
bin we should serve this request by looking in _S_binmap.
</para>
<para>
A call to _S_get_thread_id() returns the thread id for the calling thread
A call to _S_get_thread_id() returns the thread id for the calling thread
(and if no value has been set in _S_thread_key, a new id is assigned and
returned).
</para>
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.numerics" xreflabel="Numerics">
<chapter id="std.numerics" xreflabel="Numerics">
<?dbhtml filename="numerics.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,20 +15,20 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Numerics
<indexterm><primary>Numerics</primary></indexterm>
</title>
<!-- Chapter 01 : Complex -->
<chapter id="manual.numerics.complex" xreflabel="complex">
<!-- Sect1 01 : Complex -->
<sect1 id="std.numerics.complex" xreflabel="complex">
<?dbhtml filename="complex.html"?>
<title>Complex</title>
<para>
</para>
<sect1 id="numerics.complex.processing" xreflabel="complex Processing">
<sect2 id="numerics.complex.processing" xreflabel="complex Processing">
<title>complex Processing</title>
<para>
</para>
......@@ -49,11 +49,11 @@
<code>(u)</code>, and <code>(u,v)</code>.
</para>
</sect1>
</chapter>
</sect2>
</sect1>
<!-- Chapter 02 : Generalized Operations -->
<chapter id="manual.numerics.generalized_ops" xreflabel="Generalized Ops">
<!-- Sect1 02 : Generalized Operations -->
<sect1 id="std.numerics.generalized_ops" xreflabel="Generalized Ops">
<?dbhtml filename="generalized_numeric_operations.html"?>
<title>Generalized Operations</title>
<para>
......@@ -68,7 +68,7 @@
<itemizedlist>
<listitem><para><code>accumulate</code></para></listitem>
<listitem><para><code>inner_product</code></para></listitem>
<listitem><para><code>partial_sum</code></para></listitem>
<listitem><para><code>chapterial_sum</code></para></listitem>
<listitem><para><code>adjacent_difference</code></para></listitem>
</itemizedlist>
<para>Here is a simple example of the two forms of <code>accumulate</code>.
......@@ -93,14 +93,14 @@
<para>The other three functions have similar dual-signature forms.
</para>
</chapter>
</sect1>
<!-- Chapter 03 : Interacting with C -->
<chapter id="manual.numerics.c" xreflabel="Interacting with C">
<!-- Sect1 03 : Interacting with C -->
<sect1 id="std.numerics.c" xreflabel="Interacting with C">
<?dbhtml filename="numerics_and_c.html"?>
<title>Interacting with C</title>
<sect1 id="numerics.c.array" xreflabel="Numerics vs. Arrays">
<sect2 id="numerics.c.array" xreflabel="Numerics vs. Arrays">
<title>Numerics vs. Arrays</title>
<para>One of the major reasons why FORTRAN can chew through numbers so well
......@@ -121,9 +121,9 @@
libraries before.
</para>
</sect1>
</sect2>
<sect1 id="numerics.c.c99" xreflabel="C99">
<sect2 id="numerics.c.c99" xreflabel="C99">
<title>C99</title>
<para>In addition to the other topics on this page, we'll note here some
......@@ -143,7 +143,7 @@
<code>wcstoll</code>.
</para>
</sect1>
</chapter>
</sect2>
</sect1>
</part>
</chapter>
<?xml version='1.0'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<chapter id="manual.ext.parallel_mode" xreflabel="Parallel Mode">
<?dbhtml filename="parallel_mode.html"?>
<chapterinfo>
<keywordset>
<keyword>
......@@ -115,7 +115,7 @@ It might work with other compilers, though.</para>
flag <literal>-fopenmp</literal>. This will link
in <code>libgomp</code>, the GNU
OpenMP <ulink url="http://gcc.gnu.org/onlinedocs/libgomp">implementation</ulink>,
whose presence is mandatory.
whose presence is mandatory.
</para>
<para>
......@@ -635,7 +635,7 @@ For the following algorithms in general, we have
<code>__gnu_parallel::parallel_tag</code> and
<code>__gnu_parallel::default_parallel_tag</code>, in addition to
<code>__gnu_parallel::sequential_tag</code>.
<code>__gnu_parallel::default_parallel_tag</code> chooses the default
<code>__gnu_parallel::default_parallel_tag</code> chooses the default
algorithm at compiletime, as does omitting the tag.
<code>__gnu_parallel::parallel_tag</code> postpones the decision to runtime
(see next section).
......@@ -654,7 +654,7 @@ Exact and sampling are the two available splitting strategies.
For the <code>sort</code> and <code>stable_sort</code> algorithms, there are
several additional choices, namely
<code>__gnu_parallel::multiway_mergesort_tag</code>,
<code>__gnu_parallel::multiway_mergesort_exact_tag</code>,
<code>__gnu_parallel::multiway_mergesort_exact_tag</code>,
<code>__gnu_parallel::multiway_mergesort_sampling_tag</code>,
<code>__gnu_parallel::quicksort_tag</code>, and
<code>__gnu_parallel::balanced_quicksort_tag</code>.
......@@ -767,7 +767,7 @@ explicitly sequential:
</para>
<para> Two namespaces contain the parallel mode:
<code>std::__parallel</code> and <code>__gnu_parallel</code>.
<code>std::__parallel</code> and <code>__gnu_parallel</code>.
</para>
<para> Parallel implementations of standard components, including
......@@ -794,12 +794,12 @@ the generated source documentation.
<sect1 id="manual.ext.parallel_mode.test" xreflabel="Testing">
<title>Testing</title>
<para>
<para>
Both the normal conformance and regression tests and the
supplemental performance tests work.
</para>
<para>
<para>
To run the conformance and regression tests with the parallel mode
active,
</para>
......@@ -807,13 +807,13 @@ the generated source documentation.
<screen>
<userinput>make check-parallel</userinput>
</screen>
<para>
The log and summary files for conformance testing are in the
<filename class="directory">testsuite/parallel</filename> directory.
</para>
<para>
<para>
To run the performance tests with the parallel mode active,
</para>
......@@ -859,7 +859,7 @@ the generated source documentation.
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
</publishername>
</publisher>
</biblioentry>
</biblioentry>
<biblioentry>
<title>
......@@ -889,7 +889,7 @@ the generated source documentation.
Euro-Par 2007: Parallel Processing. (LNCS 4641)
</publishername>
</publisher>
</biblioentry>
</biblioentry>
</bibliography>
......
<sect1 id="manual.intro.setup.prereq" xreflabel="Prerequisites">
<?dbhtml filename="prerequisites.html"?>
<sect1info>
<keywordset>
<keyword>
......@@ -18,7 +18,7 @@
Because libstdc++ is part of GCC, the primary source for
installation instructions is
<ulink url="http://gcc.gnu.org/install/">the GCC install page</ulink>.
In particular, list of prerequisite software needed to build the library
In particular, list of prerequisite software needed to build the library
<ulink url="http://gcc.gnu.org/install/prerequisites.html">
starts with those requirements.</ulink> The same pages also list
the tools you will need if you wish to modify the source.
......@@ -41,13 +41,13 @@
</para>
<para>
Finally, a few system-specific requirements:
Finally, a few system-specific requirements:
</para>
<variablelist>
<varlistentry>
<term>linux</term>
<listitem>
<para>
If gcc 3.1.0 or later on is being used on linux, an attempt
......@@ -109,50 +109,50 @@ zh_TW BIG5
</para>
<itemizedlist>
<listitem>
<listitem>
<para>install all locales</para>
<itemizedlist>
<listitem>
<para>with RedHat Linux:
</para>
<para> <code> export LC_ALL=C </code>
<para> <code> export LC_ALL=C </code>
</para>
<para> <code> rpm -e glibc-common --nodeps </code>
<para> <code> rpm -e glibc-common --nodeps </code>
</para>
<para>
<para>
<code> rpm -i --define "_install_langs all"
glibc-common-2.2.5-34.i386.rpm
</code>
glibc-common-2.2.5-34.i386.rpm
</code>
</para>
</listitem>
<listitem>
<listitem>
<para>
Instructions for other operating systems solicited.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
</itemizedlist>
</listitem>
<listitem>
<para>install just the necessary locales</para>
<itemizedlist>
<listitem>
<itemizedlist>
<listitem>
<para>with Debian Linux:</para>
<para> Add the above list, as shown, to the file
<code>/etc/locale.gen</code> </para>
<para> run <code>/usr/sbin/locale-gen</code> </para>
</listitem>
<listitem>
<listitem>
<para>on most Unix-like operating systems:</para>
<para><code> localedef -i de_DE -f ISO-8859-1 de_DE </code></para>
<para>(repeat for each entry in the above list) </para>
</listitem>
<listitem>
</listitem>
<listitem>
<para>
Instructions for other operating systems solicited.
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
......
<sect1 id="manual.util.memory.shared_ptr" xreflabel="shared_ptr">
<section id="std.util.memory.shared_ptr" xreflabel="shared_ptr">
<?dbhtml filename="shared_ptr.html"?>
<sect1info>
<sectioninfo>
<keywordset>
<keyword>
ISO C++
......@@ -10,7 +10,7 @@
shared_ptr
</keyword>
</keywordset>
</sect1info>
</sectioninfo>
<title>shared_ptr</title>
......@@ -19,7 +19,7 @@ The shared_ptr class template stores a pointer, usually obtained via new,
and implements shared ownership semantics.
</para>
<sect2 id="shared_ptr.req">
<section id="shared_ptr.req">
<title>Requirements</title>
<para>
......@@ -39,11 +39,11 @@ and implements shared ownership semantics.
apply.
</para>
<para>
<para>
</para>
</sect2>
</section>
<sect2 id="shared_ptr.design_issues">
<section id="shared_ptr.design_issues">
<title>Design Issues</title>
......@@ -65,12 +65,12 @@ where the correct dynamic type is known. This is an application of the
technique known as type erasure.
</para>
</sect2>
</section>
<sect2 id="shared_ptr.impl">
<section id="shared_ptr.impl">
<title>Implementation</title>
<sect3>
<section>
<title>Class Hierarchy</title>
<para>
......@@ -156,9 +156,9 @@ that simplifies the implementation slightly.
</variablelist>
</sect3>
</section>
<sect3>
<section>
<title>Thread Safety</title>
<para>
......@@ -179,7 +179,7 @@ deprecated in C++0x mode.
</para>
<para>
The
The
<ulink url="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety">Thread
Safety</ulink> section of the Boost shared_ptr documentation says "shared_ptr
objects offer the same level of thread safety as built-in types."
......@@ -232,12 +232,12 @@ makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Selecting Lock Policy</title>
<para>
<para>
</para>
<para>
......@@ -300,9 +300,9 @@ used when libstdc++ is built without <literal>--enable-threads</literal>.
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Dual C++0x and TR1 Implementation</title>
<para>
......@@ -316,12 +316,12 @@ including <classname>_Sp_counted_base</classname> are shared by both implementat
<para>
The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
C++0x and TR1 modes needs to diverge further then it might be necessary to
duplicate additional classes and only make changes to the C++0x versions.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Related functions and classes</title>
<variablelist>
......@@ -346,7 +346,7 @@ In C++0x mode these constructors and the related tag types are not needed.
<para>
The clever overload to detect a base class of type
<code>enable_shared_from_this</code> comes straight from Boost.
There is an extra overload for <code>__enable_shared_from_this</code> to
There is an extra overload for <code>__enable_shared_from_this</code> to
work smoothly with <code>__shared_ptr&lt;Tp, Lp&gt;</code> using any lock
policy.
</para>
......@@ -382,9 +382,9 @@ be private.
</variablelist>
</sect3>
</section>
</sect2>
</section>
<!--- XXX
<listitem>
......@@ -414,20 +414,20 @@ the following types, depending on how the shared_ptr is constructed.
</listitem>
-->
<sect2 id="shared_ptr.using">
<section id="shared_ptr.using">
<title>Use</title>
<sect3>
<section>
<title>Examples</title>
<para>
<para>
Examples of use can be found in the testsuite, under
<filename class="directory">testsuite/tr1/2_general_utilities/shared_ptr</filename>.
</para>
</sect3>
</section>
<sect3>
<section>
<title>Unresolved Issues</title>
<para>
<para>
The resolution to C++ Standard Library issue <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#674">674</ulink>,
"shared_ptr interface changes for consistency with N1856" will
need to be implemented after it is accepted into the working
......@@ -481,21 +481,21 @@ the following types, depending on how the shared_ptr is constructed.
*_pointer_cast functions. Constructor could be private in TR1
mode, with the cast functions as friends.
</para>
</sect3>
</section>
</sect2>
</section>
<sect2 id="shared_ptr.ack">
<section id="shared_ptr.ack">
<title>Acknowledgments</title>
<para>
<para>
The original authors of the Boost shared_ptr, which is really nice
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
</para>
</sect2>
</section>
<bibliography id="shared_ptr.biblio">
<title>Bibliography</title>
......@@ -511,7 +511,7 @@ the following types, depending on how the shared_ptr is constructed.
<subtitle>
N2351
</subtitle>
</biblioentry>
</biblioentry>
<biblioentry>
<biblioid class="uri">
......@@ -524,7 +524,7 @@ the following types, depending on how the shared_ptr is constructed.
<subtitle>
N2456
</subtitle>
</biblioentry>
</biblioentry>
<biblioentry>
<biblioid class="uri">
......@@ -537,7 +537,7 @@ the following types, depending on how the shared_ptr is constructed.
<subtitle>
N2461
</subtitle>
</biblioentry>
</biblioentry>
<biblioentry>
<biblioid class="uri">
......@@ -550,8 +550,8 @@ the following types, depending on how the shared_ptr is constructed.
<subtitle>
N2461
</subtitle>
</biblioentry>
</biblioentry>
</bibliography>
</sect1>
</section>
<?xml version='1.0'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<book id="manual-index">
......@@ -24,92 +24,106 @@
</bookinfo>
<!-- Part 01 : Intro -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="intro.xml">
</xi:include>
<!-- Part 02 : Support -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Part 02 : Standard Contents -->
<part id="manual.std" xreflabel="Standard Contents">
<title>
Standard Contents
</title>
<!-- Chapter 01 : Support -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="support.xml">
</xi:include>
<!-- Part 03 : Diagnostics -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 02 : Diagnostics -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="diagnostics.xml">
</xi:include>
<!-- Part 04 : Utilities -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 03 : Utilities -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="utilities.xml">
</xi:include>
<!-- Part 05 : Strings -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 04 : Strings -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="strings.xml">
</xi:include>
<!-- Part 06 : Localization -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 05 : Localization -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="localization.xml">
</xi:include>
<!-- Part 07 : Containers -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 06 : Containers -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="containers.xml">
</xi:include>
<!-- Part 08 : Iterators -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 07 : Iterators -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="iterators.xml">
</xi:include>
<!-- Part 09 : Algorithms -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 08 : Algorithms -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="algorithms.xml">
</xi:include>
<!-- Part 10 : Numerics -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 09 : Numerics -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="numerics.xml">
</xi:include>
<!-- Part 11 : Input Output -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<!-- Chapter 10 : Input Output -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="io.xml">
</xi:include>
<!-- Part 12 : Extensions -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
</part>
<!-- Part 03 : Extensions -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="extensions.xml">
</xi:include>
<!-- Part 04 : Appendices -->
<part id="appendix" xreflabel="Appendices">
<title>
Appendices
</title>
<!-- Appendix A -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="appendix_contributing.xml">
</xi:include>
<!-- Appendix B -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="appendix_porting.xml">
</xi:include>
<!-- Appendix C -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="appendix_free.xml">
</xi:include>
<!-- Appendix D -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="../gnu/gpl-3.0.xml">
</xi:include>
<!-- Appendix E -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="../gnu/fdl-1.2.xml">
</xi:include>
<!-- Index -->
<index/>
</part>
</book>
<sect2 id="status.iso.1998" xreflabel="ISO C++ 1998">
<?dbhtml filename="status_iso_cxx1998.html"?>
<sect2info>
<keywordset>
<keyword>
......@@ -27,13 +27,13 @@ particular release.
</para>
<!-- Status is Yes or No, Broken/Partial-->
<!--
<!--
Yes
No
<?dbhtml bgcolor="#C8B0B0" ?>
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
No
<?dbhtml bgcolor="#C8B0B0" ?>
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
<table frame='all'>
<title>C++ 1998/2003 Implementation Status</title>
......@@ -1047,8 +1047,8 @@ particular release.
<listitem>
<para>
Behavior, for a well-formed program construct and correct data, that
depends on the implementation <emphasis>and that each implementation
shall document</emphasis>.
depends on the implementation <emphasis>and that each implementation
shall document</emphasis>.
</para>
</listitem>
</varlistentry>
......@@ -1074,11 +1074,11 @@ particular release.
discussed in the various sections on multithreading (see above).
</para>
<!-- [17.4.4.8]/3 says any function that doesn't have an exception-spec
can throw whatever we want; see also its footnote. Let's list those
in the sections where the function itself occurs.
can throw whatever we want; see also its footnote. Let's list those
in the sections where the function itself occurs.
-->
<para><emphasis>[18.1]/4</emphasis> The type of <code>NULL</code> is described
<link linkend="manual.support.types.null">here</link>.
<link linkend="std.support.types.null">here</link>.
</para>
<para><emphasis>[18.3]/8</emphasis> Even though it's listed in the library
sections, libstdc++ has zero control over what the cleanup code hands
......@@ -1125,12 +1125,12 @@ particular release.
</para>
<para><emphasis>[21.1.3.1]/5</emphasis> I don't really know about
the mbstate_t stuff... see
the <link linkend="manual.localization.facet.codecvt">chapter 22
the <link linkend="std.localization.facet.codecvt">chapter 22
notes</link> for what does exist.
</para>
<para><emphasis>[22.*]</emphasis> Anything and everything we have on locale
implementation will be described
<link linkend="manual.localization.locales.locale">over here</link>.
<link linkend="std.localization.locales.locale">over here</link>.
</para>
<para><emphasis>[26.2.8]/9</emphasis> I have no idea what
<code>complex&lt;T&gt;</code>'s pow(0,0) returns.
......@@ -1152,7 +1152,7 @@ particular release.
<para><emphasis>[27.7.1.3]/16</emphasis>,
<emphasis>[27.8.1.4]/10</emphasis>
The effects of <code>pubsetbuf/setbuf</code> are described
<link linkend="manual.io">in this chapter</link>.
<link linkend="std.io">in this chapter</link>.
</para>
<para><emphasis>[27.8.1.4]/16</emphasis> Calling <code>fstream::sync</code> when
a get area exists will... whatever <code>fflush()</code> does, I think.
......
<sect2 id="status.iso.tr24733" xreflabel="Status C++ TR24733">
<?dbhtml filename="status_iso_cxxtr24733.html"?>
<sect2info>
<keywordset>
<keyword>
......@@ -24,12 +24,12 @@ particular release.
</para>
<!-- Status is Yes or No, Broken/Partial-->
<!--
<!--
Yes
No
No
<?dbhtml bgcolor="#C8B0B0" ?>
Broken/Partial
Broken/Partial
<?dbhtml bgcolor="#B0B0B0" ?>
-->
<table frame='all'>
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.support" xreflabel="Support">
<chapter id="std.support" xreflabel="Support">
<?dbhtml filename="support.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,15 +15,13 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Support
<indexterm><primary>Support</primary></indexterm>
</title>
<preface>
<title></title>
<para>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
......@@ -35,12 +33,11 @@
homepage for help), we can mention a couple of changes in what
kind of support a C++ program gets from the Standard Library.
</para>
</preface>
<chapter id="manual.support.types" xreflabel="Types">
<sect1 id="std.support.types" xreflabel="Types">
<?dbhtml filename="fundamental_types.html"?>
<title>Types</title>
<sect1 id="manual.support.types.fundamental" xreflabel="Fundamental Types">
<sect2 id="std.support.types.fundamental" xreflabel="Fundamental Types">
<title>Fundamental Types</title>
<para>
C++ has the following builtin types:
......@@ -100,9 +97,9 @@
Specializing parts of the library on these types is prohibited:
instead, use a POD.
</para>
</sect1>
<sect1 id="manual.support.types.numeric_limits" xreflabel="Numeric Properties">
</sect2>
<sect2 id="std.support.types.numeric_limits" xreflabel="Numeric Properties">
<title>Numeric Properties</title>
......@@ -117,8 +114,8 @@
</para>
<programlisting>
template&lt;typename T&gt;
struct class
template&lt;typename T&gt;
struct class
{
static const bool is_specialized;
static T max() throw();
......@@ -156,9 +153,9 @@
static const float_round_style round_style;
};
</programlisting>
</sect1>
</sect2>
<sect1 id="manual.support.types.null" xreflabel="NULL">
<sect2 id="std.support.types.null" xreflabel="NULL">
<title>NULL</title>
<para>
The only change that might affect people is the type of
......@@ -191,15 +188,15 @@
<constant>NULL</constant> that will match pointers before it
matches integers.
</para>
<para>See
<para>See
<ulink url="http://www.awprofessional.com/titles/0-201-31015-5/">the
Effective C++ CD example</ulink>
</para>
</sect1>
</sect2>
</chapter>
</sect1>
<chapter id="manual.support.memory" xreflabel="Dynamic Memory">
<sect1 id="std.support.memory" xreflabel="Dynamic Memory">
<?dbhtml filename="dynamic_memory.html"?>
<title>Dynamic Memory</title>
<para>
......@@ -262,8 +259,8 @@
{
delete[] safety;
popup_window ("Dude, you are running low on heap memory. You
should, like, close some windows, or something.
The next time you run out, we're gonna burn!");
should, like, close some windows, or something.
The next time you run out, we're gonna burn!");
set_new_handler (old_handler);
return;
}
......@@ -277,14 +274,14 @@
</programlisting>
<para>
<classname>bad_alloc</classname> is derived from the base <classname>exception</classname>
class defined in Chapter 19.
class defined in Sect1 19.
</para>
</chapter>
</sect1>
<chapter id="manual.support.termination" xreflabel="Termination">
<sect1 id="std.support.termination" xreflabel="Termination">
<?dbhtml filename="termination.html"?>
<title>Termination</title>
<sect1 id="support.termination.handlers" xreflabel="Termination Handlers">
<sect2 id="support.termination.handlers" xreflabel="Termination Handlers">
<title>Termination Handlers</title>
<para>
Not many changes here to <filename
......@@ -310,32 +307,32 @@
<listitem>
<para>
Functions registered with <function>atexit()</function> are called in
reverse order of registration, once per registration call.
(This isn't actually new.)
reverse order of registration, once per registration call.
(This isn't actually new.)
</para>
</listitem>
<listitem>
<para>
The previous two actions are <quote>interleaved,</quote> that is,
given this pseudocode:
given this pseudocode:
</para>
<programlisting>
extern "C or C++" void f1 (void);
extern "C or C++" void f2 (void);
static Thing obj1;
atexit(f1);
static Thing obj2;
atexit(f2);
</programlisting>
<para>
then at a call of <function>exit()</function>,
<varname>f2</varname> will be called, then
<varname>obj2</varname> will be destroyed, then
<varname>f1</varname> will be called, and finally
<varname>obj1</varname> will be destroyed. If
<varname>f1</varname> or <varname>f2</varname> allow an
exception to propagate out of them, Bad Things happen.
then at a call of <function>exit()</function>,
<varname>f2</varname> will be called, then
<varname>obj2</varname> will be destroyed, then
<varname>f1</varname> will be called, and finally
<varname>obj1</varname> will be destroyed. If
<varname>f1</varname> or <varname>f2</varname> allow an
exception to propagate out of them, Bad Things happen.
</para>
</listitem>
</orderedlist>
......@@ -345,9 +342,9 @@
those slots. If you think you may run out, we recommend using
the <function>xatexit</function>/<function>xexit</function> combination from <literal>libiberty</literal>, which has no such limit.
</para>
</sect1>
</sect2>
<sect1 id="support.termination.verbose" xreflabel="Verbose Terminate Handler">
<sect2 id="support.termination.verbose" xreflabel="Verbose Terminate Handler">
<?dbhtml filename="verbose_termination.html"?>
<title>Verbose Terminate Handler</title>
<para>
......@@ -358,7 +355,7 @@
<programlisting>
#include &lt;exception&gt;
int main()
{
std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
......@@ -390,7 +387,7 @@ int main()
#include &lt;stdexcept&gt;
struct argument_error : public std::runtime_error
{
{
argument_error(const std::string&amp; s): std::runtime_error(s) { }
};
......@@ -436,7 +433,7 @@ int main(int argc)
std::set_terminate(std::abort);
</programlisting>
<para>
<para>
After this, all calls to <function>terminate</function> will use
<function>abort</function> as the terminate handler.
</para>
......@@ -449,7 +446,7 @@ int main(int argc)
an unspecified manner.
</para>
</sect1>
</chapter>
</sect2>
</sect1>
</part>
</chapter>
......@@ -1042,7 +1042,7 @@ namespace gtk
<filename class="headerfile">cstdlib</filename>
</para>
</listitem>
<listitem>
<para>
<filename class="headerfile">exception</filename>
......@@ -1075,7 +1075,7 @@ namespace gtk
</itemizedlist>
<para>
In addition, throw in
In addition, throw in
</para>
<itemizedlist>
......@@ -1103,12 +1103,12 @@ namespace gtk
</para>
</listitem>
</itemizedlist>
<para> There exists a library that offers runtime support for
just these headers, and it is called
<filename class="libraryfile">libsupc++.a</filename>. To use it, compile with <command>gcc</command> instead of <command>g++</command>, like so:
</para>
<para>
<command>gcc foo.cc -lsupc++</command>
</para>
......@@ -1501,7 +1501,7 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
this at application run-time
see <link linkend="manual.intro.using.macros">here</link>. Also
useful are details
on <link linkend="manual.util.memory.allocator">allocator</link>
on <link linkend="std.util.memory.allocator">allocator</link>
options and capabilities.
</para>
......
<?xml version='1.0'?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
[ ]>
<part id="manual.util" xreflabel="Utilities">
<chapter id="std.util" xreflabel="Utilities">
<?dbhtml filename="utilities.html"?>
<partinfo>
<chapterinfo>
<keywordset>
<keyword>
ISO C++
......@@ -15,28 +15,28 @@
library
</keyword>
</keywordset>
</partinfo>
</chapterinfo>
<title>
Utilities
<indexterm><primary>Utilities</primary></indexterm>
</title>
<!-- Chapter 01 : Functors -->
<chapter id="manual.util.functors" xreflabel="Functors">
<!-- Section 01 : Functors -->
<section id="std.util.functors" xreflabel="Functors">
<?dbhtml filename="functors.html"?>
<title>Functors</title>
<para>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as part of their STL, in
concept written by SGI as chapter of their STL, in
<ulink url="http://www.sgi.com/tech/stl/functors.html">their
http://www.sgi.com/tech/stl/functors.html</ulink>.
</para>
</chapter>
</section>
<!-- Chapter 02 : Pairs -->
<chapter id="manual.util.pairs" xreflabel="Pairs">
<!-- Section 02 : Pairs -->
<section id="std.util.pairs" xreflabel="Pairs">
<?dbhtml filename="pairs.html"?>
<title>Pairs</title>
<para>The <code>pair&lt;T1,T2&gt;</code> is a simple and handy way to
......@@ -76,7 +76,7 @@
</para>
<programlisting>
x.first &lt; y.first ||
( !(y.first &lt; x.first) &amp;&amp; x.second &lt; y.second )
( !(y.first &lt; x.first) &amp;&amp; x.second &lt; y.second )
</programlisting>
<para>The other operators are not defined using the <code>rel_ops</code>
functions above, but their semantics are the same.
......@@ -89,10 +89,10 @@
pair&lt;int,MyClass&gt; p = make_pair(4,myobject);
</programlisting>
</chapter>
</section>
<!-- Chapter 03 : Memory -->
<chapter id="manual.util.memory" xreflabel="Memory">
<!-- Section 03 : Memory -->
<section id="std.util.memory" xreflabel="Memory">
<?dbhtml filename="memory.html"?>
<title>Memory</title>
<para>
......@@ -104,28 +104,28 @@
</para>
<!-- Section 01 : allocator -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="allocator.xml">
</xi:include>
<!-- Section 02 : auto_ptr -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="auto_ptr.xml">
</xi:include>
<!-- Section 03 : shared_ptr -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="shared_ptr.xml">
</xi:include>
</chapter>
</section>
<!-- Chapter 04 : Traits -->
<chapter id="manual.util.traits" xreflabel="Traits">
<!-- Section 04 : Traits -->
<section id="std.util.traits" xreflabel="Traits">
<?dbhtml filename="traits.html"?>
<title>Traits</title>
<para>
</para>
</chapter>
</section>
</part>
</chapter>
// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
......@@ -20,7 +20,7 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file include/c++0x_warning.h
/** @file c++0x_warning.h
* This is a Standard C++ Library header.
*/
......
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