From 03a32789f408a7e59da4386375ddd77b8b6a3531 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Thu, 25 Feb 2010 01:22:57 +0000 Subject: faq.xml: Adjust structure for pdf index. 2010-02-24 Benjamin Kosnik * 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 --- libstdc++-v3/ChangeLog | 48 ++++ libstdc++-v3/doc/Makefile.am | 123 ++++---- libstdc++-v3/doc/Makefile.in | 123 ++++---- libstdc++-v3/doc/xml/faq.xml | 6 +- libstdc++-v3/doc/xml/manual/algorithms.xml | 114 ++++---- libstdc++-v3/doc/xml/manual/allocator.xml | 44 +-- .../doc/xml/manual/appendix_contributing.xml | 232 ++++++++------- libstdc++-v3/doc/xml/manual/appendix_free.xml | 8 +- libstdc++-v3/doc/xml/manual/appendix_porting.xml | 18 +- libstdc++-v3/doc/xml/manual/auto_ptr.xml | 42 +-- libstdc++-v3/doc/xml/manual/bitmap_allocator.xml | 20 +- libstdc++-v3/doc/xml/manual/build_hacking.xml | 6 +- libstdc++-v3/doc/xml/manual/codecvt.xml | 40 +-- .../doc/xml/manual/concurrency_extensions.xml | 20 +- libstdc++-v3/doc/xml/manual/configure.xml | 268 +++++++++--------- libstdc++-v3/doc/xml/manual/containers.xml | 112 ++++---- libstdc++-v3/doc/xml/manual/ctype.xml | 20 +- libstdc++-v3/doc/xml/manual/debug.xml | 24 +- libstdc++-v3/doc/xml/manual/debug_mode.xml | 38 +-- libstdc++-v3/doc/xml/manual/diagnostics.xml | 34 +-- libstdc++-v3/doc/xml/manual/evolution.xml | 14 +- libstdc++-v3/doc/xml/manual/extensions.xml | 102 +++---- libstdc++-v3/doc/xml/manual/internals.xml | 88 +++--- libstdc++-v3/doc/xml/manual/intro.xml | 314 ++++++++++----------- libstdc++-v3/doc/xml/manual/io.xml | 140 ++++----- libstdc++-v3/doc/xml/manual/iterators.xml | 112 ++++---- libstdc++-v3/doc/xml/manual/locale.xml | 28 +- libstdc++-v3/doc/xml/manual/localization.xml | 38 +-- libstdc++-v3/doc/xml/manual/messages.xml | 36 +-- libstdc++-v3/doc/xml/manual/mt_allocator.xml | 78 ++--- libstdc++-v3/doc/xml/manual/numerics.xml | 46 +-- libstdc++-v3/doc/xml/manual/parallel_mode.xml | 26 +- libstdc++-v3/doc/xml/manual/prerequisites.xml | 42 +-- libstdc++-v3/doc/xml/manual/profile_mode.xml | 172 +++++------ libstdc++-v3/doc/xml/manual/shared_ptr.xml | 82 +++--- libstdc++-v3/doc/xml/manual/spine.xml | 78 ++--- libstdc++-v3/doc/xml/manual/status_cxx1998.xml | 28 +- libstdc++-v3/doc/xml/manual/status_cxx200x.xml | 160 +++++------ libstdc++-v3/doc/xml/manual/status_cxxtr1.xml | 118 ++++---- libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml | 8 +- libstdc++-v3/doc/xml/manual/strings.xml | 184 ++++++------ libstdc++-v3/doc/xml/manual/support.xml | 91 +++--- libstdc++-v3/doc/xml/manual/using.xml | 10 +- libstdc++-v3/doc/xml/manual/utilities.xml | 48 ++-- libstdc++-v3/include/bits/c++0x_warning.h | 4 +- 45 files changed, 1760 insertions(+), 1627 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 138a55b..66d4120 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,51 @@ +2010-02-24 Benjamin Kosnik + + * 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 * testsuite/ext/new_allocator/deallocate_global.cc: Require diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am index 1312c88..6c7f960 100644 --- a/libstdc++-v3/doc/Makefile.am +++ b/libstdc++-v3/doc/Makefile.am @@ -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 diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index 4bbb39e..6ec5420 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -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. diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml index c80b44a..7a0953c 100644 --- a/libstdc++-v3/doc/xml/faq.xml +++ b/libstdc++-v3/doc/xml/faq.xml @@ -400,7 +400,7 @@ If the only functions from libstdc++.a which you need are language support functions (those listed in - clause 18 of the + clause 18 of the standard, e.g., new and delete), then try linking against libsupc++.a, which is a subset of @@ -896,7 +896,7 @@ More information, including how to optionally enable/disable the checks, is available - here. + here. @@ -962,7 +962,7 @@ See - the Containers + the Containers chapter. diff --git a/libstdc++-v3/doc/xml/manual/algorithms.xml b/libstdc++-v3/doc/xml/manual/algorithms.xml index 3514f4a..008fd02 100644 --- a/libstdc++-v3/doc/xml/manual/algorithms.xml +++ b/libstdc++-v3/doc/xml/manual/algorithms.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -18,71 +18,69 @@ algorithm - + Algorithms <indexterm><primary>Algorithms</primary></indexterm> - - - 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: - - - 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. - - - - - 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. - - - - - Even strings can be fed through the algorithms here, although the - string class has specialized versions of many of these functions - (for example, string::find()). 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 - N 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 containers chapter to - keep real code readable. - - - The single thing that trips people up the most is the definition - of range used with iterators; the famous - "past-the-end" rule that everybody loves to hate. The - iterators - chapter of this document has a complete explanation of - this simple rule that seems to cause so much confusion. Once you - get range into your head (it's not that - hard, honest!), then the algorithms are a cakewalk. - - + + + 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. + + + + + 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. + + + + + Even strings can be fed through the algorithms here, although the + string class has specialized versions of many of these functions + (for example, string::find()). 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 + N 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 containers sect1 to keep + real code readable. + + + The single thing that trips people up the most is the definition + of range used with iterators; the famous + "past-the-end" rule that everybody loves to hate. The + iterators sect1 of this + document has a complete explanation of this simple rule that seems + to cause so much confusion. Once you + get range into your head (it's not that hard, + honest!), then the algorithms are a cakewalk. + - + - - + + Mutating - + <function>swap</function> - + Specializations If you call std::swap(x,y); where x and y are standard @@ -98,10 +96,10 @@ internal pointers to storage need to be exchanged. - - - + + + - + - + diff --git a/libstdc++-v3/doc/xml/manual/allocator.xml b/libstdc++-v3/doc/xml/manual/allocator.xml index 12d9d0c..ca1c8cb 100644 --- a/libstdc++-v3/doc/xml/manual/allocator.xml +++ b/libstdc++-v3/doc/xml/manual/allocator.xml @@ -1,7 +1,7 @@ - +
- + ISO C++ @@ -10,7 +10,7 @@ allocator - + Allocators @@ -24,7 +24,7 @@ management classes. - +
Requirements @@ -85,9 +85,9 @@ [20.4 Memory]. - +
- +
Design Issues @@ -136,12 +136,12 @@ abi::__cxa_atexit is not recommended. - +
- +
Implementation - +
Interface Design @@ -163,9 +163,9 @@ may not be user-configurable. - +
- +
Selecting Default Allocation Policy @@ -229,9 +229,9 @@ __gnu_cxx::new_allocator. - +
- +
Disabling Memory Caching @@ -281,11 +281,11 @@ cached allocations...). - +
- +
- +
Using a Specific Allocator @@ -303,9 +303,9 @@ std::deque <int, __gnu_cxx::debug_allocator<std::allocator<int> > > debug_deque; - +
- +
Custom Allocators @@ -321,9 +321,9 @@ new_allocator. - +
- +
Extension Allocators @@ -489,7 +489,7 @@ - +
@@ -615,4 +615,4 @@ - +
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml index 25b3446..331f140 100644 --- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml +++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml @@ -1,6 +1,6 @@ - @@ -25,7 +25,7 @@ - + The GNU C++ Library follows an open development model. Active contributors are assigned maintainer-ship responsibility, and given write access to the source repository. First time contributors @@ -40,7 +40,7 @@ - + Get and read the relevant sections of the C++ language specification. Copies of the full ISO 14882 standard are available on line via the ISO mirror site for committee @@ -50,14 +50,14 @@ the standard from their respective national standards organization. In the USA, this national standards organization is ANSI and their web-site is right - here. - (And if you've already registered with them, clicking this link will take you to directly to the place where you can + here. + (And if you've already registered with them, clicking this link will take you to directly to the place where you can buy the standard on-line.) - + The library working group bugs, and known defects, can be obtained here: http://www.open-std.org/jtc1/sc22/wg21 @@ -65,7 +65,7 @@ - + The newsgroup dedicated to standardization issues is comp.std.c++: this FAQ for this group is quite useful and can be @@ -75,7 +75,7 @@ - + Peruse the GNU Coding Standards, and chuckle when you hit the part @@ -84,7 +84,7 @@ - + Be familiar with the extensions that preceded these general GNU rules. These style issues for libstdc++ can be found here. @@ -92,7 +92,7 @@ - + And last but certainly not least, read the library-specific information found here. @@ -107,10 +107,10 @@ Small changes can be accepted without a copyright assignment form on file. New code and additions to the library need completed copyright assignment form on file at the FSF. Note: your employer may be required - to fill out appropriate disclaimer forms as well. + to fill out appropriate disclaimer forms as well. - + Historically, the libstdc++ assignment form added the following question: @@ -128,7 +128,7 @@ - For more information about getting a copyright assignment, please see + For more information about getting a copyright assignment, please see Legal Matters. @@ -162,34 +162,34 @@ - + A description of the bug and how your patch fixes this bug. For new features a description of the feature and your - implementation. + implementation. - + A ChangeLog entry as plain text; see the various ChangeLog files for format and content. If you are using emacs as your editor, simply position the insertion point at the beginning of your change and hit CX-4a to bring up the appropriate ChangeLog entry. See--magic! Similar - functionality also exists for vi. + functionality also exists for vi. - + A testsuite submission or sample program that will easily and simply show the existing error or test new - functionality. + functionality. - + The patch itself. If you are accessing the SVN repository use svn update; svn diff NEW; else, use diff -cp OLD NEW ... If your @@ -202,13 +202,13 @@ - + When you have all these pieces, bundle them up in a mail message and send it to libstdc++@gcc.gnu.org. All patches and related discussion should be sent to the - libstdc++ mailing list. + libstdc++ mailing list. - + @@ -218,7 +218,7 @@ Directory Layout and Source Conventions - + The unpacked source directory of libstdc++ contains the files needed to create the GNU C++ Library. @@ -238,26 +238,26 @@ It has subdirectories: include/std Files meant to be found by #include <name> directives in - standard-conforming user programs. + standard-conforming user programs. include/c - Headers intended to directly include standard C headers. + Headers intended to directly include standard C headers. [NB: this can be enabled via --enable-cheaders=c] - include/c_global + include/c_global Headers intended to include standard C headers in the global namespace, and put select names into the std:: namespace. [NB: this is the default, and is the same as --enable-cheaders=c_global] - include/c_std + include/c_std Headers intended to include standard C headers already in namespace std, and put select names into the std:: namespace. [NB: this is the same as --enable-cheaders=c_std] include/bits Files included by standard headers and by other files in - the bits directory. + the bits directory. include/backward Headers provided for backward compatibility, such as <iostream.h>. @@ -276,7 +276,7 @@ It has subdirectories: installed. testsuites/[backward, demangle, ext, performance, thread, 17_* to 27_*] - Test programs are here, and may be used to begin to exercise the + Test programs are here, and may be used to begin to exercise the library. Support for "make check" and "make check-install" is complete, and runs through all the subdirectories here when this command is issued from the build directory. Please note that @@ -378,7 +378,7 @@ indicate a place that may require attention for multi-thread safety. these names as operators have been fixed.] The full set of __* identifiers (combined from gcc/cp/lex.c and - gcc/cplus-dem.c) that are either old or new, but are definitely + gcc/cplus-dem.c) that are either old or new, but are definitely recognized by the demangler, is: __aa @@ -548,8 +548,8 @@ indicate a place that may require attention for multi-thread safety. -NOT- char *p = "flop"; // wrong char &c = *p; // wrong - - Reason: In C++, definitions are mixed with executable code. Here, + + Reason: In C++, definitions are mixed with executable code. Here, p is being initialized, not *p. This is near-universal practice among C++ programmers; it is normal for C hackers to switch spontaneously as they gain experience. @@ -558,9 +558,9 @@ indicate a place that may require attention for multi-thread safety. operator==(type) -NOT- operator == (type) // wrong - + Reason: The == is part of the function name. Separating - it makes the declaration look like an expression. + it makes the declaration look like an expression. 03. Function names and parentheses void mangle() @@ -569,22 +569,22 @@ indicate a place that may require attention for multi-thread safety. Reason: no space before parentheses (except after a control-flow keyword) is near-universal practice for C++. It identifies the - parentheses as the function-call operator or declarator, as + parentheses as the function-call operator or declarator, as opposed to an expression or other overloaded use of parentheses. 04. Template function indentation template<typename T> - void + void template_function(args) { } -NOT- template<class T> void template_function(args) {}; - + Reason: In class definitions, without indentation whitespace is needed both above and below the declaration to distinguish it visually from other members. (Also, re: "typename" - rather than "class".) T often could be int, which is + rather than "class".) T often could be int, which is not a class. ("class", here, is an anachronism.) 05. Template class indentation @@ -622,7 +622,7 @@ indicate a place that may require attention for multi-thread safety. 07. Member initialization lists All one line, separate from class name. - gribble::gribble() + gribble::gribble() : _M_private_data(0), _M_more_stuff(0), _M_helper(0); { } -NOT- @@ -630,18 +630,18 @@ indicate a place that may require attention for multi-thread safety. { } 08. Try/Catch blocks - try + try { // - } + } catch (...) { // - } + } -NOT- try { - // - } catch(...) { + // + } catch(...) { // } @@ -649,7 +649,7 @@ indicate a place that may require attention for multi-thread safety. Keywords such as extern, static, export, explicit, inline, etc go on the line above the function name. Thus - virtual int + virtual int foo() -NOT- virtual int foo() @@ -692,7 +692,7 @@ indicate a place that may require attention for multi-thread safety. -NOT- public: - + int foo; 13. Spacing WRT return statements. @@ -751,17 +751,17 @@ indicate a place that may require attention for multi-thread safety. Name patterns: - For nonstandard names appearing in Standard headers, we are constrained + For nonstandard names appearing in Standard headers, we are constrained to use names that begin with underscores. This is called "uglification". The convention is: Local and argument names: __[a-z].* - Examples: __count __ix __s1 + Examples: __count __ix __s1 Type names and template formal-argument names: _[A-Z][^_].* - Examples: _Helper _CharT _N + Examples: _Helper _CharT _N Member data and function names: _M_.* @@ -771,7 +771,7 @@ indicate a place that may require attention for multi-thread safety. Examples: _S_max_elements _S_default_value - Don't use names in the same scope that differ only in the prefix, + Don't use names in the same scope that differ only in the prefix, e.g. _S_top and _M_top. See BADNAMES for a list of forbidden names. (The most tempting of these seem to be and "_T" and "__sz".) @@ -781,7 +781,7 @@ indicate a place that may require attention for multi-thread safety. -------------------------- [BY EXAMPLE] - + #ifndef _HEADER_ #define _HEADER_ 1 @@ -794,37 +794,37 @@ indicate a place that may require attention for multi-thread safety. gribble(const gribble&); - explicit + explicit gribble(int __howmany); - gribble& + gribble& operator=(const gribble&); - virtual + virtual ~gribble() throw (); // Start with a capital letter, end with a period. - inline void + inline void public_member(const char* __arg) const; // In-class function definitions should be restricted to one-liners. - int + int one_line() { return 0 } - int - two_lines(const char* arg) + int + two_lines(const char* arg) { return strchr(arg, 'a'); } - inline int + inline int three_lines(); // inline, but defined below. // Note indentation. template<typename _Formal_argument> - void + void public_template() const throw(); template<typename _Iterator> - void + void other_template(); private: @@ -835,13 +835,13 @@ indicate a place that may require attention for multi-thread safety. _Helper* _M_helper; int _M_private_function(); - enum _Enum - { - _S_one, - _S_two + enum _Enum + { + _S_one, + _S_two }; - static void + static void _S_initialize_library(); }; @@ -871,20 +871,20 @@ indicate a place that may require attention for multi-thread safety. #endif /* _HEADER_ */ - namespace std + namespace std { template<typename T> // notice: "typename", not "class", no space - long_return_value_type<with_many, args> + long_return_value_type<with_many, args> function_name(char* pointer, // "char *pointer" is wrong. - char* argument, + char* argument, const Reference& ref) { // int a_local; /* wrong; see below. */ - if (test) - { - nested code + if (test) + { + nested code } - + int a_local = 0; // declare variable at first use. // char a, b, *p; /* wrong */ @@ -897,12 +897,12 @@ indicate a place that may require attention for multi-thread safety. // ... } } - + gribble::gribble() : _M_private_data(0), _M_more_stuff(0), _M_helper(0); { } - inline int + inline int gribble::three_lines() { // doesn't fit in one line. @@ -910,7 +910,7 @@ indicate a place that may require attention for multi-thread safety. } // namespace std - +
@@ -932,7 +932,7 @@ indicate a place that may require attention for multi-thread safety. To generate the pretty pictures and hierarchy graphs, the Graphviz - package will need to be installed. + package will need to be installed.
@@ -1022,7 +1022,7 @@ indicate a place that may require attention for multi-thread safety. Use the triple-slash style only for one-line comments (the - brief mode). + brief mode). @@ -1032,7 +1032,7 @@ indicate a place that may require attention for multi-thread safety. - + Some specific guidelines: @@ -1071,7 +1071,7 @@ indicate a place that may require attention for multi-thread safety. * @brief A model of a linear congruential random number generator. * * @f[ - * x_{i+1}\leftarrow(ax_{i} + c) \bmod m + * x_{i+1}\leftarrow(ax_{i} + c) \bmod m * @f] */ @@ -1207,11 +1207,11 @@ indicate a place that may require attention for multi-thread safety. consult the libstdc++@gcc.gnu.org list when preparing printed manuals for current best practice and suggestions. - + Make sure that the XML documentation and markup is valid for any change. This can be done easily, with the validation rules - in the Makefile, which is equivalent to doing: + in the Makefile, which is equivalent to doing: @@ -1226,25 +1226,25 @@ xmllint --noout --valid xml/index.xml The following Makefile rules generate (in order): an HTML - version of all the documentation, a PDF version of the same, a + version of all the DocBook documentation, a PDF version of the same, a single XML document, and the result of validating the entire XML document. - make doc-html + make doc-html-docbook - make doc-pdf + make doc-pdf-docbook - make doc-xml-single + make doc-xml-single-docbook - make doc-xml-validate + make doc-xml-validate-docbook @@ -1259,11 +1259,11 @@ xmllint --noout --valid xml/index.xml libstdc++-v3/doc/xml Inside this directory, the files of importance: - spine.xml - index to documentation set + spine.xml - index to documentation set manual/spine.xml - index to manual manual/*.xml - individual chapters and sections of the manual faq.xml - index to FAQ - api.xml - index to source level / API + api.xml - index to source level / API All *.txml files are template xml files, i.e., otherwise empty files with the correct structure, suitable for filling in with new information. @@ -1291,7 +1291,7 @@ xmllint --noout --valid xml/index.xml </chapter> </book> - <book> + <book> <part> <chapter> <section> @@ -1308,7 +1308,7 @@ xmllint --noout --valid xml/index.xml <chapter> </chapter> - </part> + </part> </book> </set> @@ -1321,7 +1321,7 @@ xmllint --noout --valid xml/index.xml Complete details on Docbook markup can be found in the DocBook Element Reference, - online. + online. An incomplete reference for HTML to Docbook conversion is detailed in the table below. @@ -1346,7 +1346,7 @@ xmllint --noout --valid xml/index.xml <pre> - <computeroutput>, <programlisting>, + <computeroutput>, <programlisting>, <literallayout> @@ -1477,7 +1477,45 @@ xmllint --noout --valid xml/index.xml - + + Combines + + + Generating Combines and Assemblages + + + The following Makefile rules are defaults, and are usually + aliased to variable rules. + + + + make doc-html + + + + make doc-man + + + + make doc-pdf + + + + The following Makefile rules generate (in order): an HTML + version of all the DocBook documentation with links into an + local Doxygen cache, and a PDF version of the same. + + + + make doc-html-combine + + + + make doc-pdf-combine + + + + @@ -2339,6 +2377,6 @@ xmllint --noout --valid xml/index.xml include them via "<backward/hash_map.h>" or "<ext/hash_map>" than to search the subdirectory itself via a "-I" directive. - + diff --git a/libstdc++-v3/doc/xml/manual/appendix_free.xml b/libstdc++-v3/doc/xml/manual/appendix_free.xml index c2cf1c1..61df179 100644 --- a/libstdc++-v3/doc/xml/manual/appendix_free.xml +++ b/libstdc++-v3/doc/xml/manual/appendix_free.xml @@ -1,6 +1,6 @@ - @@ -64,7 +64,7 @@ Given that writing good English is a rare skill among programmers, we can ill afford to lose manuals this way. - + 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 web page that lists free books available from other publishers]. - + Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Verbatim copying and distribution of this entire article are diff --git a/libstdc++-v3/doc/xml/manual/appendix_porting.xml b/libstdc++-v3/doc/xml/manual/appendix_porting.xml index c44a9ad..8088453 100644 --- a/libstdc++-v3/doc/xml/manual/appendix_porting.xml +++ b/libstdc++-v3/doc/xml/manual/appendix_porting.xml @@ -1,11 +1,11 @@ - - + @@ -26,32 +26,32 @@ - - - - - - diff --git a/libstdc++-v3/doc/xml/manual/auto_ptr.xml b/libstdc++-v3/doc/xml/manual/auto_ptr.xml index 4175b70..6c49a55 100644 --- a/libstdc++-v3/doc/xml/manual/auto_ptr.xml +++ b/libstdc++-v3/doc/xml/manual/auto_ptr.xml @@ -1,7 +1,7 @@ - +
- - + + ISO C++ @@ -10,11 +10,11 @@ auto_ptr - + auto_ptr - +
Limitations 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()); } When an exception gets thrown, the instance of MyClass that's @@ -62,15 +62,15 @@ Changing that code as follows is not AP-friendly: - APMC ap (new MyClass[22]); + APMC ap (new MyClass[22]); You will get the same problems as you would without the use of AP: - 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 AP cannot tell whether the pointer you've passed at creation points @@ -79,21 +79,21 @@ own auto_array_ptr for that situation (in fact, this has been done many times; check the mailing lists, Usenet, Boost, etc). - - - +
+ +
Use in Containers - All of the containers + All of the containers described in the standard library require their contained types to have, among other things, a copy constructor like this: struct My_Type { - My_Type (My_Type const&); + My_Type (My_Type const&); }; @@ -119,15 +119,15 @@ #include <vector> #include <memory> - + void f() { - std::vector< std::auto_ptr<int> > vec_ap_int; + std::vector< std::auto_ptr<int> > vec_ap_int; } Should you try this with the checks enabled, you will see an error. - +
- +
diff --git a/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml b/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml index 6f1b26b..7b90e3a 100644 --- a/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml +++ b/libstdc++-v3/doc/xml/manual/bitmap_allocator.xml @@ -1,6 +1,6 @@ - + @@ -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. -
+
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. Maximum Wasted Percentage - + 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% Gets more memory from the Global Free List of the Required - size. + size. - Adjusts the size for the next call to itself. + Adjusts the size for the next call to itself. @@ -344,7 +344,7 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524% Sets the use count for that super-block just allocated to 0 - (zero). + (zero). @@ -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. @@ -378,7 +378,7 @@ single object allocations. However for n == 1, a series of steps are performed: - + 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. - + 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. - + diff --git a/libstdc++-v3/doc/xml/manual/build_hacking.xml b/libstdc++-v3/doc/xml/manual/build_hacking.xml index bfec860..fd134bd 100644 --- a/libstdc++-v3/doc/xml/manual/build_hacking.xml +++ b/libstdc++-v3/doc/xml/manual/build_hacking.xml @@ -1,6 +1,6 @@ - + @@ -25,7 +25,7 @@ Prerequisites - + As noted previously, certain other tools are necessary for hacking on files that @@ -42,7 +42,7 @@ Overview: What Comes from Where - + diff --git a/libstdc++-v3/doc/xml/manual/codecvt.xml b/libstdc++-v3/doc/xml/manual/codecvt.xml index d9ed13c..a2a90cf 100644 --- a/libstdc++-v3/doc/xml/manual/codecvt.xml +++ b/libstdc++-v3/doc/xml/manual/codecvt.xml @@ -1,7 +1,7 @@ - +
- + ISO C++ @@ -10,7 +10,7 @@ codecvt - + codecvt @@ -30,7 +30,7 @@ specializations for wide and narrow characters and the implementation-provided extended functionality are given. - +
Requirements @@ -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. - +
- +
Design - +
<type>wchar_t</type> Size @@ -131,9 +131,9 @@ mcsrtombs and wcsrtombs in particular. Thus, portable C++ code cannot assume a byte size (or endianness) either. - +
- +
Support for Unicode Probably the most frequently asked question about code conversion @@ -236,9 +236,9 @@ mechanism may be required. external types will need to be known. - +
- +
Other Issues 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. - +
- +
- +
Implementation @@ -432,9 +432,9 @@ external character type, encoding_state> is consistent with other codecvt usage. - +
- +
Use A conversions involving string literal. @@ -477,9 +477,9 @@ codecvt usage. VERIFY( ito_next == i_arr + size ); - +
- +
Future @@ -532,7 +532,7 @@ codecvt usage. - +
@@ -702,4 +702,4 @@ codecvt usage. - +
diff --git a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml index 0e30ee7..2b4a09a 100644 --- a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml +++ b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml @@ -1,6 +1,6 @@ - @@ -85,7 +85,7 @@ critical sections, while retaining exception-safety. -Two functions and one type form the base of atomic support. +Two functions and one type form the base of atomic support. @@ -130,7 +130,7 @@ __atomic_add_dispatch These functions forward to one of several specialized helper -functions, depending on the circumstances. For instance, +functions, depending on the circumstances. For instance, @@ -152,7 +152,7 @@ sequence. -__exchange_and_add_single +__exchange_and_add_single Single threaded version. Inlined. @@ -173,12 +173,12 @@ In addition, there are two macros -_GLIBCXX_READ_MEM_BARRIER +_GLIBCXX_READ_MEM_BARRIER -_GLIBCXX_WRITE_MEM_BARRIER +_GLIBCXX_WRITE_MEM_BARRIER @@ -195,7 +195,7 @@ host hardware and operating system. Implementation Using Builtin Atomic Functions - + The functions for atomic operations described above are either implemented via compiler intrinsics (if the underlying host is capable) or by library fallbacks. @@ -214,7 +214,7 @@ usage vary depending on the target hardware and the flags used during compile. - + If builtins are possible for bool-sized integral types, _GLIBCXX_ATOMIC_BUILTINS_1 will be defined. If builtins are possible for int-sized integral types, @@ -285,7 +285,7 @@ including pthread_t, pthread_once_t, pthread_cre etc. -
+
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml index 3a827b0..26d7d51 100644 --- a/libstdc++-v3/doc/xml/manual/configure.xml +++ b/libstdc++-v3/doc/xml/manual/configure.xml @@ -1,6 +1,6 @@ - + @@ -43,71 +43,71 @@ --enable-multilib[default] This is part of the generic multilib support for building cross - compilers. As such, targets like "powerpc-elf" will have - libstdc++ built many different ways: "-msoft-float" - and not, etc. A different libstdc++ will be built for each of - the different multilib versions. This option is on by default. + compilers. As such, targets like "powerpc-elf" will have + libstdc++ built many different ways: "-msoft-float" + and not, etc. A different libstdc++ will be built for each of + the different multilib versions. This option is on by default. --enable-sjlj-exceptions Forces old, set-jump/long-jump exception handling model. If - at all possible, the new, frame unwinding exception handling routines - should be used instead, as they significantly reduce both - runtime memory usage and executable size. This option can - change the library ABI. + at all possible, the new, frame unwinding exception handling routines + should be used instead, as they significantly reduce both + runtime memory usage and executable size. This option can + change the library ABI. --enable-version-specific-runtime-libs Specify that run-time libraries should be installed in the - compiler-specific subdirectory (i.e., - ${libdir}/gcc-lib/${target_alias}/${gcc_version}) - instead of ${libdir}. This option is useful if you - intend to use several versions of gcc in parallel. In addition, - libstdc++'s include files will be installed in - ${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++, - unless you also specify + compiler-specific subdirectory (i.e., + ${libdir}/gcc-lib/${target_alias}/${gcc_version}) + instead of ${libdir}. This option is useful if you + intend to use several versions of gcc in parallel. In addition, + libstdc++'s include files will be installed in + ${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++, + unless you also specify --with-gxx-include-dir=dirname during configuration. --with-gxx-include-dir=<include-files dir> Adds support for named libstdc++ include directory. For instance, - the following puts all the libstdc++ headers into a directory - called "4.4-20090404" instead of the usual - "c++/(version)". + the following puts all the libstdc++ headers into a directory + called "4.4-20090404" instead of the usual + "c++/(version)". - + --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404 --enable-cstdio This is an abbreviated form of '--enable-cstdio=stdio' - (described next). + (described next). --enable-cstdio=OPTION Select a target-specific I/O package. At the moment, the only - choice is to use 'stdio', a generic "C" abstraction. - The default is 'stdio'. This option can change the library ABI. + choice is to use 'stdio', a generic "C" abstraction. + The default is 'stdio'. This option can change the library ABI. --enable-clocale This is an abbreviated form of '--enable-clocale=generic' - (described next). + (described next). --enable-clocale=OPTION Select a target-specific underlying locale package. The - choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix - (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, - 'gnu' to specify a model based on functionality from the GNU C - library (langinfo/iconv/gettext) (from glibc, the GNU C - library), or 'generic' to use a generic "C" - abstraction which consists of "C" locale info. + choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix + (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, + 'gnu' to specify a model based on functionality from the GNU C + library (langinfo/iconv/gettext) (from glibc, the GNU C + library), or 'generic' to use a generic "C" + abstraction which consists of "C" locale info. If not explicitly specified, the configure proccess tries @@ -121,146 +121,146 @@ --enable-libstdcxx-allocator This is an abbreviated form of - '--enable-libstdcxx-allocator=auto' (described - next). + '--enable-libstdcxx-allocator=auto' (described + next). --enable-libstdcxx-allocator=OPTION Select a target-specific underlying std::allocator. The - choices are 'new' to specify a wrapper for new, 'malloc' to - specify a wrapper for malloc, 'mt' for a fixed power of two allocator, + choices are 'new' to specify a wrapper for new, 'malloc' to + specify a wrapper for malloc, 'mt' for a fixed power of two allocator, 'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator. - See this page for more information on allocator - extensions. This option - can change the library ABI. + See this page for more information on allocator + extensions. This option + can change the library ABI. --enable-cheaders=OPTION This allows the user to define the approach taken for C header - compatibility with C++. Options are c, c_std, and c_global. - These correspond to the source directory's include/c, - include/c_std, and include/c_global, and may also include - include/c_compatibility. The default is 'c_global'. + compatibility with C++. Options are c, c_std, and c_global. + These correspond to the source directory's include/c, + include/c_std, and include/c_global, and may also include + include/c_compatibility. The default is 'c_global'. --enable-threads This is an abbreviated form of '--enable-threads=yes' - (described next). + (described next). --enable-threads=OPTION Select a threading library. A full description is - given in the - general compiler - configuration instructions. This option can change the - library ABI. + given in the + general compiler + configuration instructions. This option can change the + library ABI. --enable-libstdcxx-debug Build separate debug libraries in addition to what is normally built. - By default, the debug libraries are compiled with - CXXFLAGS='-g3 -O0 -fno-inline' - , are installed in ${libdir}/debug, and have the - same names and versioning information as the non-debug - libraries. This option is off by default. + By default, the debug libraries are compiled with + CXXFLAGS='-g3 -O0 -fno-inline' + , are installed in ${libdir}/debug, and have the + same names and versioning information as the non-debug + libraries. This option is off by default. Note this make command, executed in - the build directory, will do much the same thing, without the - configuration difference and without building everything twice: - make CXXFLAGS='-g3 -O0 -fno-inline' all + the build directory, will do much the same thing, without the + configuration difference and without building everything twice: + make CXXFLAGS='-g3 -O0 -fno-inline' all --enable-libstdcxx-debug-flags=FLAGS This option is only valid when --enable-debug - is also specified, and applies to the debug builds only. With - this option, you can pass a specific string of flags to the - compiler to use when building the debug versions of libstdc++. - FLAGS is a quoted string of options, like + is also specified, and applies to the debug builds only. With + this option, you can pass a specific string of flags to the + compiler to use when building the debug versions of libstdc++. + FLAGS is a quoted string of options, like - + --enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline' --enable-cxx-flags=FLAGS With this option, you can pass a string of -f (functionality) - flags to the compiler to use when building libstdc++. This - option can change the library ABI. FLAGS is a quoted string of - options, like + flags to the compiler to use when building libstdc++. This + option can change the library ABI. FLAGS is a quoted string of + options, like - + --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi' - Note that the flags don't necessarily have to all be -f flags, - as shown, but usually those are the ones that will make sense - for experimentation and configure-time overriding. + Note that the flags don't necessarily have to all be -f flags, + as shown, but usually those are the ones that will make sense + for experimentation and configure-time overriding. The advantage of --enable-cxx-flags over setting CXXFLAGS in - the 'make' environment is that, if files are automatically - rebuilt, the same flags will be used when compiling those files - as well, so that everything matches. + the 'make' environment is that, if files are automatically + rebuilt, the same flags will be used when compiling those files + as well, so that everything matches. Fun flags to try might include combinations of - + -fstrict-aliasing -fno-exceptions -ffunction-sections -fvtable-gc and opposite forms (-fno-) of the same. Tell us (the libstdc++ - mailing list) if you discover more! + mailing list) if you discover more! --enable-c99 The "long long" type was introduced in C99, along - with many other functions for wide characters, and math - classification macros, etc. If enabled, all C99 functions not - specified by the C++ standard will be put into namespace - __gnu_cxx, and then all these names will - be injected into namespace std, so that C99 functions can be - used "as if" they were in the C++ standard (as they - will eventually be in some future revision of the standard, - without a doubt). By default, C99 support is on, assuming the - configure probes find all the necessary functions and bits - necessary. This option can change the library ABI. + with many other functions for wide characters, and math + classification macros, etc. If enabled, all C99 functions not + specified by the C++ standard will be put into namespace + __gnu_cxx, and then all these names will + be injected into namespace std, so that C99 functions can be + used "as if" they were in the C++ standard (as they + will eventually be in some future revision of the standard, + without a doubt). By default, C99 support is on, assuming the + configure probes find all the necessary functions and bits + necessary. This option can change the library ABI. --enable-wchar_t[default] Template specializations for the "wchar_t" type are - required for wide character conversion support. Disabling - wide character specializations may be expedient for initial - porting efforts, but builds only a subset of what is required by - ISO, and is not recommended. By default, this option is on. - This option can change the library ABI. + required for wide character conversion support. Disabling + wide character specializations may be expedient for initial + porting efforts, but builds only a subset of what is required by + ISO, and is not recommended. By default, this option is on. + This option can change the library ABI. --enable-long-long The "long long" type was introduced in C99. It is - provided as a GNU extension to C++98 in g++. This flag builds - support for "long long" into the library (specialized - templates and the like for iostreams). This option is on by default: - if enabled, users will have to either use the new-style "C" - headers by default (i.e., <cmath> not <math.h>) - or add appropriate compile-time flags to all compile lines to - allow "C" visibility of this feature (on GNU/Linux, - the flag is -D_ISOC99_SOURCE, which is added automatically via - CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). - This option can change the library ABI. + provided as a GNU extension to C++98 in g++. This flag builds + support for "long long" into the library (specialized + templates and the like for iostreams). This option is on by default: + if enabled, users will have to either use the new-style "C" + headers by default (i.e., <cmath> not <math.h>) + or add appropriate compile-time flags to all compile lines to + allow "C" visibility of this feature (on GNU/Linux, + the flag is -D_ISOC99_SOURCE, which is added automatically via + CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). + This option can change the library ABI. --enable-fully-dynamic-string This option enables a special version of basic_string avoiding - the optimization that allocates empty objects in static memory. + the optimization that allocates empty objects in static memory. Mostly useful together with shared memory allocators, see PR libstdc++/16612 for details. @@ -268,48 +268,48 @@ --enable-concept-checks This turns on additional compile-time checks for instantiated - library templates, in the form of specialized templates, - described here. They - can help users discover when they break the rules of the STL, before - their programs run. + library templates, in the form of specialized templates, + described here. They + can help users discover when they break the rules of the STL, before + their programs run. --enable-symvers[=style] In 3.1 and later, tries to turn on symbol versioning in the - shared library (if a shared library has been - requested). Values for 'style' that are currently supported - are 'gnu', 'gnu-versioned-namespace', 'darwin', and - 'darwin-export'. Both gnu- options require that a recent - version of the GNU linker be in use. Both darwin options are - equivalent. With no style given, the configure script will try - to guess correct defaults for the host system, probe to see if - additional requirements are necessary and present for - activation, and if so, will turn symbol versioning on. This - option can change the library ABI. + shared library (if a shared library has been + requested). Values for 'style' that are currently supported + are 'gnu', 'gnu-versioned-namespace', 'darwin', and + 'darwin-export'. Both gnu- options require that a recent + version of the GNU linker be in use. Both darwin options are + equivalent. With no style given, the configure script will try + to guess correct defaults for the host system, probe to see if + additional requirements are necessary and present for + activation, and if so, will turn symbol versioning on. This + option can change the library ABI. --enable-visibility In 4.2 and later, enables or disables visibility attributes. - If enabled (as by default), and the compiler seems capable of - passing the simple sanity checks thrown at it, adjusts items - in namespace std, namespace std::tr1, and namespace __gnu_cxx - so that -fvisibility options work. + If enabled (as by default), and the compiler seems capable of + passing the simple sanity checks thrown at it, adjusts items + in namespace std, namespace std::tr1, and namespace __gnu_cxx + so that -fvisibility options work. --enable-libstdcxx-pch In 3.4 and later, tries to turn on the generation of - stdc++.h.gch, a pre-compiled file including all the standard - C++ includes. If enabled (as by default), and the compiler - seems capable of passing the simple sanity checks thrown at - it, try to build stdc++.h.gch as part of the make process. - In addition, this generated file is used later on (by appending - --include bits/stdc++.h to CXXFLAGS) when running the - testsuite. + stdc++.h.gch, a pre-compiled file including all the standard + C++ includes. If enabled (as by default), and the compiler + seems capable of passing the simple sanity checks thrown at + it, try to build stdc++.h.gch as part of the make process. + In addition, this generated file is used later on (by appending + --include bits/stdc++.h to CXXFLAGS) when running the + testsuite. @@ -326,23 +326,23 @@ --enable-clock-gettime This is an abbreviated form of - '--enable-clock-gettime=yes'(described next). + '--enable-clock-gettime=yes'(described next). --enable-libstdcxx-time=OPTION Enables link-type checks for the availability of the - clock_gettime clocks, used in the implementation of [time.clock], - and of the nanosleep and sched_yield functions, used in the - implementation of [thread.thread.this] of the current C++0x draft. - The choice OPTION=yes checks for the availability of the facilities - in libc and libposix4. In case of need the latter is also linked - to libstdc++ as part of the build process. OPTION=rt also searches - (and, in case, links) librt. Note that the latter is not always - desirable because, in glibc, for example, in turn it triggers the - linking of libpthread too, which activates locking, a large overhead - for single-thread programs. OPTION=no skips the tests completely. - The default is OPTION=no. + clock_gettime clocks, used in the implementation of [time.clock], + and of the nanosleep and sched_yield functions, used in the + implementation of [thread.thread.this] of the current C++0x draft. + The choice OPTION=yes checks for the availability of the facilities + in libc and libposix4. In case of need the latter is also linked + to libstdc++ as part of the build process. OPTION=rt also searches + (and, in case, links) librt. Note that the latter is not always + desirable because, in glibc, for example, in turn it triggers the + linking of libpthread too, which activates locking, a large overhead + for single-thread programs. OPTION=no skips the tests completely. + The default is OPTION=no. diff --git a/libstdc++-v3/doc/xml/manual/containers.xml b/libstdc++-v3/doc/xml/manual/containers.xml index 909d520..3b4fb4b 100644 --- a/libstdc++-v3/doc/xml/manual/containers.xml +++ b/libstdc++-v3/doc/xml/manual/containers.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,22 +15,22 @@ library - + Containers <indexterm><primary>Containers</primary></indexterm> - - + + Sequences - + list - + list::size() is O(n) Yes it is, and that's okay. This is a decision that we preserved @@ -64,29 +64,29 @@ One implication of linear time size(): you should never write - - if (L.size() == 0) - ... + + if (L.size() == 0) + ... - Instead, you should write + Instead, you should write - - if (L.empty()) - ... + + if (L.empty()) + ... - - + + - + vector - + Space Overhead Management In here. - - + + - - + + Associative - + Insertion Hints Section [23.1.2], Table 69, of the C++ standard lists this @@ -170,7 +170,7 @@ end(), 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 end(). + the new entry before end(). @@ -216,13 +216,13 @@ point to the correct place, then no further local searching is done; the search begins from scratch in logarithmic time. - + - + bitset - + Size Variable No, you cannot write code of the form @@ -233,9 +233,9 @@ void foo (size_t n) { - std::bitset<n> bits; - .... - } + std::bitset<n> bits; + .... + } because n must be known at compile time. Your @@ -245,12 +245,12 @@ 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: - A very large N in bitset<N>. - A container<bool>. - Extremely weird solutions. + A very large N in bitset<N>. + A container<bool>. + Extremely weird solutions. A very large N in @@ -329,8 +329,8 @@ some extensions. - - + + Type String @@ -349,7 +349,7 @@ std::bitset<5> b ( std::string(10110) ); - + instead of @@ -357,17 +357,17 @@ std::bitset<5> b ( 10110 ); // invalid - - + + - + - - + + Interacting with C - + Containers vs. Arrays You're writing some code and can't decide whether to use builtin @@ -422,27 +422,27 @@ template<typename T> { return v.begin(); } template<typename T, unsigned int sz> - inline T* + inline T* beginof(T (&array)[sz]) { return array; } // endof template<typename T> - inline typename vector<T>::iterator + inline typename vector<T>::iterator endof(vector<T> &v) { return v.end(); } template<typename T, unsigned int sz> - inline T* + inline T* endof(T (&array)[sz]) { return array + sz; } // lengthof template<typename T> - inline typename vector<T>::size_type + inline typename vector<T>::size_type lengthof(vector<T> &v) { return v.size(); } template<typename T, unsigned int sz> - inline unsigned int + inline unsigned int lengthof(T (&)[sz]) { return sz; } @@ -459,13 +459,13 @@ template<typename T, unsigned int sz> Second, the line - inline unsigned int lengthof (T (&)[sz]) { return sz; } + inline unsigned int lengthof (T (&)[sz]) { return sz; } looks just weird! Hint: unused parameters can be left nameless. - - - + + + - + diff --git a/libstdc++-v3/doc/xml/manual/ctype.xml b/libstdc++-v3/doc/xml/manual/ctype.xml index 4785607..9cc4603 100644 --- a/libstdc++-v3/doc/xml/manual/ctype.xml +++ b/libstdc++-v3/doc/xml/manual/ctype.xml @@ -1,7 +1,7 @@ - +
- + ISO C++ @@ -10,14 +10,14 @@ ctype - + ctype - +
Implementation - +
Specializations @@ -57,10 +57,10 @@ Neither of these two required specializations deals with Unicode characters. - - +
+
- +
Future @@ -114,7 +114,7 @@ characters. - +
@@ -236,4 +236,4 @@ characters. - +
diff --git a/libstdc++-v3/doc/xml/manual/debug.xml b/libstdc++-v3/doc/xml/manual/debug.xml index ca09126..5f97867 100644 --- a/libstdc++-v3/doc/xml/manual/debug.xml +++ b/libstdc++-v3/doc/xml/manual/debug.xml @@ -1,6 +1,6 @@ - + @@ -22,11 +22,11 @@ Using <command>g++</command> - + Compiler flags determine how debug information is transmitted between compilation and debug or analysis tools. - + The default optimizations and debug flags for a libstdc++ build are -g -O2. However, both debug and optimization @@ -84,7 +84,7 @@ - A second approach is to use the configuration flags + A second approach is to use the configuration flags 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 debug mode. - + Memory Leak Hunting @@ -174,8 +174,8 @@ int main() { extern void* __dso_handle __attribute__ ((__weak__)); - __cxa_atexit((void (*) (void *)) __libc_freeres, NULL, - &__dso_handle ? __dso_handle : NULL); + __cxa_atexit((void (*) (void *)) __libc_freeres, NULL, + &__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: - + valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out @@ -193,7 +193,7 @@ Using <command>gdb</command> - + @@ -228,7 +228,7 @@ - svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python + svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python @@ -295,8 +295,8 @@ Profile-based Performance Analysis - The Profile-based - Performance Analysis Extension has performance checks for many + The Profile-based + Performance Analysis Extension has performance checks for many algorithms. diff --git a/libstdc++-v3/doc/xml/manual/debug_mode.xml b/libstdc++-v3/doc/xml/manual/debug_mode.xml index 32b87a1..400bb55 100644 --- a/libstdc++-v3/doc/xml/manual/debug_mode.xml +++ b/libstdc++-v3/doc/xml/manual/debug_mode.xml @@ -1,11 +1,11 @@ - - + @@ -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. @@ -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. - + Algorithm preconditions: Algorithms attempt to validate their input parameters to detect errors as early as possible. For instance, the set_intersection @@ -81,7 +81,7 @@ instance, erasing an element in a std::list 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. 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. Full recompilation: 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. Iterator: The underlying iterator type, which must be either the iterator or const_iterator typedef from the sequence type this iterator can reference. - + Sequence: The type of sequence that this iterator references. This sequence must be a safe sequence (discussed below) whose iterator or const_iterator 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). -The iterators of a container wrapper will be +The iterators of a container wrapper will be safe iterators 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 - + In debug mode we include the release-mode container (which is now defined in the namespace __norm) and also the debug-mode container. The debug-mode container is defined within the @@ -646,7 +646,7 @@ namespace std template<typename _Tp, typename _Alloc = allocator<_Tp> > class list { - // ... + // ... }; } // namespace __gnu_norm @@ -655,9 +655,9 @@ namespace std template<typename _Tp, typename _Alloc = allocator<_Tp> > class list : public __norm::list<_Tp, _Alloc>, - public __gnu_debug::_Safe_sequence<list<_Tp, _Alloc> > + public __gnu_debug::_Safe_sequence<list<_Tp, _Alloc> > { - // ... + // ... }; } // namespace __norm @@ -694,12 +694,12 @@ runtime errors. A simplified example of this problem is as follows. #include <string> std::string test02(); - + std::string test01() { return test02(); } - + int main() { test01(); @@ -711,7 +711,7 @@ int main() #include <string> - + 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, vector::push_back() being - one example. + one example. See link name @@ -850,7 +850,7 @@ test02() mode implementations. - + Other Implementations @@ -885,7 +885,7 @@ test02() guarantee. - + diff --git a/libstdc++-v3/doc/xml/manual/diagnostics.xml b/libstdc++-v3/doc/xml/manual/diagnostics.xml index eda7779..6e638c9 100644 --- a/libstdc++-v3/doc/xml/manual/diagnostics.xml +++ b/libstdc++-v3/doc/xml/manual/diagnostics.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,18 +15,18 @@ library - + Diagnostics <indexterm><primary>Diagnostics</primary></indexterm> - + Exceptions - + Exception Classes All exception objects are defined in one of the standard header @@ -47,8 +47,8 @@ found in the source documentation. - - + + Adding Data to Exceptions The standard exception classes carry with them a single string as @@ -61,7 +61,7 @@ { public: My_Exception (const string& 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 @@ }; - - + +
- + Concept Checking In 1999, SGI added concept checkers to their @@ -112,7 +112,7 @@ You can enable them on a per-translation-unit basis with -D_GLIBCXX_CONCEPT_CHECKS. - + 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. - + - + diff --git a/libstdc++-v3/doc/xml/manual/evolution.xml b/libstdc++-v3/doc/xml/manual/evolution.xml index 6d42b80..eda0006 100644 --- a/libstdc++-v3/doc/xml/manual/evolution.xml +++ b/libstdc++-v3/doc/xml/manual/evolution.xml @@ -1,6 +1,6 @@ - + ISO C++ @@ -80,10 +80,10 @@ Removal of ext/tree, moved to For GCC releases from 2.95 through the 3.1 series, defining __USE_MALLOC on the gcc command line would change the default allocation strategy to instead use malloc and - free. (This same functionality is now spelled _GLIBCXX_FORCE_NEW, see - this page + free. (This same functionality is now spelled _GLIBCXX_FORCE_NEW, see + this page for details. - + Error handling in iostreams cleaned up, made consistent. @@ -431,7 +431,7 @@ Parallel mode first appears. Variadic template implementations of items in tuple and - functional. + functional. Default what implementations give more elaborate @@ -441,7 +441,7 @@ Parallel mode first appears. -PCH binary files no longer installed. Instead, the source files are installed. +PCH binary files no longer installed. Instead, the source files are installed. @@ -604,7 +604,7 @@ Profile mode first appears. -Support for decimal floating-point arithmetic, including decimal32, decimal64, and decimal128. +Support for decimal floating-point arithmetic, including decimal32, decimal64, and decimal128. diff --git a/libstdc++-v3/doc/xml/manual/extensions.xml b/libstdc++-v3/doc/xml/manual/extensions.xml index c3fc3bb..7fa9a5e 100644 --- a/libstdc++-v3/doc/xml/manual/extensions.xml +++ b/libstdc++-v3/doc/xml/manual/extensions.xml @@ -1,11 +1,11 @@ - - + @@ -35,7 +35,7 @@ extensions, be aware of two things: - Non-Standard means exactly that. + Non-Standard means exactly that. 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... - You should know how to access these headers properly. + You should know how to access these headers properly. @@ -104,17 +104,17 @@ extensions, be aware of two things: - - - @@ -125,12 +125,12 @@ extensions, be aware of two things: Allocators - - @@ -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). -The semantics of member function operator[] are not specified +The semantics of member function operator[] are not specified in the C++ standard. A long-standing defect report calls for sensible obvious semantics, which are already implemented here: op[] 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: - + @@ -283,22 +283,22 @@ extensions, be aware of two things: - identity_element for addition and multiplication. * + identity_element for addition and multiplication. * The functor identity, whose operator() - returns the argument unchanged. * + returns the argument unchanged. * Composition functors unary_function and binary_function, and their helpers compose1 - and compose2. * + and compose2. * - select1st and select2nd, to strip pairs. * + select1st and select2nd, to strip pairs. * project1st and project2nd. * @@ -368,13 +368,13 @@ get_temporary_buffer(5, (int*)0); is_heap tests whether or not a range is a heap. is_sorted tests whether or not a range is sorted in - nondescending order. + nondescending order. 25.3.8 (lexicographical_compare) is extended with lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1, - _InputIter2 first2, _InputIter2 last2) + _InputIter2 first2, _InputIter2 last2) which does... what? @@ -451,41 +451,41 @@ get_temporary_buffer(5, (int*)0); 3.0.x filebufs have another ctor with this signature: - basic_filebuf(__c_file_type*, ios_base::openmode, int_type); + basic_filebuf(__c_file_type*, ios_base::openmode, int_type); - 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: - - __c_file_type* F - // the __c_file_type typedef usually boils down to stdio's FILE - - ios_base::openmode M - // same as all the other uses of openmode - - int_type B - // buffer size, defaults to BUFSIZ if not specified - - - For those wanting to use file descriptors instead of FILE*'s, I - invite you to contemplate the mysteries of C's fdopen(). + 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: + + __c_file_type* F + // the __c_file_type typedef usually boils down to stdio's FILE + + ios_base::openmode M + // same as all the other uses of openmode + + int_type B + // buffer size, defaults to BUFSIZ if not specified + + + For those wanting to use file descriptors instead of FILE*'s, I + invite you to contemplate the mysteries of C's fdopen(). In library snapshot 3.0.95 and later, filebufs bring - back an old extension: the fd() 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 fd() 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. Beginning with 3.1, the extra filebuf constructor and - the fd() function were removed from the standard - filebuf. Instead, <ext/stdio_filebuf.h> contains - a derived class called - __gnu_cxx::stdio_filebuf. - This class can be constructed from a C FILE* or a file - descriptor, and provides the fd() function. + the fd() function were removed from the standard + filebuf. Instead, <ext/stdio_filebuf.h> contains + a derived class called + __gnu_cxx::stdio_filebuf. + This class can be constructed from a C FILE* or a file + descriptor, and provides the fd() function. If you want to access a filebuf's file descriptor to @@ -572,7 +572,7 @@ int main() St13bad_exception => std::bad_exception : 0 - 3barI5emptyLi17EE => bar<empty, 17> : 0 + 3barI5emptyLi17EE => bar<empty, 17> : 0 @@ -586,7 +586,7 @@ int main() - diff --git a/libstdc++-v3/doc/xml/manual/internals.xml b/libstdc++-v3/doc/xml/manual/internals.xml index 04291eb..63664ce 100644 --- a/libstdc++-v3/doc/xml/manual/internals.xml +++ b/libstdc++-v3/doc/xml/manual/internals.xml @@ -1,6 +1,6 @@ - + @@ -73,7 +73,7 @@ OS portion of the triplet (the default), then nothing needs to be changed. The first file to create in this directory, should be called os_defines.h. 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. Several libstdc++ source files unconditionally define the macro @@ -140,7 +140,7 @@ it must be 0 while bootstrapping the compiler/rebuilding the library. this: - + #ifndef _GLIBCXX_OS_DEFINES #define _GLIBCXX_OS_DEFINES @@ -207,7 +207,7 @@ masks. You will have to peer at your own <ctype.h> to figure how to define the values required by this file. - The ctype_base.h header file does not need include guards. + The ctype_base.h header file does not need include guards. It should contain a single struct definition called ctype_base. This struct 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 }; }; @@ -262,14 +262,14 @@ constructor. Here is the IRIX example: ctype<char>::ctype(const mask* __table = 0, bool __del = false, - size_t __refs = 0) + size_t __refs = 0) : _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del), - _M_toupper(NULL), - _M_tolower(NULL), - _M_ctable(NULL), - _M_table(!__table - ? (const mask*) (__libc_attr._ctype_tbl->_class + 1) - : __table) + _M_toupper(NULL), + _M_tolower(NULL), + _M_ctable(NULL), + _M_table(!__table + ? (const mask*) (__libc_attr._ctype_tbl->_class + 1) + : __table) { } @@ -291,7 +291,7 @@ lower-case, and vice versa. Here are the IRIX versions: char ctype<char>::do_toupper(char __c) const { return _toupper(__c); } - + char ctype<char>::do_tolower(char __c) const { return _tolower(__c); } @@ -313,21 +313,21 @@ machinery to do that on your system: ctype<char>::do_toupper(char* __low, const char* __high) const { while (__low < __high) - { - *__low = do_toupper(*__low); - ++__low; - } + { + *__low = do_toupper(*__low); + ++__low; + } return __high; } - + const char* ctype<char>::do_tolower(char* __low, const char* __high) const { while (__low < __high) - { - *__low = do_tolower(*__low); - ++__low; - } + { + *__low = do_tolower(*__low); + ++__low; + } return __high; } @@ -352,7 +352,7 @@ properties; they are analogous to the functions like isalpha and { return (_M_table)[(unsigned char)(__c)] & __m; } -The _M_table is the table passed in above, in the constructor. +The _M_table 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. @@ -366,7 +366,7 @@ implementation here should work on all systems. is(const char* __low, const char* __high, mask* __vec) const throw() { while (__low < __high) - *__vec++ = (_M_table)[(unsigned char)(*__low++)]; + *__vec++ = (_M_table)[(unsigned char)(*__low++)]; return __high; } @@ -385,16 +385,16 @@ from __low up until __high into the vector given by scan_is(mask __m, const char* __low, const char* __high) const throw() { while (__low < __high && !this->is(__m, *__low)) - ++__low; + ++__low; return __low; } - + const char* ctype<char>:: scan_not(mask __m, const char* __low, const char* __high) const throw() { while (__low < __high && this->is(__m, *__low)) - ++__low; + ++__low; return __low; } @@ -454,7 +454,7 @@ type, and two functions. typedef long _Atomic_word; -This type must be a signed integral type supporting atomic operations. +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: Numeric Limits 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 include/bits/std_limits.h. - If you need to define any macros, you can do so in os_defines.h. + If you need to define any macros, you can do so in os_defines.h. 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 cpu_limits.h in your CPU configuration directory (see CPU). @@ -510,7 +510,7 @@ your CPU configuration directory (see CPU). Libtool -The C++ library is compiled, archived and linked with libtool. +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. diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml index 6d53261..cfd8c4f 100644 --- a/libstdc++-v3/doc/xml/manual/intro.xml +++ b/libstdc++-v3/doc/xml/manual/intro.xml @@ -1,11 +1,11 @@ - - + @@ -31,22 +31,22 @@ Implementation Status - - - + - - @@ -57,7 +57,7 @@ License There are two licenses affecting GNU libstdc++: one for the code, - and one for the documentation. + and one for the documentation. @@ -69,7 +69,7 @@ The Code: GPL - + The source code is distributed under the GNU General Public License version 3, @@ -77,7 +77,7 @@ the GCC Runtime Library Exception, version 3.1 as follows (or see the file COPYING.RUNTIME): - + GCC RUNTIME LIBRARY EXCEPTION @@ -152,7 +152,7 @@ The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC. - + Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation. @@ -161,7 +161,7 @@ requirements of the license of GCC. The Documentation: GPL, FDL - + The documentation shipped with the library and made available over the web, excluding the pages generated from source comments, are @@ -170,14 +170,14 @@ requirements of the license of GCC. License version 1.2. There are no Front-Cover Texts, no Back-Cover Texts, and no Invariant Sections. - - + + For documentation generated by doxygen or other automated tools via processing source code comments and markup, the original source code license applies to the generated files. Thus, the doxygen documents are licensed GPL. - + If you plan on making copies of the documentation, please let us know. We can probably offer suggestions. @@ -185,7 +185,7 @@ requirements of the license of GCC. - + @@ -242,590 +242,590 @@ requirements of the license of GCC. 5: - string::compare specification questionable + string::compare specification questionable This should be two overloaded functions rather than a single function. 17: - Bad bool parsing + Bad bool parsing Apparently extracting Boolean values was messed up... 19: - "Noconv" definition too vague + "Noconv" definition too vague If codecvt::do_in returns noconv there are - no changes to the values in [to, to_limit). + no changes to the values in [to, to_limit). 22: - Member open vs flags + Member open vs flags Re-opening a file stream does not clear the state flags. 23: - Num_get overflow result + Num_get overflow result Implement the proposed resolution. 25: - String operator<< uses width() value wrong + String operator<< uses width() value wrong Padding issues. 48: - Use of non-existent exception constructor + Use of non-existent exception constructor An instance of ios_base::failure is constructed instead. 49: - Underspecification of ios_base::sync_with_stdio + Underspecification of ios_base::sync_with_stdio The return type is the previous state of synchronization. 50: - Copy constructor and assignment operator of ios_base + Copy constructor and assignment operator of ios_base These members functions are declared private and are - thus inaccessible. Specifying the correct semantics of - "copying stream state" was deemed too complicated. + thus inaccessible. Specifying the correct semantics of + "copying stream state" was deemed too complicated. 60: - What is a formatted input function? + What is a formatted input function? This DR made many widespread changes to basic_istream - and basic_ostream all of which have been implemented. + and basic_ostream all of which have been implemented. 63: - Exception-handling policy for unformatted output + Exception-handling policy for unformatted output Make the policy consistent with that of formatted input, unformatted - input, and formatted output. + input, and formatted output. 68: - Extractors for char* should store null at end + Extractors for char* should store null at end And they do now. An editing glitch in the last item in the list of - [27.6.1.2.3]/7. + [27.6.1.2.3]/7. 74: - Garbled text for codecvt::do_max_length + Garbled text for codecvt::do_max_length The text of the standard was gibberish. Typos gone rampant. 75: - Contradiction in codecvt::length's argument types + Contradiction in codecvt::length's argument types Change the first parameter to stateT& and implement - the new effects paragraph. + the new effects paragraph. 83: - string::npos vs. string::max_size() + string::npos vs. string::max_size() Safety checks on the size of the string should test against - max_size() rather than npos. + max_size() rather than npos. 90: - Incorrect description of operator>> for strings + Incorrect description of operator>> for strings The effect contain isspace(c,getloc()) which must be - replaced by isspace(c,is.getloc()). + replaced by isspace(c,is.getloc()). 91: - Description of operator>> and getline() for string<> + Description of operator>> and getline() for string<> might cause endless loop They behave as a formatted input function and as an unformatted - input function, respectively (except that getline is + input function, respectively (except that getline is not required to set gcount). 103: - set::iterator is required to be modifiable, but this allows + set::iterator is required to be modifiable, but this allows modification of keys. For associative containers where the value type is the same as - the key type, both iterator and const_iterator + the key type, both iterator and const_iterator are constant iterators. 109: - Missing binders for non-const sequence elements + Missing binders for non-const sequence elements The binder1st and binder2nd didn't have an - operator() taking a non-const parameter. + operator() taking a non-const parameter. 110: - istreambuf_iterator::equal not const + istreambuf_iterator::equal not const This was not a const member function. Note that the DR says to - replace the function with a const one; we have instead provided an - overloaded version with identical contents. + replace the function with a const one; we have instead provided an + overloaded version with identical contents. 117: - basic_ostream uses nonexistent num_put member functions + basic_ostream uses nonexistent num_put member functions num_put::put() was overloaded on the wrong types. 118: - basic_istream uses nonexistent num_get member functions + basic_istream uses nonexistent num_get member functions Same as 117, but for num_get::get(). 129: - Need error indication from seekp() and seekg() + Need error indication from seekp() and seekg() These functions set failbit on error now. 130: - Return type of container::erase(iterator) differs for associative containers + Return type of container::erase(iterator) differs for associative containers - Make member erase return iterator for set, multiset, map, multimap. + Make member erase return iterator for set, multiset, map, multimap. 136: - seekp, seekg setting wrong streams? + seekp, seekg setting wrong streams? seekp should only set the output stream, and - seekg should only set the input stream. + seekg should only set the input stream. 167: - Improper use of traits_type::length() + Improper use of traits_type::length() op<< with a const char* was - calculating an incorrect number of characters to write. + calculating an incorrect number of characters to write. 169: - Bad efficiency of overflow() mandated + Bad efficiency of overflow() mandated Grow efficiently the internal array object. 171: - Strange seekpos() semantics due to joint position + Strange seekpos() semantics due to joint position Quite complex to summarize... 181: - make_pair() unintended behavior + make_pair() unintended behavior This function used to take its arguments as reference-to-const, now - it copies them (pass by value). + it copies them (pass by value). 195: - Should basic_istream::sentry's constructor ever set eofbit? + Should basic_istream::sentry's constructor ever set eofbit? Yes, it can, specifically if EOF is reached while skipping whitespace. 211: - operator>>(istream&, string&) doesn't set failbit + operator>>(istream&, string&) doesn't set failbit If nothing is extracted into the string, op>> now - sets failbit (which can cause an exception, etc., etc.). + sets failbit (which can cause an exception, etc., etc.). 214: - set::find() missing const overload + set::find() missing const overload Both set and multiset were missing - overloaded find, lower_bound, upper_bound, and equal_range functions - for const instances. + overloaded find, lower_bound, upper_bound, and equal_range functions + for const instances. 231: - Precision in iostream? + Precision in iostream? For conversion from a floating-point type, str.precision() - is specified in the conversion specification. + is specified in the conversion specification. 233: - Insertion hints in associative containers + Insertion hints in associative containers Implement N1780, first check before then check after, insert as close - to hint as possible. + to hint as possible. 235: - No specification of default ctor for reverse_iterator + No specification of default ctor for reverse_iterator The declaration of reverse_iterator lists a default constructor. - However, no specification is given what this constructor should do. + However, no specification is given what this constructor should do. 241: - Does unique_copy() require CopyConstructible and Assignable? + Does unique_copy() require CopyConstructible and Assignable? Add a helper for forward_iterator/output_iterator, fix the existing - one for input_iterator/output_iterator to not rely on Assignability. + one for input_iterator/output_iterator to not rely on Assignability. 243: - get and getline when sentry reports failure + get and getline when sentry reports failure Store a null character only if the character array has a non-zero size. 251: - basic_stringbuf missing allocator_type + basic_stringbuf missing allocator_type This nested typedef was originally not specified. 253: - valarray helper functions are almost entirely useless + valarray helper functions are almost entirely useless Make the copy constructor and copy-assignment operator declarations - public in gslice_array, indirect_array, mask_array, slice_array; provide + public in gslice_array, indirect_array, mask_array, slice_array; provide definitions. 265: - std::pair::pair() effects overly restrictive + std::pair::pair() effects overly restrictive The default ctor would build its members from copies of temporaries; - now it simply uses their respective default ctors. + now it simply uses their respective default ctors. 266: - bad_exception::~bad_exception() missing Effects clause + bad_exception::~bad_exception() missing Effects clause The bad_* classes no longer have destructors (they - are trivial), since no description of them was ever given. + are trivial), since no description of them was ever given. 271: - basic_iostream missing typedefs + basic_iostream missing typedefs The typedefs it inherits from its base classes can't be used, since - (for example) basic_iostream<T>::traits_type is ambiguous. + (for example) basic_iostream<T>::traits_type is ambiguous. 275: - Wrong type in num_get::get() overloads + Wrong type in num_get::get() overloads Similar to 118. 280: - Comparison of reverse_iterator to const reverse_iterator + Comparison of reverse_iterator to const reverse_iterator Add global functions with two template parameters. - (NB: not added for now a templated assignment operator) + (NB: not added for now a templated assignment operator) 292: - Effects of a.copyfmt (a) + Effects of a.copyfmt (a) If (this == &rhs) do nothing. 300: - List::merge() specification incomplete + List::merge() specification incomplete If (this == &x) do nothing. 303: - Bitset input operator underspecified + Bitset input operator underspecified - Basically, compare the input character to - is.widen(0) and is.widen(1). + Basically, compare the input character to + is.widen(0) and is.widen(1). 305: - Default behavior of codecvt<wchar_t, char, - mbstate_t>::length() + Default behavior of codecvt<wchar_t, char, + mbstate_t>::length() - Do not specify what codecvt<wchar_t, char, - mbstate_t>::do_length must return. + Do not specify what codecvt<wchar_t, char, + mbstate_t>::do_length must return. 328: - Bad sprintf format modifier in - money_put<>::do_put() + Bad sprintf format modifier in + money_put<>::do_put() Change the format string to "%.0Lf". 365: - Lack of const-qualification in clause 27 + Lack of const-qualification in clause 27 Add const overloads of is_open. 387: - std::complex over-encapsulated + std::complex over-encapsulated Add the real(T) and imag(T) - members; in C++0x mode, also adjust the existing - real() and imag() members and - free functions. + members; in C++0x mode, also adjust the existing + real() and imag() members and + free functions. 389: - Const overload of valarray::operator[] returns - by value + Const overload of valarray::operator[] returns + by value Change it to return a const T&. 396: - what are characters zero and one + what are characters zero and one Implement the proposed resolution. 402: - Wrong new expression in [some_]allocator::construct + Wrong new expression in [some_]allocator::construct Replace "new" with "::new". 408: - - Is vector<reverse_iterator<char*> > forbidden? - + + Is vector<reverse_iterator<char*> > forbidden? + Tweak the debug-mode checks in _Safe_iterator. 409: - Closing an fstream should clear the error state + Closing an fstream should clear the error state Have open clear the error flags. 431: - Swapping containers with unequal allocators + Swapping containers with unequal allocators Implement Option 3, as per N1599. 432: - stringbuf::overflow() makes only one write position + stringbuf::overflow() makes only one write position available Implement the resolution, beyond DR 169. 434: - bitset::to_string() hard to use + bitset::to_string() hard to use Add three overloads, taking fewer template arguments. 438: - Ambiguity in the "do the right thing" clause + Ambiguity in the "do the right thing" clause Implement the resolution, basically cast less. 453: - basic_stringbuf::seekoff need not always fail for an empty stream + basic_stringbuf::seekoff need not always fail for an empty stream Don't fail if the next pointer is null and newoff is zero. 455: - cerr::tie() and wcerr::tie() are overspecified + cerr::tie() and wcerr::tie() are overspecified Initialize cerr tied to cout and wcerr tied to wcout. 464: - Suggestion for new member functions in standard containers + Suggestion for new member functions in standard containers Add data() to std::vector and - at(const key_type&) to std::map. + at(const key_type&) to std::map. 508: - Bad parameters for ranlux64_base_01 + Bad parameters for ranlux64_base_01 Fix the parameters. 512: - Seeding subtract_with_carry_01 from a single unsigned long + Seeding subtract_with_carry_01 from a single unsigned long Construct a linear_congruential engine and seed with it. 526: - Is it undefined if a function in the standard changes in + Is it undefined if a function in the standard changes in parameters? Use &value. 538: - 241 again: Does unique_copy() require CopyConstructible + 241 again: Does unique_copy() require CopyConstructible and Assignable? In case of input_iterator/output_iterator rely on Assignability of - input_iterator' value_type. + input_iterator' value_type. 539: - partial_sum and adjacent_difference should mention - requirements + partial_sum and adjacent_difference should mention + requirements We were almost doing the right thing, just use std::move - in adjacent_difference. + in adjacent_difference. 541: - shared_ptr template assignment and void + shared_ptr template assignment and void Add an auto_ptr<void> specialization. 543: - valarray slice default constructor + valarray slice default constructor Follow the straightforward proposed resolution. 550: - What should the return type of pow(float,int) be? + What should the return type of pow(float,int) be? In C++0x mode, remove the pow(float,int), etc., signatures. 586: - string inserter not a formatted function + string inserter not a formatted function Change it to be a formatted output function (i.e. catch exceptions). 596: - 27.8.1.3 Table 112 omits "a+" and "a+b" modes + 27.8.1.3 Table 112 omits "a+" and "a+b" modes Add the missing modes to fopen_mode. 630: - arrays of valarray + arrays of valarray Implement the simple resolution. 660: - Missing bitwise operations + Missing bitwise operations Add the missing operations. 691: - const_local_iterator cbegin, cend missing from TR1 + const_local_iterator cbegin, cend missing from TR1 In C++0x mode add cbegin(size_type) and cend(size_type) - to the unordered containers. + to the unordered containers. 693: - std::bitset::all() missing + std::bitset::all() missing Add it, consistently with the discussion. 695: - ctype<char>::classic_table() not accessible + ctype<char>::classic_table() not accessible Make the member functions table and classic_table public. 696: - istream::operator>>(int&) broken + istream::operator>>(int&) broken Implement the straightforward resolution. 761: - unordered_map needs an at() member function + unordered_map needs an at() member function In C++0x mode, add at() and at() const. 775: - Tuple indexing should be unsigned? + Tuple indexing should be unsigned? Implement the int -> size_t replacements. 776: - Undescribed assign function of std::array + Undescribed assign function of std::array In C++0x mode, remove assign, add fill. 781: - std::complex should add missing C99 functions + std::complex should add missing C99 functions In C++0x mode, add std::proj. 809: - std::swap should be overloaded for array types + std::swap should be overloaded for array types Add the overload. 844: - complex pow return type is ambiguous + complex pow return type is ambiguous In C++0x mode, remove the pow(complex<T>, int) signature. 853: - to_string needs updating with zero and one + to_string needs updating with zero and one Update / add the signatures. 865: - More algorithms that throw away information + More algorithms that throw away information The traditional HP / SGI return type and value is blessed - by the resolution of the DR. + by the resolution of the DR. - + @@ -859,12 +859,12 @@ requirements of the license of GCC. - - diff --git a/libstdc++-v3/doc/xml/manual/io.xml b/libstdc++-v3/doc/xml/manual/io.xml index b2051b4..13a1d7a 100644 --- a/libstdc++-v3/doc/xml/manual/io.xml +++ b/libstdc++-v3/doc/xml/manual/io.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,15 +15,15 @@ library - + Input and Output <indexterm><primary>Input and Output</primary></indexterm> - - + + Iostream Objects @@ -46,8 +46,8 @@ class MyClass { - .... - std::ifstream& input_file; + .... + std::ifstream& input_file; }; extern std::ostream& operator<< (std::ostream&, MyClass&); @@ -115,19 +115,19 @@ namespace std { - extern istream cin; - extern ostream cout; - .... + extern istream cin; + extern ostream cout; + .... - // this is explained below - static ios_base::Init __foo; // not its real name + // this is explained below + static ios_base::Init __foo; // not its real name } Now, the runtime penalty mentioned previously: the global objects must be initialized before any of your own code uses them; this is guaranteed by the standard. Like any other global object, they must be initialized once and only once. This is typically done with a - construct like the one above, and the nested class ios_base::Init is + construct like the one above, and the nested class ios_base::Init is specified in the standard for just this reason. How does it work? Because the header is included before any of your @@ -157,14 +157,14 @@ compile times will go down when there's less parsing work to do. - + - - + + Stream Buffers - + Derived streambuf Classes @@ -227,11 +227,11 @@ Streambufs. - + - + Buffering - First, are you sure that you understand buffering? Particularly + First, are you sure that you understand buffering? Chaptericularly the fact that C++ may not, in fact, have anything to do with it? The rules for buffering can be a little odd, but they aren't any @@ -261,8 +261,8 @@ output << "a line of text\n" - << some_data_variable << '\n' - << "another line of text\n"; + << some_data_variable << '\n' + << "another line of text\n"; I have also joined the output statements into a single statement. You could make the code prettier by moving the single newline to the start of the quoted text on the last line, for example. @@ -275,7 +275,7 @@ output << ...... << flush; // can use std::flush manipulator output.flush(); // or call a member fn On the other hand, there are times when writing to a file should - be like writing to standard error; no buffering should be done + be like writing to standard error; no buffering should be done because the data needs to appear quickly (a prime example is a log file for security-related information). The way to do this is just to turn off the buffering before any I/O operations at @@ -296,14 +296,14 @@ is >> i; // and this will probably cause a disk read Since all aspects of buffering are handled by a streambuf-derived member, it is necessary to get at that member with rdbuf(). - Then the public version of setbuf can be called. The + Then the public version of setbuf can be called. The arguments are the same as those for the Standard C I/O Library function (a buffer area followed by its size). A great deal of this is implementation-dependent. For example, - streambuf does not specify any actions for its own + streambuf does not specify any actions for its own setbuf()-ish functions; the classes derived from - streambuf each define behavior that "makes + streambuf each define behavior that "makes sense" for that class: an argument of (0,0) turns off buffering for filebuf but does nothing at all for its siblings stringbuf and strstreambuf, and specifying @@ -320,21 +320,21 @@ changing those are system-dependent. - - + + - - + + Memory Based Streams - + Compatibility With strstream Stringstreams (defined in the header <sstream>) are in this author's opinion one of the coolest things since sliced time. An example of their use is in the Received Wisdom - section for Chapter 21 (Strings), + section for Sect1 21 (Strings), describing how to format strings. @@ -367,15 +367,15 @@ - - + + - - + + File Based Streams - + Copying a File @@ -406,7 +406,7 @@ Seriously, go do it. Get surprised, then come back. It's worth it. The thing to remember is that the basic_[io]stream classes - handle formatting, nothing else. In particular, they break up on + handle formatting, nothing else. In chaptericular, they break up on whitespace. The actual reading, writing, and storing of data is handled by the basic_streambuf family. Fortunately, the operator<< is overloaded to take an ostream and @@ -416,7 +416,7 @@ Why a pointer to streambuf and not just a streambuf? Well, the [io]streams hold pointers (or references, depending on the implementation) to their buffers, not the actual - buffers. This allows polymorphic behavior on the part of the buffers + buffers. This allows polymorphic behavior on the chapter of the buffers as well as the streams themselves. The pointer is easily retrieved using the rdbuf() member function. Therefore, the easiest way to copy the file is: @@ -424,7 +424,7 @@ OUT << IN.rdbuf(); So what was happening with OUT<<IN? Undefined - behavior, since that particular << isn't defined by the Standard. + behavior, since that chaptericular << isn't defined by the Standard. I have seen instances where it is implemented, but the character extraction process removes all the whitespace, leaving you with no blank lines and only "Thequickbrownfox...". With @@ -433,15 +433,15 @@ file then contains a perfect text representation of a hexadecimal address (quite a big surprise). Others don't compile at all. - Also note that none of this is specific to o*f*streams. - The operators shown above are all defined in the parent + Also note that none of this is specific to o*f*streams. + The operators shown above are all defined in the parent basic_ostream class and are therefore available with all possible descendants. - + - + Binary Input and Output @@ -468,12 +468,12 @@ under Windows won't accidentally get mapped to a '\n' character, etc. Binary mode is not supposed to suddenly give you a bitstream, and if it is doing so in your program then you've discovered a bug in - your vendor's compiler (or some other part of the C++ implementation, + your vendor's compiler (or some other chapter of the C++ implementation, possibly the runtime system). Second, using << to write and >> to read isn't going to work with the standard file stream classes, even - if you use skipws during reading. Why not? Because + if you use skipws during reading. Why not? Because ifstream and ofstream exist for the purpose of formatting, not reading and writing. Their job is to interpret the data into text characters, and that's exactly what you don't want to happen @@ -492,14 +492,14 @@ Derive your own fstream-type classes and write your own - <</>> operators to do binary I/O on whatever data - types you're using. + <</>> operators to do binary I/O on whatever data + types you're using. This is a Bad Thing, because while - the compiler would probably be just fine with it, other humans - are going to be confused. The overloaded bitshift operators - have a well-defined meaning (formatting), and this breaks it. + the compiler would probably be just fine with it, other humans + are going to be confused. The overloaded bitshift operators + have a well-defined meaning (formatting), and this breaks it. @@ -521,10 +521,10 @@ Use streambufs, that's what they're there for. - While not trivial for the beginner, this is the best of all - solutions. The streambuf/filebuf layer is the layer that is - responsible for actual I/O. If you want to use the C++ - library for binary I/O, this is where you start. + While not trivial for the beginner, this is the best of all + solutions. The streambuf/filebuf layer is the layer that is + responsible for actual I/O. If you want to use the C++ + library for binary I/O, this is where you start. @@ -552,7 +552,7 @@ Another area of problems is opening text files in binary mode. Generally, binary mode is intended for binary files, and opening - text files in binary mode means that you now have to deal with all of + text files in binary mode means that you now have to deal with all of those end-of-line and end-of-file problems that we mentioned before. @@ -569,17 +569,17 @@ invocation of a program to another invocation of the same program on a different platform, etc. - + - + - - + + Interacting with C - + Using FILE* and file descriptors See the extensions for using @@ -587,9 +587,9 @@ ofstream and ifstream. - + - + Performance Pathetic Performance? Ditch C. @@ -641,13 +641,13 @@ Note, by the way, that the synchronization requirement only applies to the standard streams (cin, cout, cerr, - clog, and their wide-character counterparts). File stream + clog, and their wide-character counterchapters). File stream objects that you declare yourself have no such requirement and are fully buffered. - - + + - + diff --git a/libstdc++-v3/doc/xml/manual/iterators.xml b/libstdc++-v3/doc/xml/manual/iterators.xml index e351b61..86b92a4 100644 --- a/libstdc++-v3/doc/xml/manual/iterators.xml +++ b/libstdc++-v3/doc/xml/manual/iterators.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,18 +15,18 @@ library - + Iterators <indexterm><primary>Iterators</primary></indexterm> - - + + Predefined - + Iterators vs. Pointers 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. - Keeping that simple fact in mind as you design your code will + + Keeping that simple fact in mind as you design your code will prevent a whole lot of difficult-to-understand bugs. - You can think of it the other way 'round, even. Since iterators - are a generalization, that means that pointers are - iterators, 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. - - 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). - - How much overhead is there when using an iterator class? - Very little. Most of the layering classes contain nothing but - typedefs, and typedefs are "meta-information" 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.) - - + + You can think of it the other way 'round, even. Since iterators + are a generalization, that means + that pointers are + iterators, 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. + + + 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). + + + How much overhead is there when using an + iterator class? Very little. Most of the layering classes + contain nothing but typedefs, and typedefs are + "meta-information" 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.) + + - + - + One Past the End This starts off sounding complicated, but is actually very easy, @@ -85,23 +91,23 @@ classes. You can point anywhere in the array, or to the first element - past the end of the array. 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. 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. 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. 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. @@ -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 - See? Everything between the boundary markers is part of the array. + See? Everything between the boundary markers is chapter of the array. Simple. Now think back to your junior-high school algebra course, when you @@ -175,9 +181,9 @@ classes. Just don't dereference end(). - - + + - + - + diff --git a/libstdc++-v3/doc/xml/manual/locale.xml b/libstdc++-v3/doc/xml/manual/locale.xml index a4ec77c..234439a 100644 --- a/libstdc++-v3/doc/xml/manual/locale.xml +++ b/libstdc++-v3/doc/xml/manual/locale.xml @@ -1,6 +1,6 @@ - +
- + ISO C++ @@ -9,7 +9,7 @@ locale - + locale @@ -19,7 +19,7 @@ classes id, facet, and the reference-counted implementation object, class _Impl. - +
Requirements @@ -87,9 +87,9 @@ class id Provides an index for looking up specific facets. - +
- +
Design @@ -103,12 +103,12 @@ Because C and earlier versions of POSIX fall down so completely, portability is an issue. - +
- +
Implementation - +
Interacting with "C" locales @@ -467,10 +467,10 @@ global locale" (emphasis Paolo), that is: practice, the set of LC_ALL, LANG, etc. variable of the shell. - - +
+
- +
Future @@ -508,7 +508,7 @@ global locale" (emphasis Paolo), that is: - +
Bibliography @@ -634,4 +634,4 @@ global locale" (emphasis Paolo), that is: - +
diff --git a/libstdc++-v3/doc/xml/manual/localization.xml b/libstdc++-v3/doc/xml/manual/localization.xml index 690ce3c..7089854 100644 --- a/libstdc++-v3/doc/xml/manual/localization.xml +++ b/libstdc++-v3/doc/xml/manual/localization.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,45 +15,45 @@ library - + Localization <indexterm><primary>Localization</primary></indexterm> - - + +
Locales - - +
- - + +
- Facets aka Categories + Facets - - - - +
- + -
+ diff --git a/libstdc++-v3/doc/xml/manual/messages.xml b/libstdc++-v3/doc/xml/manual/messages.xml index 94ef4dc..f0428d4 100644 --- a/libstdc++-v3/doc/xml/manual/messages.xml +++ b/libstdc++-v3/doc/xml/manual/messages.xml @@ -1,7 +1,7 @@ - +
- + ISO C++ @@ -10,7 +10,7 @@ messages - + messages @@ -20,7 +20,7 @@ equivalent to Java's java.text.MessageFormat .using either GNU gettext or IEEE 1003.1-200 functions. - +
Requirements @@ -106,9 +106,9 @@ be found, returns dfault. - +
- +
Design @@ -155,12 +155,12 @@ to be written in English, so translations are always from "en_US" to other, explicitly named locales. - +
- +
Implementation - +
Models 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. - +
- +
The GNU Model @@ -318,10 +318,10 @@ model. - - +
+
- +
Use A simple example using the GNU model of message conversion. @@ -349,9 +349,9 @@ void test01() } - +
- +
Future @@ -436,7 +436,7 @@ void test01() - +
Bibliography @@ -585,4 +585,4 @@ Library and Tools. - +
diff --git a/libstdc++-v3/doc/xml/manual/mt_allocator.xml b/libstdc++-v3/doc/xml/manual/mt_allocator.xml index 55ba0e4..ba93b10 100644 --- a/libstdc++-v3/doc/xml/manual/mt_allocator.xml +++ b/libstdc++-v3/doc/xml/manual/mt_allocator.xml @@ -1,6 +1,6 @@ - + @@ -20,7 +20,7 @@ Intro - + 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. -The datum describing pools characteristics is +The datum describing pools characteristics is template<bool _Thread> @@ -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: -- 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). @@ -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->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; - 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->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->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; @@ -368,7 +368,7 @@ This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes): 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). @@ -377,28 +377,28 @@ When the application requests memory (calling allocate()) we first look at the requested size and if this is > _S_max_bytes we call new() directly and return. -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. 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. -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. 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 ]). @@ -414,8 +414,8 @@ faster than maintaining a set of "last pointers" as well. Multiple Thread Example -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. @@ -454,12 +454,12 @@ directly and return. -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. -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). diff --git a/libstdc++-v3/doc/xml/manual/numerics.xml b/libstdc++-v3/doc/xml/manual/numerics.xml index 1385314..379e83c 100644 --- a/libstdc++-v3/doc/xml/manual/numerics.xml +++ b/libstdc++-v3/doc/xml/manual/numerics.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,20 +15,20 @@ library - + Numerics <indexterm><primary>Numerics</primary></indexterm> - - + + Complex - + complex Processing @@ -49,11 +49,11 @@ (u), and (u,v). - - + +
- - + + Generalized Operations @@ -68,7 +68,7 @@ accumulate inner_product - partial_sum + chapterial_sum adjacent_difference Here is a simple example of the two forms of accumulate. @@ -93,14 +93,14 @@ The other three functions have similar dual-signature forms. - +
- - + + Interacting with C - + Numerics vs. Arrays One of the major reasons why FORTRAN can chew through numbers so well @@ -121,9 +121,9 @@ libraries before. - + - + C99 In addition to the other topics on this page, we'll note here some @@ -143,7 +143,7 @@ wcstoll. - - + + - + diff --git a/libstdc++-v3/doc/xml/manual/parallel_mode.xml b/libstdc++-v3/doc/xml/manual/parallel_mode.xml index 96eb93c..fbc2ed1 100644 --- a/libstdc++-v3/doc/xml/manual/parallel_mode.xml +++ b/libstdc++-v3/doc/xml/manual/parallel_mode.xml @@ -1,11 +1,11 @@ - - + @@ -115,7 +115,7 @@ It might work with other compilers, though. flag -fopenmp. This will link in libgomp, the GNU OpenMP implementation, - whose presence is mandatory. + whose presence is mandatory. @@ -635,7 +635,7 @@ For the following algorithms in general, we have __gnu_parallel::parallel_tag and __gnu_parallel::default_parallel_tag, in addition to __gnu_parallel::sequential_tag. -__gnu_parallel::default_parallel_tag chooses the default +__gnu_parallel::default_parallel_tag chooses the default algorithm at compiletime, as does omitting the tag. __gnu_parallel::parallel_tag postpones the decision to runtime (see next section). @@ -654,7 +654,7 @@ Exact and sampling are the two available splitting strategies. For the sort and stable_sort algorithms, there are several additional choices, namely __gnu_parallel::multiway_mergesort_tag, -__gnu_parallel::multiway_mergesort_exact_tag, +__gnu_parallel::multiway_mergesort_exact_tag, __gnu_parallel::multiway_mergesort_sampling_tag, __gnu_parallel::quicksort_tag, and __gnu_parallel::balanced_quicksort_tag. @@ -767,7 +767,7 @@ explicitly sequential: Two namespaces contain the parallel mode: -std::__parallel and __gnu_parallel. +std::__parallel and __gnu_parallel. Parallel implementations of standard components, including @@ -794,12 +794,12 @@ the generated source documentation. Testing - + Both the normal conformance and regression tests and the supplemental performance tests work. - + To run the conformance and regression tests with the parallel mode active, @@ -807,13 +807,13 @@ the generated source documentation. make check-parallel - + The log and summary files for conformance testing are in the testsuite/parallel directory. - + To run the performance tests with the parallel mode active, @@ -859,7 +859,7 @@ the generated source documentation. Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS) - + @@ -889,7 +889,7 @@ the generated source documentation. Euro-Par 2007: Parallel Processing. (LNCS 4641) </publishername> </publisher> - </biblioentry> + </biblioentry> </bibliography> diff --git a/libstdc++-v3/doc/xml/manual/prerequisites.xml b/libstdc++-v3/doc/xml/manual/prerequisites.xml index 12ed2bc..cdfe6cc 100644 --- a/libstdc++-v3/doc/xml/manual/prerequisites.xml +++ b/libstdc++-v3/doc/xml/manual/prerequisites.xml @@ -1,6 +1,6 @@ <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> diff --git a/libstdc++-v3/doc/xml/manual/profile_mode.xml b/libstdc++-v3/doc/xml/manual/profile_mode.xml index 32d38a6..a361c81 100644 --- a/libstdc++-v3/doc/xml/manual/profile_mode.xml +++ b/libstdc++-v3/doc/xml/manual/profile_mode.xml @@ -1,11 +1,11 @@ <?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.profile_mode" xreflabel="Profile Mode"> <?dbhtml filename="profile_mode.html"?> - + <chapterinfo> <keywordset> <keyword> @@ -35,7 +35,7 @@ calls to an instrumentation library to record the internal state of various components at interesting entry/exit points to/from the standard library. Process trace, recognize suboptimal patterns, give advice. - For details, see + For details, see <ulink url="http://dx.doi.org/10.1109/CGO.2009.36">paper presented at CGO 2009</ulink>. </para> @@ -43,7 +43,7 @@ <emphasis>Strengths: </emphasis> <itemizedlist> <listitem><para> - Unintrusive solution. The application code does not require any + Unintrusive solution. The application code does not require any modification. </para></listitem> <listitem><para> The advice is call context sensitive, thus capable of @@ -178,7 +178,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... <listitem><para>_GLIBCXX_PROFILE_MAX_WARN_COUNT: set it to the maximum number of warnings desired. The default value is 10.</para></listitem> <listitem><para> - <code>_GLIBCXX_PROFILE_MAX_STACK_DEPTH</code>: if set to 0, + <code>_GLIBCXX_PROFILE_MAX_STACK_DEPTH</code>: if set to 0, the advice will be collected and reported for the program as a whole, and not for each call context. @@ -196,7 +196,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... </para></listitem> <listitem><para> <code>_GLIBCXX_PROFILE_NO_THREADS</code>: - Make the library not use threads. If thread local storage (TLS) is not + Make the library not use threads. If thread local storage (TLS) is not available, you will get a preprocessor error asking you to set -D_GLIBCXX_PROFILE_NO_THREADS if your program is single-threaded. Multithreaded execution without TLS is not supported. @@ -258,7 +258,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... <para> </para> -<sect2 id="manual.ext.profile_mode.design.wrapper" +<sect2 id="manual.ext.profile_mode.design.wrapper" xreflabel="Wrapper"> <title>Wrapper Model @@ -267,13 +267,13 @@ vector-size: improvement = 3: call stack = 0x804842c ... we use the same wrapper model as the debug mode. We subclass entities from the release version. Wherever _GLIBCXX_PROFILE is defined, the release namespace is - std::__norm, whereas the profile namespace is + std::__norm, whereas the profile namespace is std::__profile. Using plain std translates into std::__profile. Whenever possible, we try to wrap at the public interface level, e.g., - in unordered_set rather than in hashtable, + in unordered_set rather than in hashtable, in order not to depend on implementation. @@ -288,20 +288,20 @@ vector-size: improvement = 3: call stack = 0x804842c ... - Instrumentation Instead of instrumenting every public entry and exit point, we chose to add instrumentation on demand, as needed by individual diagnostics. - The main reason is that some diagnostics require us to extract bits of + The main reason is that some diagnostics require us to extract bits of internal state that are particular only to that diagnostic. We plan to formalize this later, after we learn more about the requirements of several diagnostics. - All the instrumentation points can be switched on and off using + All the instrumentation points can be switched on and off using -D[_NO]_GLIBCXX_PROFILE_<diagnostic> options. With all the instrumentation calls off, there should be negligible overhead over the release version. This property is needed to support @@ -310,13 +310,13 @@ vector-size: improvement = 3: call stack = 0x804842c ... profiling overhead from polluting time measurements, and thus diagnostics. - All the instrumentation on/off compile time switches live in + All the instrumentation on/off compile time switches live in include/profile/profiler.h. - Run Time Behavior @@ -338,7 +338,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... - For details, see + For details, see paper presented at CGO 2009. @@ -364,7 +364,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... xreflabel="Cost Model"> Cost Model - While it is likely that cost models become complex as we get into + While it is likely that cost models become complex as we get into more sophisticated analysis, we will try to follow a simple set of rules at the beginning. @@ -393,7 +393,7 @@ vector-size: improvement = 3: call stack = 0x804842c ... Show stoppers: We may decide that the presence of an operation nullifies the advice. - For instance, when considering switching from set to + For instance, when considering switching from set to unordered_set, if we detect use of operator ++, we will simply not issue the advice, since this could signal that the use care require a sorted container. @@ -536,9 +536,9 @@ it helps the user focus on the key problems and ignore the uninteresting ones. xreflabel="Using the Standard Library in the Runtime Library"> Using the Standard Library in the Instrumentation Implementation - As much as we would like to avoid uses of libstdc++ within our - instrumentation library, containers such as unordered_map are very - appealing. We plan to use them as long as they are named properly + As much as we would like to avoid uses of libstdc++ within our + instrumentation library, containers such as unordered_map are very + appealing. We plan to use them as long as they are named properly to avoid ambiguity. @@ -573,7 +573,7 @@ it helps the user focus on the key problems and ignore the uninteresting ones. The profiling library state is initialized at the first call to a profiling method. This allows us to record the construction of all global objects. However, we cannot do the same at destruction time. The trace is written - by a function registered by atexit, thus invoked by + by a function registered by atexit, thus invoked by exit. @@ -590,21 +590,21 @@ it helps the user focus on the key problems and ignore the uninteresting ones. Big Picture The profile mode headers are included with - -D_GLIBCXX_PROFILE through preprocessor directives in + -D_GLIBCXX_PROFILE through preprocessor directives in include/std/*. - Instrumented implementations are provided in + Instrumented implementations are provided in include/profile/*. All instrumentation hooks are macros defined in include/profile/profiler.h. - All the implementation of the instrumentation hooks is in + All the implementation of the instrumentation hooks is in include/profile/impl/*. Although all the code gets included, thus is publicly visible, only a small number of functions are called from outside this directory. All calls to hook implementations must be done through macros defined in profiler.h. The macro - must ensure (1) that the call is guarded against reentrance and + must ensure (1) that the call is guarded against reentrance and (2) that the call can be turned off at compile time using a -D_GLIBCXX_PROFILE_... compiler option. @@ -618,7 +618,7 @@ it helps the user focus on the key problems and ignore the uninteresting ones. Let's say the diagnostic name is "magic". - If you need to instrument a header not already under + If you need to instrument a header not already under include/profile/*, first edit the corresponding header under include/std/ and add a preprocessor directive such as the one in include/std/vector: @@ -670,7 +670,7 @@ it helps the user focus on the key problems and ignore the uninteresting ones. This defines the content of a line in the stack table. - Define class __trace_magic: public __trace_base<__magic_info, + Define class __trace_magic: public __trace_base<__magic_info, __magic_stack_info>. It defines the content of the trace associated with this diagnostic. @@ -696,7 +696,7 @@ it helps the user focus on the key problems and ignore the uninteresting ones. -D_GLIBCXX_PROFILE_<diagnostic>. Groups of related diagnostics can be turned on with a single switch. For instance, -D_GLIBCXX_PROFILE_LOCALITY is equivalent to - -D_GLIBCXX_PROFILE_SOFTWARE_PREFETCH + -D_GLIBCXX_PROFILE_SOFTWARE_PREFETCH -D_GLIBCXX_PROFILE_RBTREE_LOCALITY. @@ -881,7 +881,7 @@ it helps the user focus on the key problems and ignore the uninteresting ones. - Diagnostic Template @@ -915,7 +915,7 @@ advice sample - Containers @@ -924,14 +924,14 @@ advice sample _GLIBCXX_PROFILE_CONTAINERS. - Hashtable Too Small Switch: _GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL. - Goal: Detect hashtables with many + Goal: Detect hashtables with many rehash operations, small construction size and large destruction size. Fundamentals: Rehash is very expensive. @@ -940,10 +940,10 @@ advice sample Sample runtime reduction: 36%. Code similar to example below. - Recommendation: + Recommendation: Set initial size to N at construction site S. - To instrument: + To instrument: unordered_set, unordered_map constructor, destructor, rehash. Analysis: @@ -953,7 +953,7 @@ advice sample Record the estimated rehash cost. Cost model: Number of individual rehash operations * cost per rehash. - Example: + Example: 1 unordered_set<int> us; 2 for (int k = 0; k < 1000000; ++k) { @@ -967,7 +967,7 @@ foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1 - Hashtable Too Large @@ -983,10 +983,10 @@ foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1 fewer cache and TLB misses. Sample runtime reduction: unknown. - Recommendation: + Recommendation: Set initial size to N at construction site S. - To instrument: + To instrument: unordered_set, unordered_map constructor, destructor, rehash. Analysis: @@ -996,7 +996,7 @@ foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1 Cost model: Number of iteration operations + memory saved. - Example: + Example: 1 vector<unordered_set<int>> v(100000, unordered_set<int>(100)) ; 2 for (int k = 0; k < 100000; ++k) { @@ -1022,7 +1022,7 @@ bytes of memory and M iteration steps. Goal: Detect hashtables with polarized distribution. - Fundamentals: A non-uniform + Fundamentals: A non-uniform distribution may lead to long chains, thus possibly increasing complexity by a factor up to the number of elements. @@ -1042,7 +1042,7 @@ bytes of memory and M iteration steps. Cost model: Total number of links traversed. - Example: + Example: class dumb_hash { public: @@ -1059,14 +1059,14 @@ class dumb_hash { - Vector Too Small Switch: _GLIBCXX_PROFILE_VECTOR_TOO_SMALL. - Goal:Detect vectors with many + Goal:Detect vectors with many resize operations, small construction size and large destruction size.. Fundamentals:Resizing can be expensive. @@ -1081,26 +1081,26 @@ class dumb_hash { Analysis: For each dynamic instance of vector, record initial size and call context of the constructor. - Record size increase, if any, after each relevant operation such as + Record size increase, if any, after each relevant operation such as push_back. Record the estimated resize cost. Cost model: Total number of words copied * time to copy a word. - Example: + Example: 1 vector<int> v; 2 for (int k = 0; k < 1000000; ++k) { 3 v.push_back(k); 4 } -foo.cc:1: advice: Changing initial vector size from 10 to 1000000 saves +foo.cc:1: advice: Changing initial vector size from 10 to 1000000 saves copying 4000000 bytes and 20 memory allocations and deallocations. - Vector Too Large @@ -1126,7 +1126,7 @@ copying 4000000 bytes and 20 memory allocations and deallocations. with its size at destruction time. Cost model: Total amount of memory saved. - Example: + Example: 1 vector<vector<int>> v(100000, vector<int>(100)) ; 2 for (int k = 0; k < 100000; ++k) { @@ -1142,14 +1142,14 @@ bytes of memory and may reduce the number of cache and TLB misses. - Vector to Hashtable Switch: _GLIBCXX_PROFILE_VECTOR_TO_HASHTABLE. - Goal: Detect uses of + Goal: Detect uses of vector that can be substituted with unordered_set to reduce execution time. @@ -1159,7 +1159,7 @@ bytes of memory and may reduce the number of cache and TLB misses. Sample runtime reduction:factor up to container size. - Recommendation:Replace + Recommendation:Replace vector with unordered_set at site S. To instrument:vector @@ -1167,7 +1167,7 @@ bytes of memory and may reduce the number of cache and TLB misses. Analysis: For each dynamic instance of vector, record call context of the constructor. Issue the advice only if the - only methods called on this vector are push_back, + only methods called on this vector are push_back, insert and find. Cost model: @@ -1189,14 +1189,14 @@ comparisons. - Hashtable to Vector Switch: _GLIBCXX_PROFILE_HASHTABLE_TO_VECTOR. - Goal: Detect uses of + Goal: Detect uses of unordered_set that can be substituted with vector to reduce execution time. @@ -1204,7 +1204,7 @@ comparisons. Hashtable iterator is slower than vector iterator. Sample runtime reduction:95%. - Recommendation:Replace + Recommendation:Replace unordered_set with vector at site S. To instrument:unordered_set @@ -1212,7 +1212,7 @@ comparisons. Analysis: For each dynamic instance of unordered_set, record call context of the constructor. Issue the advice only if the - number of find, insert and [] + number of find, insert and [] operations on this unordered_set are small relative to the number of elements, and methods begin or end are invoked (suggesting iteration). @@ -1241,12 +1241,12 @@ indirections and may achieve better data locality. Switch: _GLIBCXX_PROFILE_VECTOR_TO_LIST. - Goal: Detect cases where + Goal: Detect cases where vector could be substituted with list for better performance. Fundamentals: - Inserting in the middle of a vector is expensive compared to inserting in a + Inserting in the middle of a vector is expensive compared to inserting in a list. Sample runtime reduction:factor up to @@ -1266,14 +1266,14 @@ indirections and may achieve better data locality. (Sum(cost(vector::method)) - Sum(cost(list::method)), for method in [push_back, insert, erase]) + (Cost(iterate vector) - Cost(iterate list)) - Example: + Example: 1 vector<int> v; 2 for (int i = 0; i < 10000; ++i) { 3 v.insert(v.begin(), i); 4 } -foo.cc:1: advice: Changing "vector" to "list" will save about 5,000,000 +foo.cc:1: advice: Changing "vector" to "list" will save about 5,000,000 operations. @@ -1287,7 +1287,7 @@ operations. Switch: _GLIBCXX_PROFILE_LIST_TO_VECTOR. - Goal: Detect cases where + Goal: Detect cases where list could be substituted with vector for better performance. @@ -1307,7 +1307,7 @@ operations. (Sum(cost(vector::method)) - Sum(cost(list::method)), for method in [push_back, insert, erase]) + (Cost(iterate vector) - Cost(iterate list)) - Example: + Example: 1 list<int> l; ... @@ -1330,7 +1330,7 @@ memory references. Switch: _GLIBCXX_PROFILE_LIST_TO_SLIST. - Goal: Detect cases where + Goal: Detect cases where list could be substituted with forward_list for better performance. @@ -1354,7 +1354,7 @@ memory references. Cost model: Always true. - Example: + Example: 1 list<int> l; ... @@ -1380,7 +1380,7 @@ foo.cc:1: advice: Change "list" to "forward_list". associative containers can be replaced with unordered ones. Fundamentals: - Insert and search are quicker in a hashtable than in + Insert and search are quicker in a hashtable than in a red-black tree. Sample runtime reduction:52%. @@ -1436,9 +1436,9 @@ foo.cc:1: advice: Change "list" to "forward_list". Quick Sort for a particular call context. Fundamentals: - See papers: + See papers: - A framework for adaptive algorithm selection in STAPL and + A framework for adaptive algorithm selection in STAPL and Optimizing Sorting with Machine Learning Algorithms. @@ -1450,7 +1450,7 @@ foo.cc:1: advice: Change "list" to "forward_list". algorithm. Analysis: Issue the advice if the cost model tells us that another sort algorithm - would do better on this input. Requires us to know what algorithm we + would do better on this input. Requires us to know what algorithm we are using in our sort implementation in release mode. Cost model: Runtime(algo) for algo in [radix, quick, merge, ...] @@ -1488,7 +1488,7 @@ foo.cc:1: advice: Change "list" to "forward_list". miss in caches. Sample runtime reduction:25%. - Recommendation: Insert prefetch + Recommendation: Insert prefetch instruction. To instrument: Vector iterator and access operator []. @@ -1496,7 +1496,7 @@ foo.cc:1: advice: Change "list" to "forward_list". Analysis: First, get cache line size and page size from system. Then record iterator dereference sequences for which the value is a pointer. - For each sequence within a container, issue a warning if successive pointer + For each sequence within a container, issue a warning if successive pointer addresses are not within cache lines and do not form a linear pattern (otherwise they may be prefetched by hardware). If they also step across page boundaries, make the warning stronger. @@ -1510,14 +1510,14 @@ foo.cc:1: advice: Change "list" to "forward_list". This analysis is a little oversimplified. A better cost model could be created by understanding the capability of the hardware prefetcher. - This model could be trained automatically by running a set of synthetic + This model could be trained automatically by running a set of synthetic cases. Cost model: Total distance between pointer values of successive elements in vectors of pointers. - Example: + Example: 1 int zero = 0; 2 vector<int*> v(10000000, &zero); @@ -1547,7 +1547,7 @@ foo.cc:7: advice: Insert prefetch instruction. Fundamentals:Allocation can be tuned to a specific traversal pattern, to result in better data locality. - See paper: + See paper: Custom Memory Allocation for Free. @@ -1557,7 +1557,7 @@ foo.cc:7: advice: Insert prefetch instruction. High scatter score N for container built at site S. Consider changing allocation sequence or choosing a structure conscious allocator. - To instrument: Methods of all + To instrument: Methods of all containers using linked structures. Analysis: First, get cache line size and page size from system. @@ -1639,7 +1639,7 @@ the allocation sequence or switching to a structure conscious allocator. container member accesses. Issue advice for elements referenced by multiple threads. See paper: - The LRPD test: speculative run-time parallelization of loops with + The LRPD test: speculative run-time parallelization of loops with privatization and reduction parallelization. Cost model: @@ -1660,7 +1660,7 @@ the allocation sequence or switching to a structure conscious allocator. _GLIBCXX_PROFILE_FALSE_SHARING. Goal: Detect elements in the - same container which share a cache line, are written by at least one + same container which share a cache line, are written by at least one thread, and accessed by different threads. Fundamentals: Under these assumptions, @@ -1676,16 +1676,16 @@ the allocation sequence or switching to a structure conscious allocator. Analysis: First, get the cache line size. - For each shared container, record all the associated iterator dereferences + For each shared container, record all the associated iterator dereferences and member access methods with the thread id. Compare the address lists - across threads to detect references in two different threads to the same - cache line. Issue a warning only if the ratio to total references is - significant. Do the same for iterator dereference values if they are + across threads to detect references in two different threads to the same + cache line. Issue a warning only if the ratio to total references is + significant. Do the same for iterator dereference values if they are pointers. Cost model: Number of accesses to same cache line from different threads. - Example: + Example: 1 vector<int> v(2, 0); 2 #pragma omp parallel for shared(v, SIZE) schedule(static, 1) @@ -1694,7 +1694,7 @@ the allocation sequence or switching to a structure conscious allocator. 5 } OMP_NUM_THREADS=2 ./a.out -foo.cc:1: advice: Change container structure or padding to avoid false +foo.cc:1: advice: Change container structure or padding to avoid false sharing in multithreaded access at foo.cc:4. Detected N shared cache lines. @@ -1704,7 +1704,7 @@ sharing in multithreaded access at foo.cc:4. Detected N shared cache lines. - Statistics @@ -1757,10 +1757,10 @@ sharing in multithreaded access at foo.cc:4. Detected N shared cache lines. Proceedings of the 2009 International Symposium on Code Generation - and Optimization + and Optimization - + diff --git a/libstdc++-v3/doc/xml/manual/shared_ptr.xml b/libstdc++-v3/doc/xml/manual/shared_ptr.xml index 19f1c02..70e000d 100644 --- a/libstdc++-v3/doc/xml/manual/shared_ptr.xml +++ b/libstdc++-v3/doc/xml/manual/shared_ptr.xml @@ -1,7 +1,7 @@ - +
- - + + ISO C++ @@ -10,7 +10,7 @@ shared_ptr - + shared_ptr @@ -19,7 +19,7 @@ The shared_ptr class template stores a pointer, usually obtained via new, and implements shared ownership semantics. - +
Requirements @@ -39,11 +39,11 @@ and implements shared ownership semantics. apply. - + - +
- +
Design Issues @@ -65,12 +65,12 @@ where the correct dynamic type is known. This is an application of the technique known as type erasure. - +
- +
Implementation - +
Class Hierarchy @@ -156,9 +156,9 @@ that simplifies the implementation slightly. - +
- +
Thread Safety @@ -179,7 +179,7 @@ deprecated in C++0x mode. -The +The Thread Safety 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. - +
- +
Selecting Lock Policy - + @@ -300,9 +300,9 @@ used when libstdc++ is built without --enable-threads. is multi-threaded. If only one thread of execution exists in the program then less expensive non-atomic operations are used. - +
- +
Dual C++0x and TR1 Implementation @@ -316,12 +316,12 @@ including _Sp_counted_base are shared by both implementat 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. - +
- +
Related functions and classes @@ -346,7 +346,7 @@ In C++0x mode these constructors and the related tag types are not needed. The clever overload to detect a base class of type enable_shared_from_this comes straight from Boost. -There is an extra overload for __enable_shared_from_this to +There is an extra overload for __enable_shared_from_this to work smoothly with __shared_ptr<Tp, Lp> using any lock policy. @@ -382,9 +382,9 @@ be private. - +
- +
- +
Use - +
Examples - + Examples of use can be found in the testsuite, under testsuite/tr1/2_general_utilities/shared_ptr. - +
- +
Unresolved Issues - + The resolution to C++ Standard Library issue 674, "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. - +
- +
- +
Acknowledgments - + 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. - +
Bibliography @@ -511,7 +511,7 @@ the following types, depending on how the shared_ptr is constructed. N2351 - + @@ -524,7 +524,7 @@ the following types, depending on how the shared_ptr is constructed. N2456 - + @@ -537,7 +537,7 @@ the following types, depending on how the shared_ptr is constructed. N2461 - + @@ -550,8 +550,8 @@ the following types, depending on how the shared_ptr is constructed. N2461 - + - +
diff --git a/libstdc++-v3/doc/xml/manual/spine.xml b/libstdc++-v3/doc/xml/manual/spine.xml index 2e37361..b63029d 100644 --- a/libstdc++-v3/doc/xml/manual/spine.xml +++ b/libstdc++-v3/doc/xml/manual/spine.xml @@ -1,6 +1,6 @@ - @@ -24,92 +24,106 @@ - - - + + + Standard Contents + + + + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + + + + + + + Appendices + + - - - - - - - + diff --git a/libstdc++-v3/doc/xml/manual/status_cxx1998.xml b/libstdc++-v3/doc/xml/manual/status_cxx1998.xml index ae182bd..c5e63fa 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx1998.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx1998.xml @@ -1,6 +1,6 @@ - + @@ -27,13 +27,13 @@ particular release.
- C++ 1998/2003 Implementation Status @@ -1047,8 +1047,8 @@ particular release. Behavior, for a well-formed program construct and correct data, that - depends on the implementation and that each implementation - shall document. + depends on the implementation and that each implementation + shall document. @@ -1074,11 +1074,11 @@ particular release. discussed in the various sections on multithreading (see above). [18.1]/4 The type of NULL is described - here. + here. [18.3]/8 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. [21.1.3.1]/5 I don't really know about the mbstate_t stuff... see - the chapter 22 + the chapter 22 notes for what does exist. [22.*] Anything and everything we have on locale implementation will be described - over here. + over here. [26.2.8]/9 I have no idea what complex<T>'s pow(0,0) returns. @@ -1152,7 +1152,7 @@ particular release. [27.7.1.3]/16, [27.8.1.4]/10 The effects of pubsetbuf/setbuf are described - in this chapter. + in this chapter. [27.8.1.4]/16 Calling fstream::sync when a get area exists will... whatever fflush() does, I think. diff --git a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml b/libstdc++-v3/doc/xml/manual/status_cxx200x.xml index c386451..d3ea5ca 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx200x.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx200x.xml @@ -1,6 +1,6 @@ - + @@ -15,7 +15,7 @@ C++ 200x -This table is based on the table of contents of ISO/IEC +This table is based on the table of contents of ISO/IEC Doc No: N3000=09-0190 Date: 2009-11-09 Working Draft, Standard for Programming Language C++ @@ -36,13 +36,13 @@ particular release. -
C++ 200x Implementation Status @@ -77,7 +77,7 @@ particular release. - + 18.2 Types Partial @@ -103,21 +103,21 @@ particular release. - + 18.3.1.2 numeric_limits members Partial Missing constexpr - + 18.3.1.3 float_round_style N - + 18.3.1.4 float_denorm_style N @@ -150,14 +150,14 @@ particular release. - + 18.4.2 The header <stdint.h> Partial May use configure-generated stdint.h via GCC_HEADER_STDINT - + 18.5 Start and termination Partial @@ -182,7 +182,7 @@ particular release. - + 18.7.2 Class type_index N @@ -261,7 +261,7 @@ particular release. - + 18.9.3 Initializer list concept maps N @@ -318,14 +318,14 @@ particular release. - + 19.5.2 Class error_code Partial Missing concept ErrorCodeEnum - + 19.5.3 Class error_condition Partial @@ -352,14 +352,14 @@ particular release. - + 20.1 General Partial Missing all concepts - + 20.2 Concepts N @@ -396,7 +396,7 @@ particular release. - + 20.3.5 Range concept maps for pair N @@ -451,7 +451,7 @@ particular release. - + 20.5.2 Class template tuple Partial @@ -470,7 +470,7 @@ particular release. - + 20.6.2 Header <type_traits> synopsis @@ -501,7 +501,7 @@ particular release. - + 20.6.4.3 Type properties Partial @@ -550,7 +550,7 @@ particular release. - + 20.6.7 Other transformations Partial @@ -587,7 +587,7 @@ particular release. - + 20.7.6 Identity operation N @@ -672,7 +672,7 @@ particular release. - + 20.7.18 Class template reference_closure N @@ -685,7 +685,7 @@ particular release. - + 20.8.01 Allocator argument tag N @@ -704,42 +704,42 @@ particular release. - + 20.8.02.2 Allocator concept N - + 20.8.02.3 Support for legacy allocators N - + 20.8.02.4 Allocator and Legacy Allocator members N - + 20.8.03 Allocator-related element concepts N - + 20.8.04 Allocator propagation traits N - + 20.8.05 Allocator propagation map N @@ -758,35 +758,35 @@ particular release. - + 20.8.07.1 scoped_allocator_adaptor_base N - + 20.8.07.2 scoped_allocator_adaptor constructors N - + 20.8.07.3 scoped_allocator_adaptor2 N - + 20.8.07.3 scoped_allocator_adaptor members N - + 20.8.07.4 scoped_allocator_adaptor globals N @@ -805,7 +805,7 @@ particular release. - + 20.8.10 construct_element N @@ -818,7 +818,7 @@ particular release. - + 20.8.11.1 addressof N @@ -868,7 +868,7 @@ particular release. Uses code from boost::shared_ptr. - + @@ -890,21 +890,21 @@ particular release. - + 20.8.13.6 shared_ptr atomic access Partial - + 20.8.13.7 Pointer safety Partial - + 20.8.14 Align N @@ -1143,14 +1143,14 @@ particular release. - + 22.3.3.2.2 String N - + 22.3.3.2.3 Buffer N @@ -1271,7 +1271,7 @@ particular release. - + 22.5 Standard code conversion facets N @@ -1292,7 +1292,7 @@ particular release. - + 23.1 General Partial @@ -1305,7 +1305,7 @@ particular release. - + 23.2.1 General requirements Partial @@ -1452,21 +1452,21 @@ particular release. - + 24.1 General Partial Missing concepts - + 24.2 Iterator concepts N - + 24.3 Header <iterator> synopsis Partial @@ -1565,7 +1565,7 @@ particular release. - + 25.1 General Partial @@ -1640,14 +1640,14 @@ particular release. - + 26.5.1 Header <random> synopsis Partial Missing concepts - + 26.5.2 Concepts and related requirements N @@ -2022,7 +2022,7 @@ particular release. - + 27.2.3 Thread safety Partial @@ -2091,35 +2091,35 @@ particular release. - + 28.01 General N - + 28.02 Definitions N - + 28.03 Requirements N - + 28.04 Regular expressions summary N - + 28.05 Header <regex> synopsis N @@ -2138,49 +2138,49 @@ particular release. - + 28.08 Class template regex_traits Partial - + 28.09 Class template basic_regex Partial - + 28.10 Class template sub_match Partial - + 28.11 Class template match_results Partial - + 28.12 Regular expression algorithms N - + 28.13 Regular expression Iterators N - + 28.14 Modified ECMAScript regular expression grammar N @@ -2207,7 +2207,7 @@ particular release. - + 29.3 Order and consistency N @@ -2256,7 +2256,7 @@ particular release. - + 29.8 Fences N @@ -2289,7 +2289,7 @@ particular release. - + 30.3.1 Class thread Partial @@ -2398,7 +2398,7 @@ particular release. - + 30.5.2 Class condition_variable_any Partial @@ -2411,56 +2411,56 @@ particular release. - + 30.6.1 Overview N - + 30.6.2 Error handling N - + 30.6.3 Class future_error N - + 30.6.4 Class template unique_future N - + 30.6.5 Class template shared_future N - + 30.6.6 Class template promise N - + 30.6.7 Allocator templates N - + 30.6.8 Class template packaged_task N diff --git a/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml b/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml index 10ca06d..4d36501 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxxtr1.xml @@ -1,6 +1,6 @@ - + @@ -32,13 +32,13 @@ release. -
C++ TR1 Implementation Status @@ -135,7 +135,7 @@ release. Uses code from boost::shared_ptr. - + @@ -1030,322 +1030,322 @@ release. Regular Expressions - + 7.1 Definitions N - + 7.2 Requirements N - + 7.3 Regular expressions summary N - + 7.4 Header <regex> synopsis N - + 7.5 Namespace tr1::regex_constants N - + 7.5.1 Bitmask Type syntax_option_type N - + 7.5.2 Bitmask Type regex_constants::match_flag_type N - + 7.5.3 Implementation defined error_type N - + 7.6 Class regex_error N - + 7.7 Class template regex_traits N - + 7.8 Class template basic_regex N - + 7.8.1 basic_regex constants N - + 7.8.2 basic_regex constructors N - + 7.8.3 basic_regex assign N - + 7.8.4 basic_regex constant operations N - + 7.8.5 basic_regex locale N - + 7.8.6 basic_regex swap N - + 7.8.7 basic_regex non-member functions N - + 7.8.7.1 basic_regex non-member swap N - + 7.9 Class template sub_match N - + 7.9.1 sub_match members N - + 7.9.2 sub_match non-member operators N - + 7.10 Class template match_results N - + 7.10.1 match_results constructors N - + 7.10.2 match_results size N - + 7.10.3 match_results element access N - + 7.10.4 match_results formatting N - + 7.10.5 match_results allocator N - + 7.10.6 match_results swap N - + 7.11 Regular expression algorithms N - + 7.11.1 exceptions N - + 7.11.2 regex_match N - + 7.11.3 regex_search N - + 7.11.4 regex_replace N - + 7.12 Regular expression Iterators N - + 7.12.1 Class template regex_iterator N - + 7.12.1.1 regex_iterator constructors N - + 7.12.1.2 regex_iterator comparisons N - + 7.12.1.3 regex_iterator dereference N - + 7.12.1.4 regex_iterator increment N - + 7.12.2 Class template regex_token_iterator N - + 7.12.2.1 regex_token_iterator constructors N - + 7.12.2.2 regex_token_iterator comparisons N - + 7.12.2.3 regex_token_iterator dereference N - + 7.12.2.4 regex_token_iterator increment N - + 7.13 Modified ECMAScript regular expression grammar N @@ -1416,14 +1416,14 @@ release. - + 8.2 Header <ccomplex> N DR 551 - + 8.3 Header <complex.h> N @@ -1490,21 +1490,21 @@ release. - + 8.10 Additions to header <ios> N - + 8.10.1 Synopsis N - + 8.10.2 Function hexfloat N @@ -1547,7 +1547,7 @@ release. - + 8.15 Additions to header <locale> N diff --git a/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml index 08e9a43..f3b29b9 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml @@ -1,6 +1,6 @@ - + @@ -24,12 +24,12 @@ particular release. -
diff --git a/libstdc++-v3/doc/xml/manual/strings.xml b/libstdc++-v3/doc/xml/manual/strings.xml index fca9ef8..412484e 100644 --- a/libstdc++-v3/doc/xml/manual/strings.xml +++ b/libstdc++-v3/doc/xml/manual/strings.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,20 +15,20 @@ library - + Strings <indexterm><primary>Strings</primary></indexterm> - + - - + + String Classes - + Simple Transformations Here are Standard, simple, and portable ways to perform common @@ -71,7 +71,7 @@ std::string capital_s; capital_s.resize(s.size()); std::transform (s.begin(), s.end(), capital_s.begin(), ToUpper()); - } + } Note that these calls all @@ -91,7 +91,7 @@ <locale>) so the template-arguments for transform<> cannot be deduced, as explained in this - message. + message. At minimum, you can write short wrappers like @@ -115,15 +115,15 @@ str.erase(0,notwhite); // trim trailing whitespace - notwhite = str.find_last_not_of(" \t\n"); + notwhite = str.find_last_not_of(" \t\n"); str.erase(notwhite+1); Obviously, the calls to find could be inserted directly into the calls to erase, in case your compiler does not optimize named temporaries out of existence. - - - + + + Case Sensitivity @@ -174,8 +174,8 @@ very good information. - - + + Arbitrary Character Types @@ -193,8 +193,8 @@ template <typename CharT, - typename Traits = char_traits<CharT>, - typename Alloc = allocator<CharT> > + typename Traits = char_traits<CharT>, + typename Alloc = allocator<CharT> > class basic_string { .... }; Now, allocator<CharT> will probably Do The Right Thing by default, unless you need to implement your own allocator @@ -206,11 +206,11 @@ template <typename CharT> - struct char_traits - { - static void foo (type1 x, type2 y); - ... - }; + struct char_traits + { + static void foo (type1 x, type2 y); + ... + }; and functions such as char_traits<CharT>::foo() are not actually defined anywhere for the general case. The C++ standard permits this, because writing such a definition to fit all possible @@ -245,9 +245,9 @@ (See how tricky this is?) - + - + Tokenizing @@ -275,32 +275,32 @@ template <typename Container> void stringtok(Container &container, string const &in, - const char * const delimiters = " \t\n") + const char * const delimiters = " \t\n") { const string::size_type len = in.length(); - string::size_type i = 0; + string::size_type i = 0; while (i < len) { - // Eat leading whitespace - i = in.find_first_not_of(delimiters, i); - if (i == string::npos) + // Eat leading whitespace + i = in.find_first_not_of(delimiters, i); + if (i == string::npos) return; // Nothing left but white space - // Find the end of the token - string::size_type j = in.find_first_of(delimiters, i); + // Find the end of the token + string::size_type j = in.find_first_of(delimiters, i); - // Push token - if (j == string::npos) + // Push token + if (j == string::npos) { container.push_back(in.substr(i)); return; - } + } else container.push_back(in.substr(i, j-i)); - // Set up for next loop - i = j + 1; + // Set up for next loop + i = j + 1; } } @@ -317,7 +317,7 @@ stringtok(Container &container, string const &in, std::list<string> ls; stringtok (ls, " this \t is\t\n a test "); for (std::list<string>const_iterator i = ls.begin(); - i != ls.end(); ++i) + i != ls.end(); ++i) { std::cerr << ':' << (*i) << ":\n"; } @@ -345,8 +345,8 @@ stringtok(Container &container, string const &in, - - + + Shrink to Fit @@ -366,11 +366,11 @@ stringtok(Container &container, string const &in, entry) but the regular copy constructor cannot be used because libstdc++'s string is Copy-On-Write. - - - + + + CString (MFC) @@ -387,16 +387,16 @@ stringtok(Container &container, string const &in, message, Joe Buck points out a few very important things: - The Standard string supports all the operations - that CString does, with three exceptions. - - Two of those exceptions (whitespace trimming and case - conversion) are trivial to implement. In fact, we do so - on this page. - - The third is CString::Format, which allows formatting - in the style of sprintf. This deserves some mention: - + The Standard string supports all the operations + that CString does, with three exceptions. + + Two of those exceptions (whitespace trimming and case + conversion) are trivial to implement. In fact, we do so + on this page. + + The third is CString::Format, which allows formatting + in the style of sprintf. This deserves some mention: + The old libg++ library had a function called form(), which did much @@ -418,11 +418,11 @@ stringtok(Container &container, string const &in, int the_number; incoming_stream >> the_word // extract "foo" - >> the_number; // extract N + >> the_number; // extract N ostringstream output_stream; output_stream << "The word was " << the_word - << " and 3*N was " << (3*the_number); + << " and 3*N was " << (3*the_number); return output_stream.str(); } @@ -432,22 +432,22 @@ stringtok(Container &container, string const &in, CString suffers from a common programming error that results in poor performance. Consider the following code: - + CString n_copies_of (const CString& foo, unsigned n) { - CString tmp; - for (unsigned i = 0; i < n; i++) - tmp += foo; - return tmp; + CString tmp; + for (unsigned i = 0; i < n; i++) + tmp += foo; + return tmp; } - + This function is O(n^2), not O(n). The reason is that each += causes a reallocation and copy of the existing string. Microsoft applications are full of this kind of thing (quadratic performance on tasks that can be done in linear time) -- on the other hand, we should be thankful, as it's created such a big market for high-end ix86 hardware. :-) - + If you replace CString with string in the above function, the performance is O(n). @@ -455,35 +455,35 @@ stringtok(Container &container, string const &in, comparing CString and the Standard string class: - CString permits access to its internal representation; coders - who exploited that may have problems moving to string. - - Microsoft ships the source to CString (in the files - MFC\SRC\Str{core,ex}.cpp), so you could fix the allocation - bug and rebuild your MFC libraries. - Note: It looks like the CString shipped - with VC++6.0 has fixed this, although it may in fact have been - one of the VC++ SPs that did it. - - string operations like this have O(n) complexity - if the implementors do it correctly. The libstdc++ - implementors did it correctly. Other vendors might not. - - While parts of the SGI STL are used in libstdc++, their - string class is not. The SGI string is essentially - vector<char> and does not do any reference - counting like libstdc++'s does. (It is O(n), though.) - So if you're thinking about SGI's string or rope classes, - you're now looking at four possibilities: CString, the - libstdc++ string, the SGI string, and the SGI rope, and this - is all before any allocator or traits customizations! (More - choices than you can shake a stick at -- want fries with that?) - + CString permits access to its internal representation; coders + who exploited that may have problems moving to string. + + Microsoft ships the source to CString (in the files + MFC\SRC\Str{core,ex}.cpp), so you could fix the allocation + bug and rebuild your MFC libraries. + Note: It looks like the CString shipped + with VC++6.0 has fixed this, although it may in fact have been + one of the VC++ SPs that did it. + + string operations like this have O(n) complexity + if the implementors do it correctly. The libstdc++ + implementors did it correctly. Other vendors might not. + + While chapters of the SGI STL are used in libstdc++, their + string class is not. The SGI string is essentially + vector<char> and does not do any reference + counting like libstdc++'s does. (It is O(n), though.) + So if you're thinking about SGI's string or rope classes, + you're now looking at four possibilities: CString, the + libstdc++ string, the SGI string, and the SGI rope, and this + is all before any allocator or traits customizations! (More + choices than you can shake a stick at -- want fries with that?) + - - + + - + - + diff --git a/libstdc++-v3/doc/xml/manual/support.xml b/libstdc++-v3/doc/xml/manual/support.xml index 9b30f41..20b5b72 100644 --- a/libstdc++-v3/doc/xml/manual/support.xml +++ b/libstdc++-v3/doc/xml/manual/support.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,15 +15,13 @@ library - + Support <indexterm><primary>Support</primary></indexterm> - - 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. - - + Types - + Fundamental Types C++ has the following builtin types: @@ -100,9 +97,9 @@ Specializing parts of the library on these types is prohibited: instead, use a POD. - - - + + + Numeric Properties @@ -117,8 +114,8 @@ - template<typename T> - struct class + template<typename T> + struct class { static const bool is_specialized; static T max() throw(); @@ -156,9 +153,9 @@ static const float_round_style round_style; }; - + - + NULL The only change that might affect people is the type of @@ -191,15 +188,15 @@ NULL that will match pointers before it matches integers. - See + See the Effective C++ CD example - + - + - + Dynamic Memory @@ -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 @@ bad_alloc is derived from the base exception - class defined in Chapter 19. + class defined in Sect1 19. - + - + Termination - + Termination Handlers Not many changes here to Functions registered with atexit() 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.) The previous two actions are interleaved, that is, - given this pseudocode: + given this pseudocode: extern "C or C++" void f1 (void); extern "C or C++" void f2 (void); - + static Thing obj1; atexit(f1); static Thing obj2; atexit(f2); - then at a call of exit(), - f2 will be called, then - obj2 will be destroyed, then - f1 will be called, and finally - obj1 will be destroyed. If - f1 or f2 allow an - exception to propagate out of them, Bad Things happen. + then at a call of exit(), + f2 will be called, then + obj2 will be destroyed, then + f1 will be called, and finally + obj1 will be destroyed. If + f1 or f2 allow an + exception to propagate out of them, Bad Things happen. @@ -345,9 +342,9 @@ those slots. If you think you may run out, we recommend using the xatexit/xexit combination from libiberty, which has no such limit. - + - + Verbose Terminate Handler @@ -358,7 +355,7 @@ #include <exception> - + int main() { std::set_terminate(__gnu_cxx::__verbose_terminate_handler); @@ -390,7 +387,7 @@ int main() #include <stdexcept> struct argument_error : public std::runtime_error -{ +{ argument_error(const std::string& s): std::runtime_error(s) { } }; @@ -436,7 +433,7 @@ int main(int argc) std::set_terminate(std::abort); - + After this, all calls to terminate will use abort as the terminate handler. @@ -449,7 +446,7 @@ int main(int argc) an unspecified manner. - - + + - + diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml index ce21876..7369f57 100644 --- a/libstdc++-v3/doc/xml/manual/using.xml +++ b/libstdc++-v3/doc/xml/manual/using.xml @@ -1042,7 +1042,7 @@ namespace gtk cstdlib - + exception @@ -1075,7 +1075,7 @@ namespace gtk - In addition, throw in + In addition, throw in @@ -1103,12 +1103,12 @@ namespace gtk - + There exists a library that offers runtime support for just these headers, and it is called libsupc++.a. To use it, compile with gcc instead of g++, like so: - + gcc foo.cc -lsupc++ @@ -1501,7 +1501,7 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) this at application run-time see here. Also useful are details - on allocator + on allocator options and capabilities. diff --git a/libstdc++-v3/doc/xml/manual/utilities.xml b/libstdc++-v3/doc/xml/manual/utilities.xml index 56d614e..ef118f5 100644 --- a/libstdc++-v3/doc/xml/manual/utilities.xml +++ b/libstdc++-v3/doc/xml/manual/utilities.xml @@ -1,12 +1,12 @@ - - + - - + + ISO C++ @@ -15,28 +15,28 @@ library - + Utilities <indexterm><primary>Utilities</primary></indexterm> - - + +
Functors 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 their http://www.sgi.com/tech/stl/functors.html. - +
- - + +
Pairs The pair<T1,T2> is a simple and handy way to @@ -76,7 +76,7 @@ x.first < y.first || - ( !(y.first < x.first) && x.second < y.second ) + ( !(y.first < x.first) && x.second < y.second ) The other operators are not defined using the rel_ops functions above, but their semantics are the same. @@ -89,10 +89,10 @@ pair<int,MyClass> p = make_pair(4,myobject); - +
- - + +
Memory @@ -104,28 +104,28 @@ - - - - +
- - + +
Traits - +
-
+ diff --git a/libstdc++-v3/include/bits/c++0x_warning.h b/libstdc++-v3/include/bits/c++0x_warning.h index b74f339..4f926a3 100644 --- a/libstdc++-v3/include/bits/c++0x_warning.h +++ b/libstdc++-v3/include/bits/c++0x_warning.h @@ -1,4 +1,4 @@ -// 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 // . -/** @file include/c++0x_warning.h +/** @file c++0x_warning.h * This is a Standard C++ Library header. */ -- cgit v1.1