diff options
Diffstat (limited to 'libstdc++-v3/docs/html')
27 files changed, 682 insertions, 150 deletions
diff --git a/libstdc++-v3/docs/html/17_intro/contribute.html b/libstdc++-v3/docs/html/17_intro/contribute.html index 1ab24b92fb5..17bc65f4ed0 100644 --- a/libstdc++-v3/docs/html/17_intro/contribute.html +++ b/libstdc++-v3/docs/html/17_intro/contribute.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>How to contribute</title> </head> diff --git a/libstdc++-v3/docs/html/17_intro/howto.html b/libstdc++-v3/docs/html/17_intro/howto.html index a8cf3976e13..137829df6f8 100644 --- a/libstdc++-v3/docs/html/17_intro/howto.html +++ b/libstdc++-v3/docs/html/17_intro/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/17_intro/license.html b/libstdc++-v3/docs/html/17_intro/license.html index 7db8aa5f240..a0a2c9135ea 100644 --- a/libstdc++-v3/docs/html/17_intro/license.html +++ b/libstdc++-v3/docs/html/17_intro/license.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/17_intro/porting.html b/libstdc++-v3/docs/html/17_intro/porting.html index e791f92dc74..c28f89f407f 100644 --- a/libstdc++-v3/docs/html/17_intro/porting.html +++ b/libstdc++-v3/docs/html/17_intro/porting.html @@ -68,12 +68,13 @@ directory. The important information is that there needs to be a directory under <code>config/os</code> to store the files for your operating system. -<p>You'll have to change the <code>configure.target</code> file to ensure that -your new directory is activated. Look for the switch statement that -sets <code>os_include_dir</code>, and add a pattern to handle your operating -system. The switch statement switches on only the OS portion of the -standard target triplet; e.g., the <code>solaris2.8</code> in -<code>sparc-sun-solaris2.8</code>. +<p>You might have to change the <code>configure.target</code> file to ensure that +your new directory is activated. Look for the switch statement that sets +<code>os_include_dir</code>, and add a pattern to handle your operating system +if the default will not suffice. The switch statement switches on only +the OS portion of the standard target triplet; e.g., the <code>solaris2.8</code> +in <code>sparc-sun-solaris2.8</code>. If the new directory is named after the +OS portion of the triplet (the default), then nothing needs to be changed. <p>The first file to create in this directory, should be called <code>os_defines.h</code>. This file contains basic macro definitions diff --git a/libstdc++-v3/docs/html/17_intro/porting.texi b/libstdc++-v3/docs/html/17_intro/porting.texi index 142a354a032..6c6ec1f7f48 100644 --- a/libstdc++-v3/docs/html/17_intro/porting.texi +++ b/libstdc++-v3/docs/html/17_intro/porting.texi @@ -102,12 +102,13 @@ directory. The important information is that there needs to be a directory under @file{config/os} to store the files for your operating system. -You'll have to change the @file{configure.target} file to ensure that -your new directory is activated. Look for the switch statement that -sets @code{os_include_dir}, and add a pattern to handle your operating -system. The switch statement switches on only the OS portion of the -standard target triplet; e.g., the @code{solaris2.8} in -@code{sparc-sun-solaris2.8}. +You might have to change the @file{configure.target} file to ensure that +your new directory is activated. Look for the switch statement that sets +@code{os_include_dir}, and add a pattern to handle your operating system +if the default will not suffice. The switch statement switches on only +the OS portion of the standard target triplet; e.g., the @code{solaris2.8} +in @code{sparc-sun-solaris2.8}. If the new directory is named after the +OS portion of the triplet (the default), then nothing needs to be changed. The first file to create in this directory, should be called @file{os_defines.h}. This file contains basic macro definitions diff --git a/libstdc++-v3/docs/html/18_support/howto.html b/libstdc++-v3/docs/html/18_support/howto.html index c055f999bdc..c95f956a370 100644 --- a/libstdc++-v3/docs/html/18_support/howto.html +++ b/libstdc++-v3/docs/html/18_support/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/19_diagnostics/howto.html b/libstdc++-v3/docs/html/19_diagnostics/howto.html index 07585bb8347..d1d759d5a43 100644 --- a/libstdc++-v3/docs/html/19_diagnostics/howto.html +++ b/libstdc++-v3/docs/html/19_diagnostics/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/20_util/howto.html b/libstdc++-v3/docs/html/20_util/howto.html index 7b7485ed837..28021d20635 100644 --- a/libstdc++-v3/docs/html/20_util/howto.html +++ b/libstdc++-v3/docs/html/20_util/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/21_strings/howto.html b/libstdc++-v3/docs/html/21_strings/howto.html index e49a166c0c5..cba9c3f21d4 100644 --- a/libstdc++-v3/docs/html/21_strings/howto.html +++ b/libstdc++-v3/docs/html/21_strings/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> @@ -335,15 +340,78 @@ <hr /> <h2><a name="5">Making strings of arbitrary character types</a></h2> - <p>how to work with char_traits -- in the archives, just need to - go through and pull the examples together + <p>The <code>std::basic_string</code> is tantalizingly general, in that + it is parameterized on the type of the characters which it holds. + In theory, you could whip up a Unicode character class and instantiate + <code>std::basic_string<my_unicode_char></code>, or assuming + that integers are wider than characters on your platform, maybe just + declare variables of type <code>std::basic_string<int></code>. + </p> + <p>That's the theory. Remember however that basic_string has additional + type parameters, which take default arguments based on the character + type (called CharT here): + </p> + <pre> + template <typename CharT, + typename Traits = char_traits<CharT>, + typename Alloc = allocator<CharT> > + class basic_string { .... };</pre> + <p>Now, <code>allocator<CharT></code> will probably Do The Right + Thing by default, unless you need to implement your own allocator + for your characters. + </p> + <p>But <code>char_traits</code> takes more work. The char_traits + template is <em>declared</em> but not <em>defined</em>. + That means there is only + </p> + <pre> + template <typename CharT> + struct char_traits + { + static void foo (type1 x, type2 y); + ... + };</pre> + <p>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 + CharT's cannot be done. (For a time, in earlier versions of GCC, + there was a mostly-correct implementation that let programmers be + lazy. :-) But it broke under many situations, so it was removed. + You are no longer allowed to be lazy and non-portable.) + </p> + <p>The C++ standard also requires that char_traits be specialized for + instantiations of <code>char</code> and <code>wchar_t</code>, and it + is these template specializations that permit entities like + <code>basic_string<char,char_traits<char>></code> to work. + </p> + <p>If you want to use character types other than char and wchar_t, + such as <code>unsigned char</code> and <code>int</code>, you will + need to write specializations for them at the present time. If you + want to use your own special character class, then you have + <a href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00163.html">a lot + of work to do</a>, especially if you with to use i18n features + (facets require traits information but don't have a traits argument). + </p> + <p>One example of how to specialize char_traits is given + <a href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00260.html">in + this message</a>. We agree that the way it's used with basic_string + (scroll down to main()) doesn't look nice, but that's because + <a href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00236.html">the + nice-looking first attempt</a> turned out to + <a href="http://gcc.gnu.org/ml/libstdc++/2002-08/msg00242.html">not + be conforming C++</a>, due to the rule that CharT must be a POD. + (See how tricky this is?) + </p> + <p>Other approaches were suggested in that same thread, such as providing + more specializations and/or some helper types in the library to assist + users writing such code. So far nobody has had the time... + <a href="../17_intro/contribute.html">do you?</a> </p> <p>Return <a href="#top">to top of page</a> or <a href="../faq/index.html">to the FAQ</a>. </p> - <!-- ####################################################### --> <hr /> diff --git a/libstdc++-v3/docs/html/22_locale/codecvt.html b/libstdc++-v3/docs/html/22_locale/codecvt.html index 64f3856d479..6acd416fc07 100644 --- a/libstdc++-v3/docs/html/22_locale/codecvt.html +++ b/libstdc++-v3/docs/html/22_locale/codecvt.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" /> diff --git a/libstdc++-v3/docs/html/22_locale/ctype.html b/libstdc++-v3/docs/html/22_locale/ctype.html index 886f83d0739..3043123f041 100644 --- a/libstdc++-v3/docs/html/22_locale/ctype.html +++ b/libstdc++-v3/docs/html/22_locale/ctype.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" /> diff --git a/libstdc++-v3/docs/html/22_locale/howto.html b/libstdc++-v3/docs/html/22_locale/howto.html index 106662753d9..bd2526ddb4c 100644 --- a/libstdc++-v3/docs/html/22_locale/howto.html +++ b/libstdc++-v3/docs/html/22_locale/howto.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/22_locale/locale.html b/libstdc++-v3/docs/html/22_locale/locale.html index 999e82ed0bd..6816204df8f 100644 --- a/libstdc++-v3/docs/html/22_locale/locale.html +++ b/libstdc++-v3/docs/html/22_locale/locale.html @@ -1,8 +1,12 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" /> - <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" /> + <meta name="KEYWORDS" content="HOWTO, libstdc++, locale name LC_ALL" /> <meta name="DESCRIPTION" content="Notes on the locale implementation." /> <title>Notes on the locale implementation.</title> <link rel="StyleSheet" href="../lib3styles.css" /> @@ -12,79 +16,459 @@ Notes on the locale implementation. </h1> <em> -prepared by Benjamin Kosnik (bkoz@redhat.com) on August 8, 2001 +prepared by Benjamin Kosnik (bkoz@redhat.com) on October 14, 2002 </em> <h2> -1. Abstract Describes the basic locale object, including nested -classes id, facet, and the reference-counted implementation object, -class _Impl. +1. Abstract </h2> <p> +Describes the basic locale object, including nested +classes id, facet, and the reference-counted implementation object, +class _Impl. </p> <h2> 2. What the standard says </h2> -See Chapter 22 of the standard. +Class locale is non-templatized and has two distinct types nested +inside of it: + +<blockquote> +<em> +class facet +22.1.1.1.2 Class locale::facet +</em> +</blockquote> + +<p> +Facets actually implement locale functionality. For instance, a facet +called numpunct is the data objects that can be used to query for the +thousands separator is in the German locale. +</p> + +Literally, a facet is strictly defined: +<ul> + <li>containing the following public data member: + <p> + <code>static locale::id id;</code> + </p> + </li> + + <li>derived from another facet: + <p> + <code> class gnu_codecvt: public std::ctype<user-defined-type></code> + </p> + </li> +</ul> + +<p> +Of interest in this class are the memory management options explicitly +specified as an argument to facet's constructor. Each constructor of a +facet class takes a std::size_t __refs argument: if __refs == 0, the +facet is deleted when the locale containing it is destroyed. If __refs +== 1, the facet is not destroyed, even when it is no longer +referenced. +</p> + +<blockquote> +<em> +class id +22.1.1.1.3 - Class locale::id +</em> +</blockquote> + +<p> +Provides an index for looking up specific facets. +<p> <h2> -3. Problems with "C" locales : global locales, termination. +3. Interacting with "C" locales. </h2> <p> -The major problem is fitting an object-orientated and non-global locale -design ontop of POSIX and other relevant stanards, which include the -Single Unix (nee X/Open.) +Some help on determining the underlying support for locales on a system. +Note, this is specific to linux (and glibc-2.3.x) +</p> -Because POSIX falls down so completely, portibility is an issue. +<ul> + <li> <code>`locale -a`</code> displays available locales. +<blockquote> +<pre> +af_ZA +ar_AE +ar_AE.utf8 +ar_BH +ar_BH.utf8 +ar_DZ +ar_DZ.utf8 +ar_EG +ar_EG.utf8 +ar_IN +ar_IQ +ar_IQ.utf8 +ar_JO +ar_JO.utf8 +ar_KW +ar_KW.utf8 +ar_LB +ar_LB.utf8 +ar_LY +ar_LY.utf8 +ar_MA +ar_MA.utf8 +ar_OM +ar_OM.utf8 +ar_QA +ar_QA.utf8 +ar_SA +ar_SA.utf8 +ar_SD +ar_SD.utf8 +ar_SY +ar_SY.utf8 +ar_TN +ar_TN.utf8 +ar_YE +ar_YE.utf8 +be_BY +be_BY.utf8 +bg_BG +bg_BG.utf8 +br_FR +bs_BA +C +ca_ES +ca_ES@euro +ca_ES.utf8 +ca_ES.utf8@euro +cs_CZ +cs_CZ.utf8 +cy_GB +da_DK +da_DK.iso885915 +da_DK.utf8 +de_AT +de_AT@euro +de_AT.utf8 +de_AT.utf8@euro +de_BE +de_BE@euro +de_BE.utf8 +de_BE.utf8@euro +de_CH +de_CH.utf8 +de_DE +de_DE@euro +de_DE.utf8 +de_DE.utf8@euro +de_LU +de_LU@euro +de_LU.utf8 +de_LU.utf8@euro +el_GR +el_GR.utf8 +en_AU +en_AU.utf8 +en_BW +en_BW.utf8 +en_CA +en_CA.utf8 +en_DK +en_DK.utf8 +en_GB +en_GB.iso885915 +en_GB.utf8 +en_HK +en_HK.utf8 +en_IE +en_IE@euro +en_IE.utf8 +en_IE.utf8@euro +en_IN +en_NZ +en_NZ.utf8 +en_PH +en_PH.utf8 +en_SG +en_SG.utf8 +en_US +en_US.iso885915 +en_US.utf8 +en_ZA +en_ZA.utf8 +en_ZW +en_ZW.utf8 +es_AR +es_AR.utf8 +es_BO +es_BO.utf8 +es_CL +es_CL.utf8 +es_CO +es_CO.utf8 +es_CR +es_CR.utf8 +es_DO +es_DO.utf8 +es_EC +es_EC.utf8 +es_ES +es_ES@euro +es_ES.utf8 +es_ES.utf8@euro +es_GT +es_GT.utf8 +es_HN +es_HN.utf8 +es_MX +es_MX.utf8 +es_NI +es_NI.utf8 +es_PA +es_PA.utf8 +es_PE +es_PE.utf8 +es_PR +es_PR.utf8 +es_PY +es_PY.utf8 +es_SV +es_SV.utf8 +es_US +es_US.utf8 +es_UY +es_UY.utf8 +es_VE +es_VE.utf8 +et_EE +et_EE.utf8 +eu_ES +eu_ES@euro +eu_ES.utf8 +eu_ES.utf8@euro +fa_IR +fi_FI +fi_FI@euro +fi_FI.utf8 +fi_FI.utf8@euro +fo_FO +fo_FO.utf8 +fr_BE +fr_BE@euro +fr_BE.utf8 +fr_BE.utf8@euro +fr_CA +fr_CA.utf8 +fr_CH +fr_CH.utf8 +fr_FR +fr_FR@euro +fr_FR.utf8 +fr_FR.utf8@euro +fr_LU +fr_LU@euro +fr_LU.utf8 +fr_LU.utf8@euro +ga_IE +ga_IE@euro +ga_IE.utf8 +ga_IE.utf8@euro +gl_ES +gl_ES@euro +gl_ES.utf8 +gl_ES.utf8@euro +gv_GB +gv_GB.utf8 +he_IL +he_IL.utf8 +hi_IN +hr_HR +hr_HR.utf8 +hu_HU +hu_HU.utf8 +id_ID +id_ID.utf8 +is_IS +is_IS.utf8 +it_CH +it_CH.utf8 +it_IT +it_IT@euro +it_IT.utf8 +it_IT.utf8@euro +iw_IL +iw_IL.utf8 +ja_JP.eucjp +ja_JP.utf8 +ka_GE +kl_GL +kl_GL.utf8 +ko_KR.euckr +ko_KR.utf8 +kw_GB +kw_GB.utf8 +lt_LT +lt_LT.utf8 +lv_LV +lv_LV.utf8 +mi_NZ +mk_MK +mk_MK.utf8 +mr_IN +ms_MY +ms_MY.utf8 +mt_MT +mt_MT.utf8 +nl_BE +nl_BE@euro +nl_BE.utf8 +nl_BE.utf8@euro +nl_NL +nl_NL@euro +nl_NL.utf8 +nl_NL.utf8@euro +nn_NO +nn_NO.utf8 +no_NO +no_NO.utf8 +oc_FR +pl_PL +pl_PL.utf8 +POSIX +pt_BR +pt_BR.utf8 +pt_PT +pt_PT@euro +pt_PT.utf8 +pt_PT.utf8@euro +ro_RO +ro_RO.utf8 +ru_RU +ru_RU.koi8r +ru_RU.utf8 +ru_UA +ru_UA.utf8 +se_NO +sk_SK +sk_SK.utf8 +sl_SI +sl_SI.utf8 +sq_AL +sq_AL.utf8 +sr_YU +sr_YU@cyrillic +sr_YU.utf8 +sr_YU.utf8@cyrillic +sv_FI +sv_FI@euro +sv_FI.utf8 +sv_FI.utf8@euro +sv_SE +sv_SE.iso885915 +sv_SE.utf8 +ta_IN +te_IN +tg_TJ +th_TH +th_TH.utf8 +tl_PH +tr_TR +tr_TR.utf8 +uk_UA +uk_UA.utf8 +ur_PK +uz_UZ +vi_VN +vi_VN.tcvn +wa_BE +wa_BE@euro +yi_US +zh_CN +zh_CN.gb18030 +zh_CN.gbk +zh_CN.utf8 +zh_HK +zh_HK.utf8 +zh_TW +zh_TW.euctw +zh_TW.utf8 +</pre> +</blockquote> +</li> + + <li> <code>`locale`</code> displays environmental variables + that impact how locale("") will be deduced. + +<blockquote> +<pre> +LANG=en_US +LC_CTYPE="en_US" +LC_NUMERIC="en_US" +LC_TIME="en_US" +LC_COLLATE="en_US" +LC_MONETARY="en_US" +LC_MESSAGES="en_US" +LC_PAPER="en_US" +LC_NAME="en_US" +LC_ADDRESS="en_US" +LC_TELEPHONE="en_US" +LC_MEASUREMENT="en_US" +LC_IDENTIFICATION="en_US" +LC_ALL= +</pre> +</blockquote> +</li> +</ul> + +<p> +From Josuttis, p. 697-698, which says, that "there is only *one* +relation (of the C++ locale mechanism) to the C locale mechanism: the +global C locale is modified if a named C++ locale object is set as the +global locale" (emphasis Paolo), that is: </p> + <code>std::locale::global(std::locale(""));</code> -<h2> -4. Design -</h2> -Class locale in non-templatized and has three distinct types nested -inside of it: +<p>affects the C functions as if the following call was made:</p> -class facet -22.1.1.1.2 Class locale::facet + <code>std::setlocale(LC_ALL, "");</code> -Facets actually implement locale functionality. For instance, a facet -called numpunct is the data objects that can be used to query for the -thousands separator is in the German locale. +<p> +On the other hand, there is *no* viceversa, that is, calling setlocale +has *no* whatsoever on the C++ locale mechanism, in particular on the +working of locale(""), which constructs the locale object from the +environment of the running program, that is, in practice, the set of +LC_ALL, LANG, etc. variable of the shell. +</p> -Literally, a facet is strictly defined: - - containing -public: - static locale::id id; -- or derived from another facet +<h2> +4. Design +</h2> -The only other thing of interest in this class is the memory -management of facets. Each constructor of a facet class takes a -std::size_t __refs argument: if __refs == 0, the facet is deleted when -no longer used. if __refs == 1, the facet is not destroyed, even when -it is no longer reference. +<p> +The major design challenge is fitting an object-orientated and +non-global locale design ontop of POSIX and other relevant stanards, +which include the Single Unix (nee X/Open.) +</p> -class id -Provides an index for looking up specific facets. +<p> +Because POSIX falls down so completely, portibility is an issue. +</p> class _Impl +The internal representation of the std::locale object. + <h2> 5. Examples </h2> -<pre> - typedef __locale_t locale; -</pre> - More information can be found in the following testcases: <ul> -<li> testsuite/22_locale/ctype_char_members.cc </li> -<li> testsuite/22_locale/ctype_wchar_t_members.cc </li> +<li> testsuite/22_locale/all </li> </ul> <h2> @@ -92,8 +476,6 @@ More information can be found in the following testcases: </h2> <ul> - <li> locale -a displays available locales on linux </li> - <li> locale initialization: at what point does _S_classic, _S_global get initialized? Can named locales assume this initialization has already taken place? </li> diff --git a/libstdc++-v3/docs/html/22_locale/messages.html b/libstdc++-v3/docs/html/22_locale/messages.html index 7497590bd88..68d387612ff 100644 --- a/libstdc++-v3/docs/html/22_locale/messages.html +++ b/libstdc++-v3/docs/html/22_locale/messages.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" /> diff --git a/libstdc++-v3/docs/html/23_containers/howto.html b/libstdc++-v3/docs/html/23_containers/howto.html index 1c1e137b67c..008017a8827 100644 --- a/libstdc++-v3/docs/html/23_containers/howto.html +++ b/libstdc++-v3/docs/html/23_containers/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> @@ -247,41 +251,11 @@ solution would probably be more trouble than it's worth. </p> <p>The STL implementation is currently configured to use the - high-speed caching memory allocator. If you absolutely think - you must change this on a global basis for your platform to better - support multi-threading, then please consult all commentary in - include/bits/stl_alloc.h and the allocators link below. + high-speed caching memory allocator. Some people like to + test and/or normally run threaded programs with a different + default. For all details about how to globally override this + at application run-time see <a href="../ext/howto.html#3">here</a>. </p> - <blockquote> - <p>(Explicit warning since so many people get confused while - attempting this:) - </p> - <p><strong>Adding -D__USE_MALLOC on the command - line is almost certainly a bad idea.</strong> Memory efficiency is - almost guaranteed to suffer as a result; this is - <a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00136.html">why - we disabled it for 3.0 in the first place</a>. - </p> - <p>Related to threading or otherwise, the current recommendation is - that users not add any macro defines on the command line to remove or - otherwise disable features of libstdc++-v3. There is - no condition under which it will help you without causing other - issues to perhaps raise up (possible linkage/ABI problems). In - particular, __USE_MALLOC should only be added to a libstdc++-v3 - configuration file, include/bits/c++config (where such user - action is cautioned against), and the entire library should be - rebuilt. If you do not, then you might be violating the - one-definition rule of C/C++ and you might cause yourself untold - problems. - </p> - </blockquote> - <p>If you find any platform where gcc reports a - threading model other than single, and where libstdc++-v3 builds - a buggy container allocator when used with threads unless you - define __USE_MALLOC, we want to hear about it ASAP. In the - past, correctness was the main reason people were led to believe - that they should define __USE_MALLOC when using threads. - </p> <p>There is a better way (not standardized yet): It is possible to force the malloc-based allocator on a per-case-basis for some application code. The library team generally believes that this diff --git a/libstdc++-v3/docs/html/24_iterators/howto.html b/libstdc++-v3/docs/html/24_iterators/howto.html index 4d48cffdcbd..d8df4420444 100644 --- a/libstdc++-v3/docs/html/24_iterators/howto.html +++ b/libstdc++-v3/docs/html/24_iterators/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/25_algorithms/howto.html b/libstdc++-v3/docs/html/25_algorithms/howto.html index 65403ca8159..19c362454c1 100644 --- a/libstdc++-v3/docs/html/25_algorithms/howto.html +++ b/libstdc++-v3/docs/html/25_algorithms/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/26_numerics/howto.html b/libstdc++-v3/docs/html/26_numerics/howto.html index 067f59dd0fd..6074e358291 100644 --- a/libstdc++-v3/docs/html/26_numerics/howto.html +++ b/libstdc++-v3/docs/html/26_numerics/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/27_io/howto.html b/libstdc++-v3/docs/html/27_io/howto.html index 94b0e015fba..73187d3f1c2 100644 --- a/libstdc++-v3/docs/html/27_io/howto.html +++ b/libstdc++-v3/docs/html/27_io/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> diff --git a/libstdc++-v3/docs/html/abi.txt b/libstdc++-v3/docs/html/abi.txt index 770c3cf5974..73cb46c9c09 100644 --- a/libstdc++-v3/docs/html/abi.txt +++ b/libstdc++-v3/docs/html/abi.txt @@ -1,12 +1,5 @@ -=========================== - -See http://gcc.gnu.org/ml/libstdc++/2002-07/msg00054.html for why this -document exists, why it's incomplete, and what needs to be done still. - -=========================== - -2002-09-06 Benjamin Kosnik +2002-10-14 Benjamin Kosnik Description of the libstdc++ ABI. @@ -244,7 +237,7 @@ II. Library ABI changes The following will cause the library major version number to increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.4.0.0". -- any g++ compiler ABI changes +- (anything) changing in the gcc/g++ compiler ABI - (anything) changing size of an exported symbol @@ -256,7 +249,14 @@ increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.4.0.0". - (anything) deleting an exported symbol -Note: adding an exported symbol, if it's in a new linker map name, is ok. +- (anything) changing the size, alignment, or layout of types + specified in the C++ standard. These may not necessarily be + instantiated or otherwise exported in the library binary, and + include all the required locale facets, as well as things like + std::basic_streambuf, et al. + +Note: adding an exported symbol, if it's in a new and dependent +interface name, is ok. The following will cause the library revision version number to increase, say from "libstdc++.so.5.0.0" to "libstdc++.so.5.0.1". @@ -331,17 +331,20 @@ addition, all exported names are demangled, and the exported objects are checked to make sure they are the same size as the same object in the baseline. -In the future, more tests should be added. In particular, vtable -information, offsets of data members in class objects, and other -layout information should be checked. +This dataset is insufficient, yet a start. Also needed is a +comprehensive check for all user-visible types part of the standard +library for sizeof() and alignof() changes. -It should be possible to use sizeof, alignof, and offset to compute +Verifying compatible layouts of objects is not even attempted. It +should be possible to use sizeof, alignof, and offsetof to compute offsets for each structure and type in the standard library, saving to -another datafile. Then, compute this for new binaries, and look for -differences. +another datafile. Then, compute this in a similar way for new +binaries, and look for differences. Another approach might be to use the -fdump-class-hierarchy flag to -get information. +get information. However, currently this approach gives insufficient +data for use in library testing, as class data members, their offsets, +and other detailed data is not displayed with this flag. (See g++/7470 on how this was used to find bugs.) Perhaps there are other C++ ABI checkers. If so, please notify diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html index 47eb4637fbe..eab9864f330 100644 --- a/libstdc++-v3/docs/html/configopts.html +++ b/libstdc++-v3/docs/html/configopts.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" /> diff --git a/libstdc++-v3/docs/html/documentation.html b/libstdc++-v3/docs/html/documentation.html index aba38723747..a4a79e32b54 100644 --- a/libstdc++-v3/docs/html/documentation.html +++ b/libstdc++-v3/docs/html/documentation.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="KEYWORDS" content="libstdc++, homepage, home, C++, library, c++, std, g++, ABI, STL" /> diff --git a/libstdc++-v3/docs/html/explanations.html b/libstdc++-v3/docs/html/explanations.html index 7d8196ff84a..dac57b87288 100644 --- a/libstdc++-v3/docs/html/explanations.html +++ b/libstdc++-v3/docs/html/explanations.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" /> diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html index b4f6dae6f14..007335b6569 100644 --- a/libstdc++-v3/docs/html/ext/howto.html +++ b/libstdc++-v3/docs/html/ext/howto.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> @@ -276,19 +280,16 @@ same as <code>allocator<T></code>. </li> </ul> - <p>An internal typedef, <code> __mem_interface </code>, is defined to be - <code>__new_alloc</code> by default. - </p> <p>Normally, <code> __default_alloc_template<bool thr, int inst> </code> is also available. This is the high-speed pool, called the default node allocator. The reusable memory is shared among identical instantiations of - this type. It calls through <code>__mem_interface</code> to obtain + this type. It calls through <code>__new_alloc</code> to obtain new memory when its lists run out. If a client container requests a block larger than a certain threshold size, then the pool is bypassed, and the allocate/deallocate request is passed to - <code>__mem_interface</code> directly. + <code>__new_alloc</code> directly. </p> <p>Its <code>inst</code> parameter is described below. The <code>thr</code> boolean determines whether the pool should be @@ -309,17 +310,25 @@ </p> <h3>A cannon to swat a fly:<code> __USE_MALLOC</code></h3> <p>If you've already read <a href="../23_containers/howto.html#3">this - advice</a> and decided to define this macro, then the situation changes - thusly: - </p> - <ol> - <li><code>__mem_interface</code>, and</li> - <li><code>__alloc</code>, and</li> - <li><code>__single_client_alloc</code> are all typedef'd to - <code>__malloc_alloc_template</code>.</li> - <li><code>__default_alloc_template</code> is no longer available. - At all. Anywhere.</li> - </ol> + advice</a> but still think you remember how to use this macro from + SGI STL days. We have removed it in gcc 3.3. See next section + for the new way to get the same effect. + </p> + <h3>Globally disabling memory caching:<code> GLIBCPP_FORCE_NEW</code></h3> + <p>Starting with gcc 3.3, if you want to globally disable memory + caching within the library for the default allocator (i.e. + the one you get for all library objects when you do not specify + which one to use), merely set GLIBCPP_FORCE_NEW (at this time, + with any value) into your environment before running the + program. You will obtain a similar effect without having to + recompile your entire program and the entire library (the new + operator in gcc is a light wrapper around malloc). If your + program crashes with GLIBCPP_FORCE_NEW in the environment, + it likely means that you linked against objects built against + the older library. Code to support this extension is fully + compatible with 3.2 code if GLIBCPP_FORCE_NEW is not in the + environment. + </p> <h3>Writing your own allocators</h3> <p>Depending on your application (a specific program, a generic library, etc), allocator classes tend to be one of two styles: "SGI" diff --git a/libstdc++-v3/docs/html/ext/sgiexts.html b/libstdc++-v3/docs/html/ext/sgiexts.html index 2903cd2b8e1..10fed07eb57 100644 --- a/libstdc++-v3/docs/html/ext/sgiexts.html +++ b/libstdc++-v3/docs/html/ext/sgiexts.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++, STL, SGI" /> @@ -24,7 +28,8 @@ libstdc++-v3</a></h1> for a description). Not every chapter may have extensions, and the extensions may come and go. Also, this page is incomplete because the author is pressed for time. Check back often; the latest change was on - $Date: 2002/09/17 22:59:56 $ (UTC). + + $Date: 2002/10/15 01:34:58 $ (UTC). </p> <p>Descriptions range from the scanty to the verbose. You should also check diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html index 6d42ebc7ecf..c4f4e78a600 100644 --- a/libstdc++-v3/docs/html/faq/index.html +++ b/libstdc++-v3/docs/html/faq/index.html @@ -1,4 +1,8 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++, libg++, STL" /> diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html index 20e2a0a366b..58439330200 100644 --- a/libstdc++-v3/docs/html/install.html +++ b/libstdc++-v3/docs/html/install.html @@ -1,4 +1,9 @@ -<html> +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" /> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" /> @@ -104,8 +109,8 @@ <p> If the 'gnu' locale model is being used, the following locales are used and tested in the libstdc++ testsuites: en_HK, en_US, - fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, and - it_IT. Failure to have the underlying "C" library locale + fr_FR, fr_FR@euro, de_DE, de_DE@euro, ja_JP.eucjp, es_MX, en_PH, + and it_IT. Failure to have the underlying "C" library locale information installed will mean that C++ named locales for the above regions will not work: because of this, the libstdc++ testsuite will not pass the named locale tests. If this isn't an |