diff options
author | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2002-01-04 21:27:36 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2002-01-04 21:27:36 +0000 |
commit | 54c1bf7801758caf2ff54917e79a8c239643061c (patch) | |
tree | f9b7a5cf7ab77ab1aa83870039157784eb5398b3 | |
parent | 48180d6890b349f441109459b1575ef819e7651e (diff) | |
download | gcc-54c1bf7801758caf2ff54917e79a8c239643061c.zip gcc-54c1bf7801758caf2ff54917e79a8c239643061c.tar.gz gcc-54c1bf7801758caf2ff54917e79a8c239643061c.tar.bz2 |
Makefile.am (std_headers): Remove cXXX from list.
2002-01-04 Benjamin Kosnik <bkoz@redhat.com>
* include/Makefile.am (std_headers): Remove cXXX from list.
(c_base_srcdir): No bits subdirectory.
(c_base_builddir): Same.
(c_base_headers): Adjust names, add ciso646.
(bits_headers): Remove std_xxx.h headers.
* include/Makefile.in: Regenerate.
* include/ext/iterator: Adjust includes.
* include/ext/ropeimpl.h: Same.
* include/ext/stl_hash_fun.h: Same.
* include/ext/algorithm: Same.
* include/backward/bvector.h: Adjust includes.
* include/backward/vector.h: Same.
* include/backward/strstream: Same.
* include/backward/streambuf.h: Same.
* include/backward/stack.h: Same.
* include/backward/set.h: Same.
* include/backward/queue.h: Same.
* include/backward/multiset.h: Same.
* include/backward/multimap.h: Same.
* include/backward/map.h: Same.
* include/backward/list.h: Same.
* include/backward/iterator.h: Same.
* include/backward/iostream.h: Same.
* include/backward/iomanip.h: Same.
* include/backward/fstream.h: Same.
* include/backward/deque.h: Same.
* include/backward/complex.h: Same.
* include/bits/std_algorithm.h: Move to...
* include/std/algorithm: ...here.
* include/bits/std_iosfwd.h, std_locale.h, std_stack.h,
std_bitset.h, std_ios.h, std_map.h, std_stdexcept.h,
std_complex.h, std_iostream.h, std_memory.h, std_streambuf.h,
std_deque.h, std_istream.h, std_numeric.h, std_string.h,
std_fstream.h, std_ostream.h, std_utility.h, std_iterator.h,
std_queue.h, std_valarray.h, std_functional.h, std_limits.h,
std_set.h, std_vector.h, std_iomanip.h, std_list.h, std_sstream.h:
Same.
* include/c_std/bits/std_cassert.h: Move to...
* include/c_std/cassert: Here.
* include/c_std/std_cctype.h, std_cerrno.h, std_cfloat.h,
std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h,
std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h,
std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h,
std_cwctype.h: Same.
* include/c_std/cmath: Adjust cmath.tcc include.
* include/c_std/cstdlib: Adjust includes.
* include/c_std/cwchar: Same.
* include/c_std/ctime: Same.
* include/c_std/cstring: Same.
* include/c_std/cstdio: Same.
* include/c_std/bits: Remove directory.
* include/c/bits/std_cassert.h: Move to...
* include/c/cassert: Here.
* include/c/std_cctype.h, std_cerrno.h, std_cfloat.h,
std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h,
std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h,
std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h,
std_cwctype.h: Same.
* include/c/bits: Remove directory.
* include/std/cwctype: Remove.
* include/std/cwchar: Remove.
* include/std/ctime: Remove.
* include/std/cstring: Remove.
* include/std/cstdlib: Remove.
* include/std/cstdio: Remove.
* include/std/cstddef: Remove.
* include/std/cstdarg: Remove.
* include/std/csignal: Remove.
* include/std/csetjmp: Remove.
* include/std/cmath: Remove.
* include/std/clocale: Remove.
* include/std/climits: Remove.
* include/std/ciso646: Remove.
* include/std/cfloat: Remove.
* include/std/cerrno: Remove.
* include/std/cctype: Remove.
* include/std/cassert: Remove.
* include/bits/fpos.h: Adjust includes, removing <bits/std_xxx.h>
files and subsituting <.xxx>
* include/bits/valarray_array.h: Same.
* include/bits/stl_uninitialized.h: Same.
* include/bits/stl_alloc.h: Same.
* include/bits/stl_algobase.h: Same.
* include/bits/sstream.tcc: Same.
* include/bits/pthread_allocimpl.h: Same.
* include/bits/ostream.tcc: Same.
* include/bits/localefwd.h: Same.
* include/bits/locale_facets.tcc: Same.
* include/bits/locale_facets.h: Same.
* include/bits/istream.tcc: Same.
* include/bits/char_traits.h: Same.
* include/bits/boost_concept_check.h: Same.
* include/bits/basic_file.h: Same.
* include/std/bitset: Same.
* include/std/complex: Same.
* include/std/fstream: Same.
* include/std/functional: Same.
* include/std/ios: Same.
* include/std/iostream: Same.
* include/std/ostream: Same.
* include/std/sstream: Same.
* include/std/streambuf: Same.
* include/std/string: Same.
* include/std/iterator: Same.
* include/std/valarray: Same.
* src/ios.cc: Adjust includes.
* src/valarray-inst.cc: Same.
* src/string-inst.cc: Same.
* src/stl-inst.cc: Same.
* src/stdexcept.cc: Same.
* src/misc-inst.cc: Same.
* src/localename.cc: Same.
* src/locale-inst.cc: Same.
* src/locale.cc: Same.
* src/limits.cc: Same.
* src/concept-inst.cc: Same.
* src/complex_io.cc: Same.
* src/codecvt.cc: Same.
* src/bitset.cc: Same.
* src/cmath.cc: Same.
From-SVN: r48544
169 files changed, 7893 insertions, 9591 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 776bbfe..5dbf8df 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,134 @@ +2002-01-04 Benjamin Kosnik <bkoz@redhat.com> + + * include/Makefile.am (std_headers): Remove cXXX from list. + (c_base_srcdir): No bits subdirectory. + (c_base_builddir): Same. + (c_base_headers): Adjust names, add ciso646. + (bits_headers): Remove std_xxx.h headers. + * include/Makefile.in: Regenerate. + + * include/ext/iterator: Adjust includes. + * include/ext/ropeimpl.h: Same. + * include/ext/stl_hash_fun.h: Same. + * include/ext/algorithm: Same. + + * include/backward/bvector.h: Adjust includes. + * include/backward/vector.h: Same. + * include/backward/strstream: Same. + * include/backward/streambuf.h: Same. + * include/backward/stack.h: Same. + * include/backward/set.h: Same. + * include/backward/queue.h: Same. + * include/backward/multiset.h: Same. + * include/backward/multimap.h: Same. + * include/backward/map.h: Same. + * include/backward/list.h: Same. + * include/backward/iterator.h: Same. + * include/backward/iostream.h: Same. + * include/backward/iomanip.h: Same. + * include/backward/fstream.h: Same. + * include/backward/deque.h: Same. + * include/backward/complex.h: Same. + + * include/bits/std_algorithm.h: Move to... + * include/std/algorithm: ...here. + * include/bits/std_iosfwd.h, std_locale.h, std_stack.h, + std_bitset.h, std_ios.h, std_map.h, std_stdexcept.h, + std_complex.h, std_iostream.h, std_memory.h, std_streambuf.h, + std_deque.h, std_istream.h, std_numeric.h, std_string.h, + std_fstream.h, std_ostream.h, std_utility.h, std_iterator.h, + std_queue.h, std_valarray.h, std_functional.h, std_limits.h, + std_set.h, std_vector.h, std_iomanip.h, std_list.h, std_sstream.h: + Same. + + * include/c_std/bits/std_cassert.h: Move to... + * include/c_std/cassert: Here. + * include/c_std/std_cctype.h, std_cerrno.h, std_cfloat.h, + std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h, + std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h, + std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h, + std_cwctype.h: Same. + * include/c_std/cmath: Adjust cmath.tcc include. + * include/c_std/cstdlib: Adjust includes. + * include/c_std/cwchar: Same. + * include/c_std/ctime: Same. + * include/c_std/cstring: Same. + * include/c_std/cstdio: Same. + * include/c_std/bits: Remove directory. + + * include/c/bits/std_cassert.h: Move to... + * include/c/cassert: Here. + * include/c/std_cctype.h, std_cerrno.h, std_cfloat.h, + std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h, + std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h, + std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h, + std_cwctype.h: Same. + * include/c/bits: Remove directory. + + * include/std/cwctype: Remove. + * include/std/cwchar: Remove. + * include/std/ctime: Remove. + * include/std/cstring: Remove. + * include/std/cstdlib: Remove. + * include/std/cstdio: Remove. + * include/std/cstddef: Remove. + * include/std/cstdarg: Remove. + * include/std/csignal: Remove. + * include/std/csetjmp: Remove. + * include/std/cmath: Remove. + * include/std/clocale: Remove. + * include/std/climits: Remove. + * include/std/ciso646: Remove. + * include/std/cfloat: Remove. + * include/std/cerrno: Remove. + * include/std/cctype: Remove. + * include/std/cassert: Remove. + + * include/bits/fpos.h: Adjust includes, removing <bits/std_xxx.h> + files and subsituting <.xxx> + * include/bits/valarray_array.h: Same. + * include/bits/stl_uninitialized.h: Same. + * include/bits/stl_alloc.h: Same. + * include/bits/stl_algobase.h: Same. + * include/bits/sstream.tcc: Same. + * include/bits/pthread_allocimpl.h: Same. + * include/bits/ostream.tcc: Same. + * include/bits/localefwd.h: Same. + * include/bits/locale_facets.tcc: Same. + * include/bits/locale_facets.h: Same. + * include/bits/istream.tcc: Same. + * include/bits/char_traits.h: Same. + * include/bits/boost_concept_check.h: Same. + * include/bits/basic_file.h: Same. + * include/std/bitset: Same. + * include/std/complex: Same. + * include/std/fstream: Same. + * include/std/functional: Same. + * include/std/ios: Same. + * include/std/iostream: Same. + * include/std/ostream: Same. + * include/std/sstream: Same. + * include/std/streambuf: Same. + * include/std/string: Same. + * include/std/iterator: Same. + * include/std/valarray: Same. + + * src/ios.cc: Adjust includes. + * src/valarray-inst.cc: Same. + * src/string-inst.cc: Same. + * src/stl-inst.cc: Same. + * src/stdexcept.cc: Same. + * src/misc-inst.cc: Same. + * src/localename.cc: Same. + * src/locale-inst.cc: Same. + * src/locale.cc: Same. + * src/limits.cc: Same. + * src/concept-inst.cc: Same. + * src/complex_io.cc: Same. + * src/codecvt.cc: Same. + * src/bitset.cc: Same. + * src/cmath.cc: Same. + 2002-01-04 Paolo Carlini <pcarlini@unitus.it> * include/bits/stl_tree.h (rb_tree): Move to... @@ -30,7 +161,7 @@ * include/backward/function.h: Include <ext/functional>, tweak. * include/ext/ropeimpl.h: Include <ext/numeric>. -Thu Jan 3 11:05:41 2002 Jeffrey A Law (law@redhat.com) +2002-01-03 Jeffrey A Law <law@redhat.com> * config/os/hpux/bits/os_defines.h: Prefix __strtoll and __strtoull declarations with __extension__. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 21e07d4..d07776b 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -18520,7 +18520,7 @@ else fi rm -f conftest* - for ac_hdr in unistd.h + for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -18652,11 +18652,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -18764,7 +18777,7 @@ main() } EOF -if { (eval echo configure:18768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:18781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -18795,17 +18808,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:18799: checking for $ac_hdr" >&5 +echo "configure:18812: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 18804 "configure" +#line 18817 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:18809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:18822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -18838,7 +18851,7 @@ done # Can't do these in a loop, else the resulting syntax is wrong. cat > conftest.$ac_ext <<EOF -#line 18842 "configure" +#line 18855 "configure" #include "confdefs.h" #include <sys/resource.h> #include <unistd.h> @@ -18847,7 +18860,7 @@ int main() { int f = RLIMIT_DATA ; ; return 0; } EOF -if { (eval echo configure:18851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:18864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -18864,7 +18877,7 @@ EOF cat > conftest.$ac_ext <<EOF -#line 18868 "configure" +#line 18881 "configure" #include "confdefs.h" #include <sys/resource.h> #include <unistd.h> @@ -18873,7 +18886,7 @@ int main() { int f = RLIMIT_RSS ; ; return 0; } EOF -if { (eval echo configure:18877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:18890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -18890,7 +18903,7 @@ EOF cat > conftest.$ac_ext <<EOF -#line 18894 "configure" +#line 18907 "configure" #include "confdefs.h" #include <sys/resource.h> #include <unistd.h> @@ -18899,7 +18912,7 @@ int main() { int f = RLIMIT_VMEM ; ; return 0; } EOF -if { (eval echo configure:18903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:18916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -18916,7 +18929,7 @@ EOF cat > conftest.$ac_ext <<EOF -#line 18920 "configure" +#line 18933 "configure" #include "confdefs.h" #include <sys/resource.h> #include <unistd.h> @@ -18925,7 +18938,7 @@ int main() { int f = RLIMIT_AS ; ; return 0; } EOF -if { (eval echo configure:18929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:18942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_mresult=1 else @@ -18947,7 +18960,7 @@ EOF else cat > conftest.$ac_ext <<EOF -#line 18951 "configure" +#line 18964 "configure" #include "confdefs.h" #include <sys/resource.h> #include <unistd.h> @@ -18956,7 +18969,7 @@ int main() { struct rlimit r; setrlimit(0, &r); ; return 0; } EOF -if { (eval echo configure:18960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:18973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_setrlimit=yes else @@ -18972,7 +18985,7 @@ fi fi echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6 -echo "configure:18976: checking for testsuite memory limit support" >&5 +echo "configure:18989: checking for testsuite memory limit support" >&5 if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then ac_mem_limits=yes cat >> confdefs.h <<\EOF @@ -19074,13 +19087,13 @@ glibcpp_toolexeclibdir=no glibcpp_prefixdir=${prefix} echo $ac_n "checking for interface version number""... $ac_c" 1>&6 -echo "configure:19078: checking for interface version number" >&5 +echo "configure:19091: checking for interface version number" >&5 libstdcxx_interface=$INTERFACE echo "$ac_t""$libstdcxx_interface" 1>&6 # Process the option --with-gxx-include-dir=<path to include-files directory> echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6 -echo "configure:19084: checking for --with-gxx-include-dir" >&5 +echo "configure:19097: checking for --with-gxx-include-dir" >&5 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. if test "${with_gxx_include_dir+set}" = set; then withval="$with_gxx_include_dir" @@ -19104,7 +19117,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6 # Process the option "--enable-version-specific-runtime-libs" echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6 -echo "configure:19108: checking for --enable-version-specific-runtime-libs" >&5 +echo "configure:19121: checking for --enable-version-specific-runtime-libs" >&5 # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given. if test "${enable_version_specific_runtime_libs+set}" = set; then enableval="$enable_version_specific_runtime_libs" @@ -19151,7 +19164,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then fi echo $ac_n "checking for install location""... $ac_c" 1>&6 -echo "configure:19155: checking for install location" >&5 +echo "configure:19168: checking for install location" >&5 echo "$ac_t""$gxx_include_dir" 1>&6 diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 17c4baa..eff88d0 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -64,35 +64,6 @@ bits_headers = \ ${bits_srcdir}/slice.h \ ${bits_srcdir}/slice_array.h \ ${bits_srcdir}/sstream.tcc \ - ${bits_srcdir}/std_algorithm.h \ - ${bits_srcdir}/std_bitset.h \ - ${bits_srcdir}/std_complex.h \ - ${bits_srcdir}/std_deque.h \ - ${bits_srcdir}/std_fstream.h \ - ${bits_srcdir}/std_functional.h \ - ${bits_srcdir}/std_iomanip.h \ - ${bits_srcdir}/std_ios.h \ - ${bits_srcdir}/std_iosfwd.h \ - ${bits_srcdir}/std_iostream.h \ - ${bits_srcdir}/std_istream.h \ - ${bits_srcdir}/std_iterator.h \ - ${bits_srcdir}/std_limits.h \ - ${bits_srcdir}/std_list.h \ - ${bits_srcdir}/std_locale.h \ - ${bits_srcdir}/std_map.h \ - ${bits_srcdir}/std_memory.h \ - ${bits_srcdir}/std_numeric.h \ - ${bits_srcdir}/std_ostream.h \ - ${bits_srcdir}/std_queue.h \ - ${bits_srcdir}/std_set.h \ - ${bits_srcdir}/std_sstream.h \ - ${bits_srcdir}/std_stack.h \ - ${bits_srcdir}/std_stdexcept.h \ - ${bits_srcdir}/std_streambuf.h \ - ${bits_srcdir}/std_string.h \ - ${bits_srcdir}/std_utility.h \ - ${bits_srcdir}/std_valarray.h \ - ${bits_srcdir}/std_vector.h \ ${bits_srcdir}/stl_algo.h \ ${bits_srcdir}/stl_algobase.h \ ${bits_srcdir}/stl_alloc.h \ @@ -188,26 +159,27 @@ ext_headers = \ ${ext_srcdir}/stl_rope.h # This is the common subset of files that all three "C" header models use. -c_base_srcdir = @C_INCLUDE_DIR@/bits -c_base_builddir = ./bits +c_base_srcdir = @C_INCLUDE_DIR@/ +c_base_builddir = ./ c_base_headers = \ - ${c_base_srcdir}/std_cassert.h \ - ${c_base_srcdir}/std_cctype.h \ - ${c_base_srcdir}/std_cerrno.h \ - ${c_base_srcdir}/std_cfloat.h \ - ${c_base_srcdir}/std_climits.h \ - ${c_base_srcdir}/std_clocale.h \ - ${c_base_srcdir}/std_cmath.h \ - ${c_base_srcdir}/std_csetjmp.h \ - ${c_base_srcdir}/std_csignal.h \ - ${c_base_srcdir}/std_cstdarg.h \ - ${c_base_srcdir}/std_cstddef.h \ - ${c_base_srcdir}/std_cstdio.h \ - ${c_base_srcdir}/std_cstdlib.h \ - ${c_base_srcdir}/std_cstring.h \ - ${c_base_srcdir}/std_ctime.h \ - ${c_base_srcdir}/std_cwchar.h \ - ${c_base_srcdir}/std_cwctype.h \ + ${c_base_srcdir}/cassert \ + ${c_base_srcdir}/cctype \ + ${c_base_srcdir}/cerrno \ + ${c_base_srcdir}/cfloat \ + ${c_base_srcdir}/ciso646 \ + ${c_base_srcdir}/climits \ + ${c_base_srcdir}/clocale \ + ${c_base_srcdir}/cmath \ + ${c_base_srcdir}/csetjmp \ + ${c_base_srcdir}/csignal \ + ${c_base_srcdir}/cstdarg \ + ${c_base_srcdir}/cstddef \ + ${c_base_srcdir}/cstdio \ + ${c_base_srcdir}/cstdlib \ + ${c_base_srcdir}/cstring \ + ${c_base_srcdir}/ctime \ + ${c_base_srcdir}/cwchar \ + ${c_base_srcdir}/cwctype \ ${c_base_srcdir}/cmath.tcc std_srcdir = ${glibcpp_srcdir}/include/std @@ -241,25 +213,7 @@ std_headers = \ ${std_srcdir}/string \ ${std_srcdir}/utility \ ${std_srcdir}/valarray \ - ${std_srcdir}/vector \ - ${std_srcdir}/cassert \ - ${std_srcdir}/cctype \ - ${std_srcdir}/cerrno \ - ${std_srcdir}/cfloat \ - ${std_srcdir}/climits \ - ${std_srcdir}/clocale \ - ${std_srcdir}/ciso646 \ - ${std_srcdir}/cmath \ - ${std_srcdir}/csetjmp \ - ${std_srcdir}/csignal \ - ${std_srcdir}/cstdarg \ - ${std_srcdir}/cstddef \ - ${std_srcdir}/cstdio \ - ${std_srcdir}/cstdlib \ - ${std_srcdir}/cstring \ - ${std_srcdir}/ctime \ - ${std_srcdir}/cwchar \ - ${std_srcdir}/cwctype + ${std_srcdir}/vector target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_builddir = ./${target_alias}/bits diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index f07088c..ab7981c 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1,7 +1,6 @@ -# Makefile.in generated automatically by automake 1.5 from Makefile.am. +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,7 +10,6 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -@SET_MAKE@ SHELL = @SHELL@ @@ -33,9 +31,13 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include + +DESTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ + top_builddir = .. ACLOCAL = @ACLOCAL@ @@ -44,11 +46,11 @@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ + NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : @@ -82,6 +84,7 @@ C_INCLUDE_DIR = @C_INCLUDE_DIR@ DATADIRNAME = @DATADIRNAME@ DEBUG_FLAGS = @DEBUG_FLAGS@ DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ @@ -105,6 +108,7 @@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ @@ -142,23 +146,16 @@ libtool_VERSION = @libtool_VERSION@ release_VERSION = @release_VERSION@ toplevel_srcdir = @toplevel_srcdir@ -# Cross compiler and multilib support. -CXX = @glibcpp_CXX@ -glibcpp_builddir = @glibcpp_builddir@ -glibcpp_srcdir = @glibcpp_srcdir@ - -# Target includes for threads -glibcpp_thread_h = @glibcpp_thread_h@ - -# One big happy istallation: just copy everything from the build to the -# install tree (except for the build stamps). -gxx_include_dir = @gxx_include_dir@ - AUTOMAKE_OPTIONS = 1.3 gnits MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs +# Cross compiler and multilib support. +CXX = @glibcpp_CXX@ +glibcpp_srcdir = @glibcpp_srcdir@ +glibcpp_builddir = @glibcpp_builddir@ + bits_srcdir = ${glibcpp_srcdir}/include/bits bits_builddir = ./bits bits_headers = \ @@ -192,35 +189,6 @@ bits_headers = \ ${bits_srcdir}/slice.h \ ${bits_srcdir}/slice_array.h \ ${bits_srcdir}/sstream.tcc \ - ${bits_srcdir}/std_algorithm.h \ - ${bits_srcdir}/std_bitset.h \ - ${bits_srcdir}/std_complex.h \ - ${bits_srcdir}/std_deque.h \ - ${bits_srcdir}/std_fstream.h \ - ${bits_srcdir}/std_functional.h \ - ${bits_srcdir}/std_iomanip.h \ - ${bits_srcdir}/std_ios.h \ - ${bits_srcdir}/std_iosfwd.h \ - ${bits_srcdir}/std_iostream.h \ - ${bits_srcdir}/std_istream.h \ - ${bits_srcdir}/std_iterator.h \ - ${bits_srcdir}/std_limits.h \ - ${bits_srcdir}/std_list.h \ - ${bits_srcdir}/std_locale.h \ - ${bits_srcdir}/std_map.h \ - ${bits_srcdir}/std_memory.h \ - ${bits_srcdir}/std_numeric.h \ - ${bits_srcdir}/std_ostream.h \ - ${bits_srcdir}/std_queue.h \ - ${bits_srcdir}/std_set.h \ - ${bits_srcdir}/std_sstream.h \ - ${bits_srcdir}/std_stack.h \ - ${bits_srcdir}/std_stdexcept.h \ - ${bits_srcdir}/std_streambuf.h \ - ${bits_srcdir}/std_string.h \ - ${bits_srcdir}/std_utility.h \ - ${bits_srcdir}/std_valarray.h \ - ${bits_srcdir}/std_vector.h \ ${bits_srcdir}/stl_algo.h \ ${bits_srcdir}/stl_algobase.h \ ${bits_srcdir}/stl_alloc.h \ @@ -319,26 +287,27 @@ ext_headers = \ # This is the common subset of files that all three "C" header models use. -c_base_srcdir = @C_INCLUDE_DIR@/bits -c_base_builddir = ./bits +c_base_srcdir = @C_INCLUDE_DIR@/ +c_base_builddir = ./ c_base_headers = \ - ${c_base_srcdir}/std_cassert.h \ - ${c_base_srcdir}/std_cctype.h \ - ${c_base_srcdir}/std_cerrno.h \ - ${c_base_srcdir}/std_cfloat.h \ - ${c_base_srcdir}/std_climits.h \ - ${c_base_srcdir}/std_clocale.h \ - ${c_base_srcdir}/std_cmath.h \ - ${c_base_srcdir}/std_csetjmp.h \ - ${c_base_srcdir}/std_csignal.h \ - ${c_base_srcdir}/std_cstdarg.h \ - ${c_base_srcdir}/std_cstddef.h \ - ${c_base_srcdir}/std_cstdio.h \ - ${c_base_srcdir}/std_cstdlib.h \ - ${c_base_srcdir}/std_cstring.h \ - ${c_base_srcdir}/std_ctime.h \ - ${c_base_srcdir}/std_cwchar.h \ - ${c_base_srcdir}/std_cwctype.h \ + ${c_base_srcdir}/cassert \ + ${c_base_srcdir}/cctype \ + ${c_base_srcdir}/cerrno \ + ${c_base_srcdir}/cfloat \ + ${c_base_srcdir}/ciso646 \ + ${c_base_srcdir}/climits \ + ${c_base_srcdir}/clocale \ + ${c_base_srcdir}/cmath \ + ${c_base_srcdir}/csetjmp \ + ${c_base_srcdir}/csignal \ + ${c_base_srcdir}/cstdarg \ + ${c_base_srcdir}/cstddef \ + ${c_base_srcdir}/cstdio \ + ${c_base_srcdir}/cstdlib \ + ${c_base_srcdir}/cstring \ + ${c_base_srcdir}/ctime \ + ${c_base_srcdir}/cwchar \ + ${c_base_srcdir}/cwctype \ ${c_base_srcdir}/cmath.tcc @@ -373,25 +342,7 @@ std_headers = \ ${std_srcdir}/string \ ${std_srcdir}/utility \ ${std_srcdir}/valarray \ - ${std_srcdir}/vector \ - ${std_srcdir}/cassert \ - ${std_srcdir}/cctype \ - ${std_srcdir}/cerrno \ - ${std_srcdir}/cfloat \ - ${std_srcdir}/climits \ - ${std_srcdir}/clocale \ - ${std_srcdir}/ciso646 \ - ${std_srcdir}/cmath \ - ${std_srcdir}/csetjmp \ - ${std_srcdir}/csignal \ - ${std_srcdir}/cstdarg \ - ${std_srcdir}/cstddef \ - ${std_srcdir}/cstdio \ - ${std_srcdir}/cstdlib \ - ${std_srcdir}/cstring \ - ${std_srcdir}/ctime \ - ${std_srcdir}/cwchar \ - ${std_srcdir}/cwctype + ${std_srcdir}/vector target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ @@ -417,108 +368,114 @@ thread_headers = \ allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \ stamp-target stamp-thread + +# Target includes for threads +glibcpp_thread_h = @glibcpp_thread_h@ uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_] -subdir = include -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -depcomp = -DIST_SOURCES = -all: all-am -.SUFFIXES: +# One big happy istallation: just copy everything from the build to the +# install tree (except for the build stamps). +gxx_include_dir = @gxx_include_dir@ +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in -mostlyclean-libtool: - -rm -f *.lo -clean-libtool: - -rm -rf .libs _libs +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus include/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -distclean-libtool: - -rm -f libtool -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --cygnus include/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && \ - CONFIG_HEADERS= CONFIG_LINKS= \ - CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status -uninstall-info-am: tags: TAGS TAGS: -check-am: -check: check-am -all-am: Makefile all-local -installdirs: +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) -install: install-am +subdir = include + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: +check: check-am +installcheck-am: +installcheck: installcheck-am +install-info-am: +install-info: install-info-am +install-exec-am: install-exec: install-exec-am + +install-data-am: install-data-local install-data: install-data-am -uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -distclean-am: clean-am distclean-generic distclean-libtool +mostlyclean-am: mostlyclean-generic -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: +mostlyclean: mostlyclean-am -install-data-am: install-data-local +clean-am: clean-generic mostlyclean-am -install-exec-am: +clean: clean-am -install-info: +distclean-am: distclean-generic clean-am + -rm -f libtool -install-man: +distclean: distclean-am -installcheck-am: +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -uninstall-am: - -.PHONY: all all-am all-local check check-am clean clean-generic \ - clean-libtool distclean distclean-generic distclean-libtool dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-data-local install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool uninstall uninstall-am uninstall-info-am +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-info-am install-info \ +install-exec-am install-exec install-data-local install-data-am \ +install-data install-am install uninstall-am uninstall all-local \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean # Here are the rules for building the headers @@ -625,6 +582,7 @@ install-data-local: # By adding these files here, automake will remove them for 'make clean' #CLEANFILES = ${allstamps} + # 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. .NOEXPORT: diff --git a/libstdc++-v3/include/backward/bvector.h b/libstdc++-v3/include/backward/bvector.h index 4a04ca6..b114052 100644 --- a/libstdc++-v3/include/backward/bvector.h +++ b/libstdc++-v3/include/backward/bvector.h @@ -58,7 +58,7 @@ #include "backward_warning.h" -#include <bits/std_vector.h> +#include <vector> using std::bit_vector; @@ -67,5 +67,3 @@ using std::bit_vector; // Local Variables: // mode:C++ // End: - - diff --git a/libstdc++-v3/include/backward/complex.h b/libstdc++-v3/include/backward/complex.h index c7e1d1c..0e72174 100644 --- a/libstdc++-v3/include/backward/complex.h +++ b/libstdc++-v3/include/backward/complex.h @@ -29,7 +29,7 @@ #define _CPP_BACKWARD_COMPLEX_H 1 #include "backward_warning.h" -#include <bits/std_complex.h> +#include <complex> using std::complex; typedef complex<float> float_complex; diff --git a/libstdc++-v3/include/backward/deque.h b/libstdc++-v3/include/backward/deque.h index de4bf6a..983ae07 100644 --- a/libstdc++-v3/include/backward/deque.h +++ b/libstdc++-v3/include/backward/deque.h @@ -59,7 +59,7 @@ #include "backward_warning.h" #include "algobase.h" #include "alloc.h" -#include <bits/std_deque.h> +#include <deque> using std::deque; diff --git a/libstdc++-v3/include/backward/fstream.h b/libstdc++-v3/include/backward/fstream.h index 4f03e4c..44461f4 100644 --- a/libstdc++-v3/include/backward/fstream.h +++ b/libstdc++-v3/include/backward/fstream.h @@ -29,7 +29,7 @@ #define _CPP_BACKWARD_FSTREAM_H 1 #include "backward_warning.h" -#include <bits/std_fstream.h> +#include <fstream> using std::filebuf; using std::ifstream; diff --git a/libstdc++-v3/include/backward/iomanip.h b/libstdc++-v3/include/backward/iomanip.h index dad183e..53286cd 100644 --- a/libstdc++-v3/include/backward/iomanip.h +++ b/libstdc++-v3/include/backward/iomanip.h @@ -30,7 +30,7 @@ #include "backward_warning.h" #include "iostream.h" -#include <bits/std_iomanip.h> +#include <iomanip> // These are from <ios> as per [27.4]. using std::boolalpha; diff --git a/libstdc++-v3/include/backward/iostream.h b/libstdc++-v3/include/backward/iostream.h index 0d258af..5346d9d 100644 --- a/libstdc++-v3/include/backward/iostream.h +++ b/libstdc++-v3/include/backward/iostream.h @@ -29,7 +29,7 @@ #define _CPP_BACKWARD_IOSTREAM_H 1 #include "backward_warning.h" -#include <bits/std_iostream.h> +#include <iostream> using std::iostream; using std::ostream; diff --git a/libstdc++-v3/include/backward/iterator.h b/libstdc++-v3/include/backward/iterator.h index 8624fc2..179f457 100644 --- a/libstdc++-v3/include/backward/iterator.h +++ b/libstdc++-v3/include/backward/iterator.h @@ -31,7 +31,7 @@ #include "function.h" #include <stddef.h> #include "iostream.h" -#include <bits/std_iterator.h> +#include <iterator> #include <bits/stl_construct.h> #include <bits/stl_raw_storage_iter.h> diff --git a/libstdc++-v3/include/backward/list.h b/libstdc++-v3/include/backward/list.h index e9db48c..350a92a 100644 --- a/libstdc++-v3/include/backward/list.h +++ b/libstdc++-v3/include/backward/list.h @@ -59,7 +59,7 @@ #include "backward_warning.h" #include "algobase.h" #include "alloc.h" -#include <bits/std_list.h> +#include <list> using std::list; diff --git a/libstdc++-v3/include/backward/map.h b/libstdc++-v3/include/backward/map.h index fb7911a..00f606d 100644 --- a/libstdc++-v3/include/backward/map.h +++ b/libstdc++-v3/include/backward/map.h @@ -58,7 +58,7 @@ #include "backward_warning.h" #include "tree.h" -#include <bits/std_map.h> +#include <map> using std::map; diff --git a/libstdc++-v3/include/backward/multimap.h b/libstdc++-v3/include/backward/multimap.h index 2b36dd3..b9cdc84 100644 --- a/libstdc++-v3/include/backward/multimap.h +++ b/libstdc++-v3/include/backward/multimap.h @@ -58,7 +58,7 @@ #include "backward_warning.h" #include "tree.h" -#include <bits/std_map.h> +#include <map> using std::multimap; diff --git a/libstdc++-v3/include/backward/multiset.h b/libstdc++-v3/include/backward/multiset.h index fb2c02c..8aa7fd3 100644 --- a/libstdc++-v3/include/backward/multiset.h +++ b/libstdc++-v3/include/backward/multiset.h @@ -58,7 +58,7 @@ #include "backward_warning.h" #include "tree.h" -#include <bits/std_set.h> +#include <set> using std::multiset; diff --git a/libstdc++-v3/include/backward/queue.h b/libstdc++-v3/include/backward/queue.h index 6eaf246..1d3b29c 100644 --- a/libstdc++-v3/include/backward/queue.h +++ b/libstdc++-v3/include/backward/queue.h @@ -29,7 +29,7 @@ #define _CPP_BACKWARD_QUEUE_H 1 #include "backward_warning.h" -#include <bits/std_queue.h> +#include <queue> using std::queue; using std::priority_queue; diff --git a/libstdc++-v3/include/backward/set.h b/libstdc++-v3/include/backward/set.h index ae4011a..c189255 100644 --- a/libstdc++-v3/include/backward/set.h +++ b/libstdc++-v3/include/backward/set.h @@ -58,7 +58,7 @@ #include "backward_warning.h" #include "tree.h" -#include <bits/std_set.h> +#include <set> using std::set; diff --git a/libstdc++-v3/include/backward/stack.h b/libstdc++-v3/include/backward/stack.h index 19e8cd1..6f60293 100644 --- a/libstdc++-v3/include/backward/stack.h +++ b/libstdc++-v3/include/backward/stack.h @@ -61,7 +61,7 @@ #include "deque.h" #include "heap.h" #include "queue.h" -#include <bits/std_stack.h> +#include <stack> using std::stack; diff --git a/libstdc++-v3/include/backward/streambuf.h b/libstdc++-v3/include/backward/streambuf.h index 3965816d..aef863f 100644 --- a/libstdc++-v3/include/backward/streambuf.h +++ b/libstdc++-v3/include/backward/streambuf.h @@ -29,7 +29,7 @@ #define _CPP_BACKWARD_STREAMBUF_H 1 #include "backward_warning.h" -#include <bits/std_streambuf.h> +#include <streambuf> using std::streambuf; diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream index f60010c..28308e3 100644 --- a/libstdc++-v3/include/backward/strstream +++ b/libstdc++-v3/include/backward/strstream @@ -49,11 +49,11 @@ #define __SGI_STL_STRSTREAM #include "backward_warning.h" -#include <bits/std_iosfwd.h> -#include <bits/std_ios.h> -#include <bits/std_istream.h> -#include <bits/std_ostream.h> -#include <bits/std_string.h> +#include <iosfwd> +#include <ios> +#include <istream> +#include <ostream> +#include <string> namespace std { diff --git a/libstdc++-v3/include/backward/vector.h b/libstdc++-v3/include/backward/vector.h index 1746cb2..7788068 100644 --- a/libstdc++-v3/include/backward/vector.h +++ b/libstdc++-v3/include/backward/vector.h @@ -59,7 +59,7 @@ #include "backward_warning.h" #include "algobase.h" #include "alloc.h" -#include <bits/std_vector.h> +#include <vector> using std::vector; diff --git a/libstdc++-v3/include/bits/basic_file.h b/libstdc++-v3/include/bits/basic_file.h index 9c0c1d3..51dde5b 100644 --- a/libstdc++-v3/include/bits/basic_file.h +++ b/libstdc++-v3/include/bits/basic_file.h @@ -42,7 +42,7 @@ #pragma GCC system_header #include <bits/c++config.h> -#include <bits/std_ios.h> +#include <ios> namespace std { diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h index bea39cf..29ca61b 100644 --- a/libstdc++-v3/include/bits/boost_concept_check.h +++ b/libstdc++-v3/include/bits/boost_concept_check.h @@ -17,7 +17,7 @@ #define _GLIBCPP_BOOST_CONCEPT_CHECK 1 #pragma GCC system_header -#include <bits/std_cstddef.h> // for ptrdiff_t, used next +#include <cstddef> // for ptrdiff_t, used next #include <bits/stl_iterator_base_types.h> // for traits and tags #include <utility> // for pair<> diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index 710e0eb..7d14838 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -41,7 +41,7 @@ #pragma GCC system_header -#include <bits/std_cstring.h> // For memmove, memset, memchr +#include <cstring> // For memmove, memset, memchr #include <bits/fpos.h> // For streampos namespace std diff --git a/libstdc++-v3/include/bits/fpos.h b/libstdc++-v3/include/bits/fpos.h index 119fbe7..3cb3e4b 100644 --- a/libstdc++-v3/include/bits/fpos.h +++ b/libstdc++-v3/include/bits/fpos.h @@ -42,7 +42,7 @@ #pragma GCC system_header #include <bits/c++io.h> -#include <bits/std_cwchar.h> // For mbstate_t. +#include <cwchar> // For mbstate_t. namespace std { @@ -121,6 +121,3 @@ namespace std } // namespace std #endif - - - diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index 43ea6a5..4bc8da1 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -29,8 +29,8 @@ // ISO C++ 14882: 27.6.2 Output streams // -#include <bits/std_locale.h> -#include <bits/std_ostream.h> // for flush() +#include <locale> +#include <ostream> // For flush() namespace std { diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index 8550709..824b03a 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -41,11 +41,11 @@ #pragma GCC system_header -#include <bits/std_ctime.h> // For struct tm -#include <bits/std_ios.h> // For ios_base +#include <ctime> // For struct tm #ifdef _GLIBCPP_USE_WCHAR_T -# include <bits/std_cwctype.h> // For wctype_t +# include <cwctype> // For wctype_t #endif +#include <ios> // For ios_base namespace std { diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 58d72c7..2731640 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -32,16 +32,16 @@ #ifndef _CPP_BITS_LOCFACETS_TCC #define _CPP_BITS_LOCFACETS_TCC 1 -#include <bits/std_cerrno.h> -#include <bits/std_clocale.h> // For localeconv -#include <bits/std_cstdlib.h> // For strof, strtold -#include <bits/std_cmath.h> // For ceil -#include <bits/std_limits.h> // For numeric_limits -#include <bits/std_memory.h> // For auto_ptr +#include <cerrno> +#include <clocale> // For localeconv +#include <cstdlib> // For strof, strtold +#include <cmath> // For ceil +#include <cctype> // For isspace +#include <limits> // For numeric_limits +#include <memory> // For auto_ptr #include <bits/streambuf_iterator.h> // For streambuf_iterators -#include <bits/std_cctype.h> // For isspace #include <typeinfo> // For bad_cast -#include <bits/std_vector.h> +#include <vector> namespace std { diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index a0fe324..558ccab 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -43,9 +43,9 @@ #include <bits/c++config.h> #include <bits/c++locale.h> // Defines __c_locale, config-specific includes -#include <bits/std_climits.h> // For CHAR_BIT -#include <bits/std_string.h> // For string -#include <bits/std_cctype.h> // For isspace, etc. +#include <climits> // For CHAR_BIT +#include <cctype> // For isspace, etc. +#include <string> // For string #include <bits/functexcept.h> namespace std diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index ff3c958..698029c 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -29,7 +29,7 @@ // ISO C++ 14882: 27.6.2 Output streams // -#include <bits/std_locale.h> +#include <locale> namespace std { diff --git a/libstdc++-v3/include/bits/pthread_allocimpl.h b/libstdc++-v3/include/bits/pthread_allocimpl.h index ca0f980..050b206 100644 --- a/libstdc++-v3/include/bits/pthread_allocimpl.h +++ b/libstdc++-v3/include/bits/pthread_allocimpl.h @@ -62,7 +62,7 @@ // consequences. #include <bits/c++config.h> -#include <bits/std_cerrno.h> +#include <cerrno> #include <bits/stl_alloc.h> #ifndef __RESTRICT # define __RESTRICT diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc index 2a03ff0..4198ea8 100644 --- a/libstdc++-v3/include/bits/sstream.tcc +++ b/libstdc++-v3/include/bits/sstream.tcc @@ -34,7 +34,7 @@ #ifndef _CPP_BITS_SSTREAM_TCC #define _CPP_BITS_SSTREAM_TCC 1 -#include <bits/std_sstream.h> +#include <sstream> namespace std { diff --git a/libstdc++-v3/include/bits/std_algorithm.h b/libstdc++-v3/include/bits/std_algorithm.h deleted file mode 100644 index 746eb47..0000000 --- a/libstdc++-v3/include/bits/std_algorithm.h +++ /dev/null @@ -1,76 +0,0 @@ -// <algorithm> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_algorithm.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_ALGORITHM -#define _CPP_ALGORITHM 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_tempbuf.h> -#include <bits/stl_algo.h> - -#endif /* _CPP_ALGORITHM */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_bitset.h b/libstdc++-v3/include/bits/std_bitset.h deleted file mode 100644 index 67647ce..0000000 --- a/libstdc++-v3/include/bits/std_bitset.h +++ /dev/null @@ -1,814 +0,0 @@ -// <bitset> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1998 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_bitset.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef __GLIBCPP_BITSET -#define __GLIBCPP_BITSET - -#pragma GCC system_header - -// A bitset of size N has N % (sizeof(unsigned long) * CHAR_BIT) unused -// bits. (They are the high- order bits in the highest word.) It is -// a class invariant of class bitset<> that those unused bits are -// always zero. - -// Most of the actual code isn't contained in bitset<> itself, but in the -// base class _Base_bitset. The base class works with whole words, not with -// individual bits. This allows us to specialize _Base_bitset for the -// important special case where the bitset is only a single word. - - -#include <bits/std_cstddef.h> // for size_t -#include <bits/std_cstring.h> // for memset -#include <bits/std_string.h> -#include <bits/std_stdexcept.h> -#include <bits/functexcept.h> // for invalid_argument, out_of_range, - // overflow_error -#include <bits/std_ostream.h> // for ostream (operator<<) -#include <bits/std_istream.h> // for istream (operator>>) - -#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long)) -#define __BITSET_WORDS(__n) \ - ((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD) - -namespace std -{ - -// structure to aid in counting bits -template<bool __dummy> -struct _Bit_count { - static unsigned char _S_bit_count[256]; -}; - -// Mapping from 8 bit unsigned integers to the index of the first one -// bit: -template<bool __dummy> -struct _First_one { - static unsigned char _S_first_one[256]; -}; - -// -// Base class: general case. -// - -template<size_t _Nw> -struct _Base_bitset { - typedef unsigned long _WordT; - - _WordT _M_w[_Nw]; // 0 is the least significant word. - - _Base_bitset( void ) { _M_do_reset(); } - _Base_bitset(unsigned long __val) { - _M_do_reset(); - _M_w[0] = __val; - } - - static size_t _S_whichword( size_t __pos ) - { return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; } - static size_t _S_whichbyte( size_t __pos ) - { return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; } - static size_t _S_whichbit( size_t __pos ) - { return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; } - static _WordT _S_maskbit( size_t __pos ) - { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } - - _WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; } - _WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; } - - _WordT& _M_hiword() { return _M_w[_Nw - 1]; } - _WordT _M_hiword() const { return _M_w[_Nw - 1]; } - - void _M_do_and(const _Base_bitset<_Nw>& __x) { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _M_w[__i] &= __x._M_w[__i]; - } - } - - void _M_do_or(const _Base_bitset<_Nw>& __x) { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _M_w[__i] |= __x._M_w[__i]; - } - } - - void _M_do_xor(const _Base_bitset<_Nw>& __x) { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _M_w[__i] ^= __x._M_w[__i]; - } - } - - void _M_do_left_shift(size_t __shift); - void _M_do_right_shift(size_t __shift); - - void _M_do_flip() { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _M_w[__i] = ~_M_w[__i]; - } - } - - void _M_do_set() { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _M_w[__i] = ~static_cast<_WordT>(0); - } - } - - void _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); } - - bool _M_is_equal(const _Base_bitset<_Nw>& __x) const { - for (size_t __i = 0; __i < _Nw; ++__i) { - if (_M_w[__i] != __x._M_w[__i]) - return false; - } - return true; - } - - bool _M_is_any() const { - for ( size_t __i = 0; __i < _Nw; __i++ ) { - if ( _M_w[__i] != static_cast<_WordT>(0) ) - return true; - } - return false; - } - - size_t _M_do_count() const { - size_t __result = 0; - const unsigned char* __byte_ptr = (const unsigned char*)_M_w; - const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw); - - while ( __byte_ptr < __end_ptr ) { - __result += _Bit_count<true>::_S_bit_count[*__byte_ptr]; - __byte_ptr++; - } - return __result; - } - - unsigned long _M_do_to_ulong() const; - - // find first "on" bit - size_t _M_do_find_first(size_t __not_found) const; - - // find the next "on" bit that follows "prev" - size_t _M_do_find_next(size_t __prev, size_t __not_found) const; -}; - -// -// Definitions of non-inline functions from _Base_bitset. -// - -template<size_t _Nw> -void _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift) -{ - if (__shift != 0) { - const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD; - const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD; - - if (__offset == 0) - for (size_t __n = _Nw - 1; __n >= __wshift; --__n) - _M_w[__n] = _M_w[__n - __wshift]; - - else { - const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset; - for (size_t __n = _Nw - 1; __n > __wshift; --__n) - _M_w[__n] = (_M_w[__n - __wshift] << __offset) | - (_M_w[__n - __wshift - 1] >> __sub_offset); - _M_w[__wshift] = _M_w[0] << __offset; - } - - fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0)); - } -} - -template<size_t _Nw> -void _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift) -{ - if (__shift != 0) { - const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD; - const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD; - const size_t __limit = _Nw - __wshift - 1; - - if (__offset == 0) - for (size_t __n = 0; __n <= __limit; ++__n) - _M_w[__n] = _M_w[__n + __wshift]; - - else { - const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset; - for (size_t __n = 0; __n < __limit; ++__n) - _M_w[__n] = (_M_w[__n + __wshift] >> __offset) | - (_M_w[__n + __wshift + 1] << __sub_offset); - _M_w[__limit] = _M_w[_Nw-1] >> __offset; - } - - fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0)); - } -} - -template<size_t _Nw> -unsigned long _Base_bitset<_Nw>::_M_do_to_ulong() const -{ - for (size_t __i = 1; __i < _Nw; ++__i) - if (_M_w[__i]) - __throw_overflow_error("bitset"); - - return _M_w[0]; -} - -template<size_t _Nw> -size_t _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const -{ - for ( size_t __i = 0; __i < _Nw; __i++ ) { - _WordT __thisword = _M_w[__i]; - if ( __thisword != static_cast<_WordT>(0) ) { - // find byte within word - for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) { - unsigned char __this_byte - = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one<true>::_S_first_one[__this_byte]; - - __thisword >>= CHAR_BIT; - } - } - } - // not found, so return an indication of failure. - return __not_found; -} - -template<size_t _Nw> -size_t -_Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const -{ - // make bound inclusive - ++__prev; - - // check out of bounds - if ( __prev >= _Nw * _GLIBCPP_BITSET_BITS_PER_WORD ) - return __not_found; - - // search first word - size_t __i = _S_whichword(__prev); - _WordT __thisword = _M_w[__i]; - - // mask off bits below bound - __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev); - - if ( __thisword != static_cast<_WordT>(0) ) { - // find byte within word - // get first byte into place - __thisword >>= _S_whichbyte(__prev) * CHAR_BIT; - for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) { - unsigned char __this_byte - = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one<true>::_S_first_one[__this_byte]; - - __thisword >>= CHAR_BIT; - } - } - - // check subsequent words - __i++; - for ( ; __i < _Nw; __i++ ) { - __thisword = _M_w[__i]; - if ( __thisword != static_cast<_WordT>(0) ) { - // find byte within word - for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) { - unsigned char __this_byte - = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one<true>::_S_first_one[__this_byte]; - - __thisword >>= CHAR_BIT; - } - } - } - - // not found, so return an indication of failure. - return __not_found; -} // end _M_do_find_next - - -// ------------------------------------------------------------ - -// -// Base class: specialization for a single word. -// - -template<> struct _Base_bitset<1> { - typedef unsigned long _WordT; - _WordT _M_w; - - _Base_bitset( void ) : _M_w(0) {} - _Base_bitset(unsigned long __val) : _M_w(__val) {} - - static size_t _S_whichword( size_t __pos ) - { return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; } - static size_t _S_whichbyte( size_t __pos ) - { return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; } - static size_t _S_whichbit( size_t __pos ) - { return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; } - static _WordT _S_maskbit( size_t __pos ) - { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } - - _WordT& _M_getword(size_t) { return _M_w; } - _WordT _M_getword(size_t) const { return _M_w; } - - _WordT& _M_hiword() { return _M_w; } - _WordT _M_hiword() const { return _M_w; } - - void _M_do_and(const _Base_bitset<1>& __x) { _M_w &= __x._M_w; } - void _M_do_or(const _Base_bitset<1>& __x) { _M_w |= __x._M_w; } - void _M_do_xor(const _Base_bitset<1>& __x) { _M_w ^= __x._M_w; } - void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; } - void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; } - void _M_do_flip() { _M_w = ~_M_w; } - void _M_do_set() { _M_w = ~static_cast<_WordT>(0); } - void _M_do_reset() { _M_w = 0; } - - bool _M_is_equal(const _Base_bitset<1>& __x) const - { return _M_w == __x._M_w; } - bool _M_is_any() const - { return _M_w != 0; } - - size_t _M_do_count() const { - size_t __result = 0; - const unsigned char* __byte_ptr = (const unsigned char*)&_M_w; - const unsigned char* __end_ptr - = ((const unsigned char*)&_M_w)+sizeof(_M_w); - while ( __byte_ptr < __end_ptr ) { - __result += _Bit_count<true>::_S_bit_count[*__byte_ptr]; - __byte_ptr++; - } - return __result; - } - - unsigned long _M_do_to_ulong() const { return _M_w; } - - size_t _M_do_find_first(size_t __not_found) const; - - // find the next "on" bit that follows "prev" - size_t _M_do_find_next(size_t __prev, size_t __not_found) const; - -}; - - -// ------------------------------------------------------------ -// Helper class to zero out the unused high-order bits in the highest word. - -template <size_t _Extrabits> struct _Sanitize { - static void _M_do_sanitize(unsigned long& __val) - { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); } -}; - -template<> struct _Sanitize<0> { - static void _M_do_sanitize(unsigned long) {} -}; - - - -// ------------------------------------------------------------ -// Class bitset. -// _Nb may be any nonzero number of type size_t. - -template<size_t _Nb> -class bitset : private _Base_bitset<__BITSET_WORDS(_Nb)> -{ -private: - typedef _Base_bitset<__BITSET_WORDS(_Nb)> _Base; - typedef unsigned long _WordT; - -private: - void _M_do_sanitize() { - _Sanitize<_Nb%_GLIBCPP_BITSET_BITS_PER_WORD>::_M_do_sanitize(this->_M_hiword()); - } - -public: - - // bit reference: - class reference; - friend class reference; - - class reference { - friend class bitset; - - _WordT *_M_wp; - size_t _M_bpos; - - // left undefined - reference(); - - public: - reference( bitset& __b, size_t __pos ) { - _M_wp = &__b._M_getword(__pos); - _M_bpos = _Base::_S_whichbit(__pos); - } - - ~reference() {} - - // for b[i] = __x; - reference& operator=(bool __x) { - if ( __x ) - *_M_wp |= _Base::_S_maskbit(_M_bpos); - else - *_M_wp &= ~_Base::_S_maskbit(_M_bpos); - - return *this; - } - - // for b[i] = b[__j]; - reference& operator=(const reference& __j) { - if ( (*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)) ) - *_M_wp |= _Base::_S_maskbit(_M_bpos); - else - *_M_wp &= ~_Base::_S_maskbit(_M_bpos); - - return *this; - } - - // flips the bit - bool operator~() const - { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; } - - // for __x = b[i]; - operator bool() const - { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; } - - // for b[i].flip(); - reference& flip() { - *_M_wp ^= _Base::_S_maskbit(_M_bpos); - return *this; - } - }; - - // 23.3.5.1 constructors: - bitset() {} - bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val) - { _M_do_sanitize(); } - - template<class _CharT, class _Traits, class _Alloc> - explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, - size_t __pos = 0) - : _Base() - { - if (__pos > __s.size()) - __throw_out_of_range("bitset"); - _M_copy_from_string(__s, __pos, - basic_string<_CharT, _Traits, _Alloc>::npos); - } - template<class _CharT, class _Traits, class _Alloc> - bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, - size_t __pos, - size_t __n) - : _Base() - { - if (__pos > __s.size()) - __throw_out_of_range("bitset"); - _M_copy_from_string(__s, __pos, __n); - } - - // 23.3.5.2 bitset operations: - bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) { - this->_M_do_and(__rhs); - return *this; - } - - bitset<_Nb>& operator|=(const bitset<_Nb>& __rhs) { - this->_M_do_or(__rhs); - return *this; - } - - bitset<_Nb>& operator^=(const bitset<_Nb>& __rhs) { - this->_M_do_xor(__rhs); - return *this; - } - - bitset<_Nb>& operator<<=(size_t __pos) { - this->_M_do_left_shift(__pos); - this->_M_do_sanitize(); - return *this; - } - - bitset<_Nb>& operator>>=(size_t __pos) { - this->_M_do_right_shift(__pos); - this->_M_do_sanitize(); - return *this; - } - - // - // Extension: - // Versions of single-bit set, reset, flip, test with no range checking. - // - - bitset<_Nb>& _Unchecked_set(size_t __pos) { - this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); - return *this; - } - - bitset<_Nb>& _Unchecked_set(size_t __pos, int __val) { - if (__val) - this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); - else - this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); - - return *this; - } - - bitset<_Nb>& _Unchecked_reset(size_t __pos) { - this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); - return *this; - } - - bitset<_Nb>& _Unchecked_flip(size_t __pos) { - this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos); - return *this; - } - - bool _Unchecked_test(size_t __pos) const { - return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos)) - != static_cast<_WordT>(0); - } - - // Set, reset, and flip. - - bitset<_Nb>& set() { - this->_M_do_set(); - this->_M_do_sanitize(); - return *this; - } - - bitset<_Nb>& set(size_t __pos, bool __val = true) { - if (__pos >= _Nb) - __throw_out_of_range("bitset"); - - return _Unchecked_set(__pos, __val); - } - - bitset<_Nb>& reset() { - this->_M_do_reset(); - return *this; - } - - bitset<_Nb>& reset(size_t __pos) { - if (__pos >= _Nb) - __throw_out_of_range("bitset"); - - return _Unchecked_reset(__pos); - } - - bitset<_Nb>& flip() { - this->_M_do_flip(); - this->_M_do_sanitize(); - return *this; - } - - bitset<_Nb>& flip(size_t __pos) { - if (__pos >= _Nb) - __throw_out_of_range("bitset"); - - return _Unchecked_flip(__pos); - } - - bitset<_Nb> operator~() const { - return bitset<_Nb>(*this).flip(); - } - - // element access: - //for b[i]; - // _GLIBCPP_RESOLVE_LIB_DEFECTS Note that this implementation already - // resolves DR 11 (items 1 and 2), but does not do the range-checking - // required by that DR's resolution. -pme - reference operator[](size_t __pos) { return reference(*this,__pos); } - bool operator[](size_t __pos) const { return _Unchecked_test(__pos); } - - unsigned long to_ulong() const { return this->_M_do_to_ulong(); } - - template <class _CharT, class _Traits, class _Alloc> - basic_string<_CharT, _Traits, _Alloc> to_string() const { - basic_string<_CharT, _Traits, _Alloc> __result; - _M_copy_to_string(__result); - return __result; - } - - // Helper functions for string operations. - template<class _CharT, class _Traits, class _Alloc> - void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, - size_t, - size_t); - - template<class _CharT, class _Traits, class _Alloc> - void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const; - - size_t count() const { return this->_M_do_count(); } - - size_t size() const { return _Nb; } - - bool operator==(const bitset<_Nb>& __rhs) const { - return this->_M_is_equal(__rhs); - } - bool operator!=(const bitset<_Nb>& __rhs) const { - return !this->_M_is_equal(__rhs); - } - - bool test(size_t __pos) const { - if (__pos >= _Nb) - __throw_out_of_range("bitset"); - - return _Unchecked_test(__pos); - } - - bool any() const { return this->_M_is_any(); } - bool none() const { return !this->_M_is_any(); } - - bitset<_Nb> operator<<(size_t __pos) const - { return bitset<_Nb>(*this) <<= __pos; } - bitset<_Nb> operator>>(size_t __pos) const - { return bitset<_Nb>(*this) >>= __pos; } - - // - // EXTENSIONS: bit-find operations. These operations are - // experimental, and are subject to change or removal in future - // versions. - // - - // find the index of the first "on" bit - size_t _Find_first() const - { return this->_M_do_find_first(_Nb); } - - // find the index of the next "on" bit after prev - size_t _Find_next( size_t __prev ) const - { return this->_M_do_find_next(__prev, _Nb); } - -}; - -// -// Definitions of non-inline member functions. -// - -template <size_t _Nb> -template<class _CharT, class _Traits, class _Alloc> -void bitset<_Nb> - ::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, - size_t __pos, - size_t __n) -{ - reset(); - const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos)); - for (size_t __i = 0; __i < __nbits; ++__i) { - switch(__s[__pos + __nbits - __i - 1]) { - case '0': - break; - case '1': - set(__i); - break; - default: - __throw_invalid_argument("bitset"); - } - } -} - -template <size_t _Nb> -template <class _CharT, class _Traits, class _Alloc> -void bitset<_Nb> - ::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const -{ - __s.assign(_Nb, '0'); - - for (size_t __i = 0; __i < _Nb; ++__i) - if (_Unchecked_test(__i)) - __s[_Nb - 1 - __i] = '1'; -} - -// ------------------------------------------------------------ - -// -// 23.3.5.3 bitset operations: -// - -template <size_t _Nb> -inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result &= __y; - return __result; -} - - -template <size_t _Nb> -inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result |= __y; - return __result; -} - -template <size_t _Nb> -inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result ^= __y; - return __result; -} - -template <class _CharT, class _Traits, size_t _Nb> -basic_istream<_CharT, _Traits>& -operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) -{ - typedef typename _Traits::char_type char_type; - basic_string<_CharT, _Traits> __tmp; - __tmp.reserve(_Nb); - - // Skip whitespace - typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); - if (__sentry) { - basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); - for (size_t __i = 0; __i < _Nb; ++__i) { - static typename _Traits::int_type __eof = _Traits::eof(); - - typename _Traits::int_type __c1 = __buf->sbumpc(); - if (_Traits::eq_int_type(__c1, __eof)) { - __is.setstate(ios_base::eofbit); - break; - } - else { - char_type __c2 = _Traits::to_char_type(__c1); - char_type __c = __is.narrow(__c2, '*'); - - if (__c == '0' || __c == '1') - __tmp.push_back(__c); - else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) { - __is.setstate(ios_base::failbit); - break; - } - } - } - - if (__tmp.empty()) - __is.setstate(ios_base::failbit); - else - __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); - } - - return __is; -} - -template <class _CharT, class _Traits, size_t _Nb> -basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) -{ - basic_string<_CharT, _Traits> __tmp; - __x._M_copy_to_string(__tmp); - return __os << __tmp; -} - -} // namespace std - -#undef __BITSET_WORDS - -#endif /* __GLIBCPP_BITSET */ - - -// Local Variables: -// mode:C++ -// End: - diff --git a/libstdc++-v3/include/bits/std_complex.h b/libstdc++-v3/include/bits/std_complex.h deleted file mode 100644 index d07a6b7..0000000 --- a/libstdc++-v3/include/bits/std_complex.h +++ /dev/null @@ -1,1058 +0,0 @@ -// The template and inlines for the -*- C++ -*- complex number classes. - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 26.2 Complex Numbers -// Note: this is not a conforming implementation. -// Initially implemented by Ulrich Drepper <drepper@cygnus.com> -// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr> -// - -/** @file std_complex.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_COMPLEX -#define _CPP_COMPLEX 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/cpp_type_traits.h> -#include <bits/std_cmath.h> -#include <bits/std_sstream.h> - -namespace std -{ - // Forward declarations - template<typename _Tp> class complex; - template<> class complex<float>; - template<> class complex<double>; - template<> class complex<long double>; - - template<typename _Tp> _Tp abs(const complex<_Tp>&); - template<typename _Tp> _Tp arg(const complex<_Tp>&); - template<typename _Tp> _Tp norm(const complex<_Tp>&); - - template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0); - - // Transcendentals: - template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> log(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int); - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&); - template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, - const complex<_Tp>&); - template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&); - template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&); - template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&); - - - // 26.2.2 Primary template class complex - template<typename _Tp> - class complex - { - public: - typedef _Tp value_type; - - complex(const _Tp& = _Tp(), const _Tp & = _Tp()); - - // Let's the compiler synthetize the copy constructor - // complex (const complex<_Tp>&); - template<typename _Up> - complex(const complex<_Up>&); - - _Tp real() const; - _Tp imag() const; - - complex<_Tp>& operator=(const _Tp&); - complex<_Tp>& operator+=(const _Tp&); - complex<_Tp>& operator-=(const _Tp&); - complex<_Tp>& operator*=(const _Tp&); - complex<_Tp>& operator/=(const _Tp&); - - // Let's the compiler synthetize the - // copy and assignment operator - // complex<_Tp>& operator= (const complex<_Tp>&); - template<typename _Up> - complex<_Tp>& operator=(const complex<_Up>&); - template<typename _Up> - complex<_Tp>& operator+=(const complex<_Up>&); - template<typename _Up> - complex<_Tp>& operator-=(const complex<_Up>&); - template<typename _Up> - complex<_Tp>& operator*=(const complex<_Up>&); - template<typename _Up> - complex<_Tp>& operator/=(const complex<_Up>&); - - private: - _Tp _M_real, _M_imag; - }; - - template<typename _Tp> - inline _Tp - complex<_Tp>::real() const { return _M_real; } - - template<typename _Tp> - inline _Tp - complex<_Tp>::imag() const { return _M_imag; } - - template<typename _Tp> - inline - complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) - : _M_real(__r), _M_imag(__i) { } - - template<typename _Tp> - template<typename _Up> - inline - complex<_Tp>::complex(const complex<_Up>& __z) - : _M_real(__z.real()), _M_imag(__z.imag()) { } - - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator=(const _Tp& __t) - { - _M_real = __t; - _M_imag = _Tp(); - return *this; - } - - // 26.2.5/1 - template<typename _Tp> - inline complex<_Tp>& - complex<_Tp>::operator+=(const _Tp& __t) - { - _M_real += __t; - return *this; - } - - // 26.2.5/3 - template<typename _Tp> - inline complex<_Tp>& - complex<_Tp>::operator-=(const _Tp& __t) - { - _M_real -= __t; - return *this; - } - - // 26.2.5/5 - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator*=(const _Tp& __t) - { - _M_real *= __t; - _M_imag *= __t; - return *this; - } - - // 26.2.5/7 - template<typename _Tp> - complex<_Tp>& - complex<_Tp>::operator/=(const _Tp& __t) - { - _M_real /= __t; - _M_imag /= __t; - return *this; - } - - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator=(const complex<_Up>& __z) - { - _M_real = __z.real(); - _M_imag = __z.imag(); - return *this; - } - - // 26.2.5/9 - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator+=(const complex<_Up>& __z) - { - _M_real += __z.real(); - _M_imag += __z.imag(); - return *this; - } - - // 26.2.5/11 - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator-=(const complex<_Up>& __z) - { - _M_real -= __z.real(); - _M_imag -= __z.imag(); - return *this; - } - - // 26.2.5/13 - // XXX: This is a grammar school implementation. - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator*=(const complex<_Up>& __z) - { - const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag(); - _M_imag = _M_real * __z.imag() + _M_imag * __z.real(); - _M_real = __r; - return *this; - } - - // 26.2.5/15 - // XXX: This is a grammar school implementation. - template<typename _Tp> - template<typename _Up> - complex<_Tp>& - complex<_Tp>::operator/=(const complex<_Up>& __z) - { - const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); - const _Tp __n = norm(__z); - _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; - _M_real = __r / __n; - return *this; - } - - // Operators: - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) += __y; } - - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) += __y; } - - template<typename _Tp> - inline complex<_Tp> - operator+(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__y) += __x; } - - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) -= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) -= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator-(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) -= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) *= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) *= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator*(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__y) *= __x; } - - template<typename _Tp> - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) /= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) /= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator/(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) /= __y; } - - template<typename _Tp> - inline complex<_Tp> - operator+(const complex<_Tp>& __x) - { return __x; } - - template<typename _Tp> - inline complex<_Tp> - operator-(const complex<_Tp>& __x) - { return complex<_Tp>(-__x.real(), -__x.imag()); } - - template<typename _Tp> - inline bool - operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() == __y.real() && __x.imag() == __y.imag(); } - - template<typename _Tp> - inline bool - operator==(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() == __y && __x.imag() == _Tp(); } - - template<typename _Tp> - inline bool - operator==(const _Tp& __x, const complex<_Tp>& __y) - { return __x == __y.real() && _Tp() == __y.imag(); } - - template<typename _Tp> - inline bool - operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() != __y.real() || __x.imag() != __y.imag(); } - - template<typename _Tp> - inline bool - operator!=(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() != __y || __x.imag() != _Tp(); } - - template<typename _Tp> - inline bool - operator!=(const _Tp& __x, const complex<_Tp>& __y) - { return __x != __y.real() || _Tp() != __y.imag(); } - - template<typename _Tp, typename _CharT, class _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) - { - _Tp __re_x, __im_x; - _CharT __ch; - __is >> __ch; - if (__ch == '(') - { - __is >> __re_x >> __ch; - if (__ch == ',') - { - __is >> __im_x >> __ch; - if (__ch == ')') - __x = complex<_Tp>(__re_x, __im_x); - else - __is.setstate(ios_base::failbit); - } - else if (__ch == ')') - __x = complex<_Tp>(__re_x, _Tp(0)); - else - __is.setstate(ios_base::failbit); - } - else - { - __is.putback(__ch); - __is >> __re_x; - __x = complex<_Tp>(__re_x, _Tp(0)); - } - return __is; - } - - template<typename _Tp, typename _CharT, class _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) - { - basic_ostringstream<_CharT, _Traits> __s; - __s.flags(__os.flags()); - __s.imbue(__os.getloc()); - __s.precision(__os.precision()); - __s << '(' << __x.real() << "," << __x.imag() << ')'; - return __os << __s.str(); - } - - // Values - template<typename _Tp> - inline _Tp - real(const complex<_Tp>& __z) - { return __z.real(); } - - template<typename _Tp> - inline _Tp - imag(const complex<_Tp>& __z) - { return __z.imag(); } - - template<typename _Tp> - inline _Tp - abs(const complex<_Tp>& __z) - { - _Tp __x = __z.real(); - _Tp __y = __z.imag(); - const _Tp __s = max(abs(__x), abs(__y)); - if (__s == _Tp()) // well ... - return __s; - __x /= __s; - __y /= __s; - return __s * sqrt(__x * __x + __y * __y); - } - - template<typename _Tp> - inline _Tp - arg(const complex<_Tp>& __z) - { return atan2(__z.imag(), __z.real()); } - - // 26.2.7/5: norm(__z) returns the squared magintude of __z. - // As defined, norm() is -not- a norm is the common mathematical - // sens used in numerics. The helper class _Norm_helper<> tries to - // distinguish between builtin floating point and the rest, so as - // to deliver an answer as close as possible to the real value. - template<bool> - struct _Norm_helper - { - template<typename _Tp> - static inline _Tp _S_do_it(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return __x * __x + __y * __y; - } - }; - - template<> - struct _Norm_helper<true> - { - template<typename _Tp> - static inline _Tp _S_do_it(const complex<_Tp>& __z) - { - _Tp __res = abs(__z); - return __res * __res; - } - }; - - template<typename _Tp> - inline _Tp - norm(const complex<_Tp>& __z) - { - return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z); - } - - template<typename _Tp> - inline complex<_Tp> - polar(const _Tp& __rho, const _Tp& __theta) - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } - - template<typename _Tp> - inline complex<_Tp> - conj(const complex<_Tp>& __z) - { return complex<_Tp>(__z.real(), -__z.imag()); } - - // Transcendentals - template<typename _Tp> - inline complex<_Tp> - cos(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - cosh(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - exp(const complex<_Tp>& __z) - { return polar(exp(__z.real()), __z.imag()); } - - template<typename _Tp> - inline complex<_Tp> - log(const complex<_Tp>& __z) - { return complex<_Tp>(log(abs(__z)), arg(__z)); } - - template<typename _Tp> - inline complex<_Tp> - log10(const complex<_Tp>& __z) - { return log(__z) / log(_Tp(10.0)); } - - template<typename _Tp> - inline complex<_Tp> - sin(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); - } - - template<typename _Tp> - inline complex<_Tp> - sinh(const complex<_Tp>& __z) - { - const _Tp __x = __z.real(); - const _Tp __y = __z.imag(); - return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); - } - - template<typename _Tp> - complex<_Tp> - sqrt(const complex<_Tp>& __z) - { - _Tp __x = __z.real(); - _Tp __y = __z.imag(); - - if (__x == _Tp()) - { - _Tp __t = sqrt(abs(__y) / 2); - return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); - } - else - { - _Tp __t = sqrt(2 * (abs(__z) + abs(__x))); - _Tp __u = __t / 2; - return __x > _Tp() - ? complex<_Tp>(__u, __y / __t) - : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); - } - } - - template<typename _Tp> - inline complex<_Tp> - tan(const complex<_Tp>& __z) - { - return sin(__z) / cos(__z); - } - - template<typename _Tp> - inline complex<_Tp> - tanh(const complex<_Tp>& __z) - { - return sinh(__z) / cosh(__z); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const complex<_Tp>& __z, int __n) - { - return __pow_helper(__z, __n); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const complex<_Tp>& __x, const _Tp& __y) - { - return exp(__y * log(__x)); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - return exp(__y * log(__x)); - } - - template<typename _Tp> - inline complex<_Tp> - pow(const _Tp& __x, const complex<_Tp>& __y) - { - return exp(__y * log(__x)); - } - - // 26.2.3 complex specializations - // complex<float> specialization - template<> class complex<float> - { - public: - typedef float value_type; - - complex(float = 0.0f, float = 0.0f); -#ifdef _GLIBCPP_BUGGY_COMPLEX - complex(const complex& __z) : _M_value(__z._M_value) { } -#endif - explicit complex(const complex<double>&); - explicit complex(const complex<long double>&); - - float real() const; - float imag() const; - - complex<float>& operator=(float); - complex<float>& operator+=(float); - complex<float>& operator-=(float); - complex<float>& operator*=(float); - complex<float>& operator/=(float); - - // Let's the compiler synthetize the copy and assignment - // operator. It always does a pretty good job. - // complex& operator= (const complex&); - template<typename _Tp> - complex<float>&operator=(const complex<_Tp>&); - template<typename _Tp> - complex<float>& operator+=(const complex<_Tp>&); - template<class _Tp> - complex<float>& operator-=(const complex<_Tp>&); - template<class _Tp> - complex<float>& operator*=(const complex<_Tp>&); - template<class _Tp> - complex<float>&operator/=(const complex<_Tp>&); - - private: - typedef __complex__ float _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<double>; - friend class complex<long double>; - }; - - inline float - complex<float>::real() const - { return __real__ _M_value; } - - inline float - complex<float>::imag() const - { return __imag__ _M_value; } - - inline - complex<float>::complex(float r, float i) - { - __real__ _M_value = r; - __imag__ _M_value = i; - } - - inline complex<float>& - complex<float>::operator=(float __f) - { - __real__ _M_value = __f; - __imag__ _M_value = 0.0f; - return *this; - } - - inline complex<float>& - complex<float>::operator+=(float __f) - { - __real__ _M_value += __f; - return *this; - } - - inline complex<float>& - complex<float>::operator-=(float __f) - { - __real__ _M_value -= __f; - return *this; - } - - inline complex<float>& - complex<float>::operator*=(float __f) - { - _M_value *= __f; - return *this; - } - - inline complex<float>& - complex<float>::operator/=(float __f) - { - _M_value /= __f; - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<float>& - complex<float>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // 26.2.3 complex specializations - // complex<double> specialization - template<> class complex<double> - { - public: - typedef double value_type; - - complex(double =0.0, double =0.0); -#ifdef _GLIBCPP_BUGGY_COMPLEX - complex(const complex& __z) : _M_value(__z._M_value) { } -#endif - complex(const complex<float>&); - explicit complex(const complex<long double>&); - - double real() const; - double imag() const; - - complex<double>& operator=(double); - complex<double>& operator+=(double); - complex<double>& operator-=(double); - complex<double>& operator*=(double); - complex<double>& operator/=(double); - - // The compiler will synthetize this, efficiently. - // complex& operator= (const complex&); - template<typename _Tp> - complex<double>& operator=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator+=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator-=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator*=(const complex<_Tp>&); - template<typename _Tp> - complex<double>& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<float>; - friend class complex<long double>; - }; - - inline double - complex<double>::real() const - { return __real__ _M_value; } - - inline double - complex<double>::imag() const - { return __imag__ _M_value; } - - inline - complex<double>::complex(double __r, double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline complex<double>& - complex<double>::operator=(double __d) - { - __real__ _M_value = __d; - __imag__ _M_value = 0.0; - return *this; - } - - inline complex<double>& - complex<double>::operator+=(double __d) - { - __real__ _M_value += __d; - return *this; - } - - inline complex<double>& - complex<double>::operator-=(double __d) - { - __real__ _M_value -= __d; - return *this; - } - - inline complex<double>& - complex<double>::operator*=(double __d) - { - _M_value *= __d; - return *this; - } - - inline complex<double>& - complex<double>::operator/=(double __d) - { - _M_value /= __d; - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<double>& - complex<double>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // 26.2.3 complex specializations - // complex<long double> specialization - template<> class complex<long double> - { - public: - typedef long double value_type; - - complex(long double = 0.0L, long double = 0.0L); -#ifdef _GLIBCPP_BUGGY_COMPLEX - complex(const complex& __z) : _M_value(__z._M_value) { } -#endif - complex(const complex<float>&); - complex(const complex<double>&); - - long double real() const; - long double imag() const; - - complex<long double>& operator= (long double); - complex<long double>& operator+= (long double); - complex<long double>& operator-= (long double); - complex<long double>& operator*= (long double); - complex<long double>& operator/= (long double); - - // The compiler knows how to do this efficiently - // complex& operator= (const complex&); - template<typename _Tp> - complex<long double>& operator=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator+=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator-=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator*=(const complex<_Tp>&); - template<typename _Tp> - complex<long double>& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ long double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex<float>; - friend class complex<double>; - }; - - inline - complex<long double>::complex(long double __r, long double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline long double - complex<long double>::real() const - { return __real__ _M_value; } - - inline long double - complex<long double>::imag() const - { return __imag__ _M_value; } - - inline complex<long double>& - complex<long double>::operator=(long double __r) - { - __real__ _M_value = __r; - __imag__ _M_value = 0.0L; - return *this; - } - - inline complex<long double>& - complex<long double>::operator+=(long double __r) - { - __real__ _M_value += __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator-=(long double __r) - { - __real__ _M_value -= __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator*=(long double __r) - { - _M_value *= __r; - return *this; - } - - inline complex<long double>& - complex<long double>::operator/=(long double __r) - { - _M_value /= __r; - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template<typename _Tp> - inline complex<long double>& - complex<long double>::operator/=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value /= __t; - return *this; - } - - // These bits have to be at the end of this file, so that the - // specializations have all been defined. - // ??? No, they have to be there because of compiler limitation at - // inlining. It suffices that class specializations be defined. - inline - complex<float>::complex(const complex<double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<float>::complex(const complex<long double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<double>::complex(const complex<float>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<double>::complex(const complex<long double>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - } - - inline - complex<long double>::complex(const complex<float>& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex<long double>::complex(const complex<double>& __z) - : _M_value(_ComplexT(__z._M_value)) { } -} // namespace std - -#endif /* _CPP_COMPLEX */ diff --git a/libstdc++-v3/include/bits/std_deque.h b/libstdc++-v3/include/bits/std_deque.h deleted file mode 100644 index 394eef3..0000000 --- a/libstdc++-v3/include/bits/std_deque.h +++ /dev/null @@ -1,77 +0,0 @@ -// <deque> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_deque.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_DEQUE -#define _CPP_DEQUE 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_deque.h> - -#endif /* _CPP_DEQUE */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_fstream.h b/libstdc++-v3/include/bits/std_fstream.h deleted file mode 100644 index 1a651b72..0000000 --- a/libstdc++-v3/include/bits/std_fstream.h +++ /dev/null @@ -1,434 +0,0 @@ -// File based streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.8 File-based streams -// - -/** @file std_fstream.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_FSTREAM -#define _CPP_FSTREAM 1 - -#pragma GCC system_header - -#include <bits/std_istream.h> -#include <bits/std_ostream.h> -#include <bits/basic_file.h> -#include <bits/std_locale.h> // For codecvt -#include <bits/gthr.h> - -namespace std -{ - template<typename _CharT, typename _Traits> - class basic_filebuf : public basic_streambuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard Types: - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef __basic_file<char_type> __file_type; - typedef typename traits_type::state_type __state_type; - typedef codecvt<char_type, char, __state_type> __codecvt_type; - typedef typename __codecvt_type::result __res_type; - typedef ctype<char_type> __ctype_type; - - friend class ios_base; // For sync_with_stdio. - - private: - // Data Members: - // External buffer. - __file_type* _M_file; - - // Current and beginning state type for codecvt. - __state_type _M_state_cur; - __state_type _M_state_beg; - - // MT lock inherited from libio or other low-level io library. - __c_lock _M_lock; - - // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer.. - bool _M_buf_allocated; - - // XXX Needed? - bool _M_last_overflowed; - - public: - // Constructors/destructor: - basic_filebuf(); - - // Non-standard ctor: - basic_filebuf(__c_file_type* __f, ios_base::openmode __mode, - int_type __s = static_cast<int_type>(BUFSIZ)); - - // Non-standard member: - int - fd(); - - virtual - ~basic_filebuf() - { - this->close(); - _M_last_overflowed = false; - } - - // Members: - bool - is_open(void) const { return _M_file ? _M_file->is_open() : false; } - - __filebuf_type* - open(const char* __s, ios_base::openmode __mode); - - __filebuf_type* - close(void); - - protected: - void - _M_allocate_internal_buffer(); - - void - _M_destroy_internal_buffer(); - - void - _M_allocate_pback_buffer(); - - // Create __file_type object and initialize it properly. - void - _M_allocate_file(); - - // Overridden virtual functions: - virtual streamsize - showmanyc(void); - - // Stroustrup, 1998, p. 628 - // underflow() and uflow() functions are called to get the next - // charater from the real input source when the buffer is empty. - // Buffered input uses underflow() - virtual int_type - underflow(void); - - virtual int_type - pbackfail(int_type __c = _Traits::eof()); - - // NB: For what the standard expects of the overflow function, - // see _M_really_overflow(), below. Because basic_streambuf's - // sputc/sputn call overflow directly, and the complications of - // this implementation's setting of the initial pointers all - // equal to _M_buf when initializing, it seems essential to have - // this in actuality be a helper function that checks for the - // eccentricities of this implementation, and then call - // overflow() if indeed the buffer is full. - virtual int_type - overflow(int_type __c = _Traits::eof()); - - // Stroustrup, 1998, p 648 - // The overflow() function is called to transfer characters to the - // real output destination when the buffer is full. A call to - // overflow(c) outputs the contents of the buffer plus the - // character c. - // 27.5.2.4.5 - // Consume some sequence of the characters in the pending sequence. - int_type - _M_really_overflow(int_type __c = _Traits::eof()); - - virtual __streambuf_type* - setbuf(char_type* __s, streamsize __n); - - virtual pos_type - seekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - virtual pos_type - seekpos(pos_type __pos, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - virtual int - sync(void) - { - bool __testput = _M_out_cur && _M_out_beg < _M_out_end; - if (__testput) - { - // Make sure that libio resyncs its idea of the file position - // with the external file. - _M_file->sync(); - - // Need to restore current position. This interpreted as - // the position of the external byte sequence (_M_file) - // plus the offset in the current internal buffer - // (_M_out_beg - _M_out_cur) - streamoff __cur = _M_file->seekoff(0, ios_base::cur); - off_type __off = _M_out_cur - _M_out_beg; - _M_really_overflow(); - _M_file->seekpos(__cur + __off); - } - _M_last_overflowed = false; - return 0; - } - - virtual void - imbue(const locale& __loc); - - virtual streamsize - xsgetn(char_type* __s, streamsize __n) - { - streamsize __ret = 0; - // Clear out pback buffer before going on to the real deal... - if (_M_pback_init) - { - while (__ret < __n && _M_in_cur < _M_in_end) - { - *__s = *_M_in_cur; - ++__ret; - ++__s; - ++_M_in_cur; - } - _M_pback_destroy(); - } - if (__ret < __n) - __ret += __streambuf_type::xsgetn(__s, __n - __ret); - return __ret; - } - - virtual streamsize - xsputn(const char_type* __s, streamsize __n) - { - _M_pback_destroy(); - return __streambuf_type::xsputn(__s, __n); - } - - void - _M_output_unshift(); - }; - - - // 27.8.1.5 Template class basic_ifstream - template<typename _CharT, typename _Traits> - class basic_ifstream : public basic_istream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_istream<char_type, traits_type> __istream_type; - - private: - __filebuf_type _M_filebuf; - - public: - // Constructors/Destructors: - basic_ifstream() - : __istream_type(NULL), _M_filebuf() - { this->init(&_M_filebuf); } - - explicit - basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) - : __istream_type(NULL), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - ~basic_ifstream() - { } - - // Members: - __filebuf_type* - rdbuf() const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - bool - is_open(void) { return _M_filebuf.is_open(); } - - void - open(const char* __s, ios_base::openmode __mode = ios_base::in) - { - if (_M_filebuf.open(__s, __mode | ios_base::in) == NULL) - this->setstate(ios_base::failbit); - } - - void - close(void) - { - if (!_M_filebuf.close()) - this->setstate(ios_base::failbit); - } - }; - - - // 27.8.1.8 Template class basic_ofstream - template<typename _CharT, typename _Traits> - class basic_ofstream : public basic_ostream<_CharT,_Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_ostream<char_type, traits_type> __ostream_type; - - private: - __filebuf_type _M_filebuf; - - public: - // Constructors: - basic_ofstream() - : __ostream_type(NULL), _M_filebuf() - { this->init(&_M_filebuf); } - - explicit - basic_ofstream(const char* __s, - ios_base::openmode __mode = ios_base::out|ios_base::trunc) - : __ostream_type(NULL), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - ~basic_ofstream() - { } - - // Members: - __filebuf_type* - rdbuf(void) const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - bool - is_open(void) { return _M_filebuf.is_open(); } - - void - open(const char* __s, - ios_base::openmode __mode = ios_base::out | ios_base::trunc) - { - if (!_M_filebuf.open(__s, __mode | ios_base::out)) - this->setstate(ios_base::failbit); - } - - void - close(void) - { - if (!_M_filebuf.close()) - setstate(ios_base::failbit); - } - }; - - - // 27.8.1.11 Template class basic_fstream - template<typename _CharT, typename _Traits> - class basic_fstream : public basic_iostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_filebuf<char_type, traits_type> __filebuf_type; - typedef basic_ios<char_type, traits_type> __ios_type; - typedef basic_iostream<char_type, traits_type> __iostream_type; - - private: - __filebuf_type _M_filebuf; - - public: - // Constructors/destructor: - basic_fstream() - : __iostream_type(NULL), _M_filebuf() - { this->init(&_M_filebuf); } - - explicit - basic_fstream(const char* __s, - ios_base::openmode __mode = ios_base::in | ios_base::out) - : __iostream_type(NULL), _M_filebuf() - { - this->init(&_M_filebuf); - this->open(__s, __mode); - } - - ~basic_fstream() - { } - - // Members: - __filebuf_type* - rdbuf(void) const - { return const_cast<__filebuf_type*>(&_M_filebuf); } - - bool - is_open(void) { return _M_filebuf.is_open(); } - - void - open(const char* __s, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { - if (!_M_filebuf.open(__s, __mode)) - setstate(ios_base::failbit); - } - - void - close(void) - { - if (!_M_filebuf.close()) - setstate(ios_base::failbit); - } - }; -} // namespace std - - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# define export -#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS -# include <bits/fstream.tcc> -#endif -#endif - -#endif - diff --git a/libstdc++-v3/include/bits/std_functional.h b/libstdc++-v3/include/bits/std_functional.h deleted file mode 100644 index 82863cc..0000000 --- a/libstdc++-v3/include/bits/std_functional.h +++ /dev/null @@ -1,62 +0,0 @@ -// <functional> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file std_functional.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_FUNCTIONAL -#define _CPP_FUNCTIONAL 1 - -#pragma GCC system_header -#include <bits/c++config.h> -#include <bits/std_cstddef.h> -#include <bits/stl_function.h> - -#endif /* _CPP_FUNCTIONAL */ - -// Local Variables: -// mode:C++ -// End: - diff --git a/libstdc++-v3/include/bits/std_iomanip.h b/libstdc++-v3/include/bits/std_iomanip.h deleted file mode 100644 index ac83db3..0000000 --- a/libstdc++-v3/include/bits/std_iomanip.h +++ /dev/null @@ -1,221 +0,0 @@ -// Standard stream manipulators -*- C++ -*- - -// Copyright (C) 1997-1999, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.3 Standard manipulators -// - -/** @file std_iomanip.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_IOMANIP -#define _CPP_IOMANIP 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/std_istream.h> -#include <bits/std_functional.h> - -namespace std -{ - - struct _Resetiosflags { ios_base::fmtflags _M_mask; }; - - inline _Resetiosflags - resetiosflags(ios_base::fmtflags __mask) - { - _Resetiosflags __x; - __x._M_mask = __mask; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) - { - __is.setf(ios_base::fmtflags(0), __f._M_mask); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f) - { - __os.setf(ios_base::fmtflags(0), __f._M_mask); - return __os; - } - - - struct _Setiosflags { ios_base::fmtflags _M_mask; }; - - inline _Setiosflags - setiosflags(ios_base::fmtflags __mask) - { - _Setiosflags __x; - __x._M_mask = __mask; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) - { - __is.setf(__f._M_mask); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f) - { - __os.setf(__f._M_mask); - return __os; - } - - - struct _Setbase { int _M_base; }; - - inline _Setbase - setbase(int __base) - { - _Setbase __x; - __x._M_base = __base; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f) - { - __is.setf(__f._M_base == 8 ? ios_base::oct : - __f._M_base == 10 ? ios_base::dec : - __f._M_base == 16 ? ios_base::hex : - ios_base::fmtflags(0), ios_base::basefield); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f) - { - __os.setf(__f._M_base == 8 ? ios_base::oct : - __f._M_base == 10 ? ios_base::dec : - __f._M_base == 16 ? ios_base::hex : - ios_base::fmtflags(0), ios_base::basefield); - return __os; - } - - - template<class _CharT> - struct _Setfill { _CharT _M_c; }; - - template<class _CharT> - _Setfill<_CharT> - setfill(_CharT __c) - { - _Setfill<_CharT> __x; - __x._M_c = __c; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) - { - __is.fill(__f._M_c); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f) - { - __os.fill(__f._M_c); - return __os; - } - - - struct _Setprecision { int _M_n; }; - - inline _Setprecision - setprecision(int __n) - { - _Setprecision __x; - __x._M_n = __n; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) - { - __is.precision(__f._M_n); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f) - { - __os.precision(__f._M_n); - return __os; - } - - - struct _Setw { int _M_n; }; - - inline _Setw - setw(int __n) - { - _Setw __x; - __x._M_n = __n; - return __x; - } - - template <class _CharT, class _Traits> - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) - { - __is.width(__f._M_n); - return __is; - } - - template <class _CharT, class _Traits> - basic_ostream<_CharT,_Traits>& - operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f) - { - __os.width(__f._M_n); - return __os; - } -} // namespace std - -#endif diff --git a/libstdc++-v3/include/bits/std_ios.h b/libstdc++-v3/include/bits/std_ios.h deleted file mode 100644 index dfd041f..0000000 --- a/libstdc++-v3/include/bits/std_ios.h +++ /dev/null @@ -1,54 +0,0 @@ -// Iostreams base classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.4 Iostreams base classes -// - -/** @file std_ios.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_IOS -#define _CPP_IOS 1 - -#pragma GCC system_header - -#include <bits/std_iosfwd.h> -#include <exception> // For ios_base::failure -#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos -#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END -#include <bits/localefwd.h> // For class locale -#include <bits/ios_base.h> // For ios_base declarations. -#include <bits/std_streambuf.h> -#include <bits/basic_ios.h> - -#endif /* _CPP_IOS */ - diff --git a/libstdc++-v3/include/bits/std_iosfwd.h b/libstdc++-v3/include/bits/std_iosfwd.h deleted file mode 100644 index 93c30b3..0000000 --- a/libstdc++-v3/include/bits/std_iosfwd.h +++ /dev/null @@ -1,136 +0,0 @@ -// Forwarding declarations -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.2 Forward declarations -// - -/** @file std_iosfwd.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_IOSFWD -#define _CPP_IOSFWD 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/stringfwd.h> // For string forward declarations. -#include <bits/fpos.h> -#include <bits/functexcept.h> - -namespace std -{ - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ios; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_streambuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_istream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ostream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_iostream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_stringbuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_istringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_ostringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT> > - class basic_stringstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_filebuf; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ifstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_ofstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class basic_fstream; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class istreambuf_iterator; - - template<typename _CharT, typename _Traits = char_traits<_CharT> > - class ostreambuf_iterator; - -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not included. (??? Apparently no LWG number?) - class ios_base; -#endif - - typedef basic_ios<char> ios; - typedef basic_streambuf<char> streambuf; - typedef basic_istream<char> istream; - typedef basic_ostream<char> ostream; - typedef basic_iostream<char> iostream; - typedef basic_stringbuf<char> stringbuf; - typedef basic_istringstream<char> istringstream; - typedef basic_ostringstream<char> ostringstream; - typedef basic_stringstream<char> stringstream; - typedef basic_filebuf<char> filebuf; - typedef basic_ifstream<char> ifstream; - typedef basic_ofstream<char> ofstream; - typedef basic_fstream<char> fstream; - -#ifdef _GLIBCPP_USE_WCHAR_T - typedef basic_ios<wchar_t> wios; - typedef basic_streambuf<wchar_t> wstreambuf; - typedef basic_istream<wchar_t> wistream; - typedef basic_ostream<wchar_t> wostream; - typedef basic_iostream<wchar_t> wiostream; - typedef basic_stringbuf<wchar_t> wstringbuf; - typedef basic_istringstream<wchar_t> wistringstream; - typedef basic_ostringstream<wchar_t> wostringstream; - typedef basic_stringstream<wchar_t> wstringstream; - typedef basic_filebuf<wchar_t> wfilebuf; - typedef basic_ifstream<wchar_t> wifstream; - typedef basic_ofstream<wchar_t> wofstream; - typedef basic_fstream<wchar_t> wfstream; -#endif -} // namespace std - -#endif diff --git a/libstdc++-v3/include/bits/std_iostream.h b/libstdc++-v3/include/bits/std_iostream.h deleted file mode 100644 index 32893fa..0000000 --- a/libstdc++-v3/include/bits/std_iostream.h +++ /dev/null @@ -1,65 +0,0 @@ -// Standard iostream objects -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.3 Standard iostream objects -// - -/** @file std_iostream.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_IOSTREAM -#define _CPP_IOSTREAM 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/std_ostream.h> -#include <bits/std_istream.h> - -namespace std -{ - extern istream cin; - extern ostream cout; - extern ostream cerr; - extern ostream clog; -#ifdef _GLIBCPP_USE_WCHAR_T - extern wistream wcin; - extern wostream wcout; - extern wostream wcerr; - extern wostream wclog; -#endif - - // For construction of filebuffers for cout, cin, cerr, clog et. al. - static ios_base::Init __ioinit; -} // namespace std - -#endif diff --git a/libstdc++-v3/include/bits/std_istream.h b/libstdc++-v3/include/bits/std_istream.h deleted file mode 100644 index 4afbbc0..0000000 --- a/libstdc++-v3/include/bits/std_istream.h +++ /dev/null @@ -1,299 +0,0 @@ -// Input streams -*- C++ -*- - -// Copyright (C) 1997-1999, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.1 Input streams -// - -/** @file std_istream.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_ISTREAM -#define _CPP_ISTREAM 1 - -#pragma GCC system_header - -#include <bits/std_ios.h> -#include <bits/std_limits.h> // For numeric_limits - -namespace std -{ - // 27.6.1.1 Template class basic_istream - template<typename _CharT, typename _Traits> - class basic_istream : virtual public basic_ios<_CharT, _Traits> - { - public: - // Types (inherited from basic_ios (27.4.4)): - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - - // Non-standard Types: - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_ios<_CharT, _Traits> __ios_type; - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter; - typedef num_get<_CharT, __istreambuf_iter> __numget_type; - typedef ctype<_CharT> __ctype_type; - - protected: - // Data Members: - streamsize _M_gcount; - - public: - // 27.6.1.1.1 Constructor/destructor: - explicit - basic_istream(__streambuf_type* __sb) - { - this->init(__sb); - _M_gcount = streamsize(0); - } - - virtual - ~basic_istream() - { _M_gcount = streamsize(0); } - - // 27.6.1.1.2 Prefix/suffix: - class sentry; - friend class sentry; - - // 27.6.1.2 Formatted input: - // 27.6.1.2.3 basic_istream::operator>> - __istream_type& - operator>>(__istream_type& (*__pf)(__istream_type&)); - - __istream_type& - operator>>(__ios_type& (*__pf)(__ios_type&)); - - __istream_type& - operator>>(ios_base& (*__pf)(ios_base&)); - - // 27.6.1.2.2 Arithmetic Extractors - __istream_type& - operator>>(bool& __n); - - __istream_type& - operator>>(short& __n); - - __istream_type& - operator>>(unsigned short& __n); - - __istream_type& - operator>>(int& __n); - - __istream_type& - operator>>(unsigned int& __n); - - __istream_type& - operator>>(long& __n); - - __istream_type& - operator>>(unsigned long& __n); - -#ifdef _GLIBCPP_USE_LONG_LONG - __istream_type& - operator>>(long long& __n); - - __istream_type& - operator>>(unsigned long long& __n); -#endif - - __istream_type& - operator>>(float& __f); - - __istream_type& - operator>>(double& __f); - - __istream_type& - operator>>(long double& __f); - - __istream_type& - operator>>(void*& __p); - - __istream_type& - operator>>(__streambuf_type* __sb); - - // 27.6.1.3 Unformatted input: - inline streamsize - gcount(void) const - { return _M_gcount; } - - int_type - get(void); - - __istream_type& - get(char_type& __c); - - __istream_type& - get(char_type* __s, streamsize __n, char_type __delim); - - inline __istream_type& - get(char_type* __s, streamsize __n) - { return this->get(__s, __n, this->widen('\n')); } - - __istream_type& - get(__streambuf_type& __sb, char_type __delim); - - inline __istream_type& - get(__streambuf_type& __sb) - { return this->get(__sb, this->widen('\n')); } - - __istream_type& - getline(char_type* __s, streamsize __n, char_type __delim); - - inline __istream_type& - getline(char_type* __s, streamsize __n) - { return this->getline(__s, __n, this->widen('\n')); } - - __istream_type& - ignore(streamsize __n = 1, int_type __delim = traits_type::eof()); - - int_type - peek(void); - - __istream_type& - read(char_type* __s, streamsize __n); - - streamsize - readsome(char_type* __s, streamsize __n); - - __istream_type& - putback(char_type __c); - - __istream_type& - unget(void); - - int - sync(void); - - pos_type - tellg(void); - - __istream_type& - seekg(pos_type); - - __istream_type& - seekg(off_type, ios_base::seekdir); - - private: -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not defined. (Side effect of DR 50.) - __istream_type& - operator=(const __istream_type&); - - basic_istream(const __istream_type&); -#endif - }; - - template<typename _CharT, typename _Traits> - class basic_istream<_CharT, _Traits>::sentry - { - public: - typedef _Traits traits_type; - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef typename _Traits::int_type __int_type; - - explicit - sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false); - - operator bool() { return _M_ok; } - - private: - bool _M_ok; - }; - - // 27.6.1.2.3 Character extraction templates - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); - - template<class _Traits> - basic_istream<char, _Traits>& - operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) - { return (__in >> reinterpret_cast<char&>(__c)); } - - template<class _Traits> - basic_istream<char, _Traits>& - operator>>(basic_istream<char, _Traits>& __in, signed char& __c) - { return (__in >> reinterpret_cast<char&>(__c)); } - - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); - - template<class _Traits> - basic_istream<char,_Traits>& - operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s) - { return (__in >> reinterpret_cast<char*>(__s)); } - - template<class _Traits> - basic_istream<char,_Traits>& - operator>>(basic_istream<char,_Traits>& __in, signed char* __s) - { return (__in >> reinterpret_cast<char*>(__s)); } - - // 27.6.1.5 Template class basic_iostream - template<typename _CharT, typename _Traits> - class basic_iostream - : public basic_istream<_CharT, _Traits>, - public basic_ostream<_CharT, _Traits> - { - public: - // Non-standard Types: - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef basic_ostream<_CharT, _Traits> __ostream_type; - - explicit - basic_iostream(basic_streambuf<_CharT, _Traits>* __sb) - : __istream_type(__sb), __ostream_type(__sb) - { } - - virtual - ~basic_iostream() { } - }; - - // 27.6.1.4 Standard basic_istream manipulators - template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& - ws(basic_istream<_CharT, _Traits>& __is); -} // namespace std - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# define export -#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS -# include <bits/istream.tcc> -#endif -#endif - -#endif /* _CPP_ISTREAM */ diff --git a/libstdc++-v3/include/bits/std_iterator.h b/libstdc++-v3/include/bits/std_iterator.h deleted file mode 100644 index 3e3541c..0000000 --- a/libstdc++-v3/include/bits/std_iterator.h +++ /dev/null @@ -1,79 +0,0 @@ -// <iterator> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_iterator.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_ITERATOR -#define _CPP_ITERATOR 1 - -#pragma GCC system_header -#include <bits/c++config.h> -#include <bits/std_cstddef.h> -#include <bits/stl_iterator_base_types.h> -#include <bits/stl_iterator_base_funcs.h> -#include <bits/stl_iterator.h> -#include <bits/std_ostream.h> -#include <bits/std_istream.h> -#include <bits/stream_iterator.h> -#include <bits/streambuf_iterator.h> - -#endif /* _CPP_ITERATOR */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_limits.h b/libstdc++-v3/include/bits/std_limits.h deleted file mode 100644 index 7a64636..0000000 --- a/libstdc++-v3/include/bits/std_limits.h +++ /dev/null @@ -1,2017 +0,0 @@ -// The template and inlines for the -*- C++ -*- numeric_limits classes. - -// Copyright (C) 1999-2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Note: this is not a conforming implementation. -// Written by Gabriel Dos Reis <gdr@codesourcery.com> - -// -// ISO 14882:1998 -// 18.2.1 -// - -/** @file std_limits.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_NUMERIC_LIMITS -#define _CPP_NUMERIC_LIMITS 1 - -#pragma GCC system_header - -#include <bits/cpu_limits.h> -#include <bits/c++config.h> - -// -// The numeric_limits<> traits document implementation-defined aspects -// of fundamental arithmetic data types (integers and floating points). -// From Standard C++ point of view, there are 13 such types: -// * integers -// bool (1) -// char, signed char, unsigned char (3) -// short, unsigned short (2) -// int, unsigned (2) -// long, unsigned long (2) -// -// * floating points -// float (1) -// double (1) -// long double (1) -// -// GNU C++ undertstands (where supported by the host C-library) -// * integer -// long long, unsigned long long (2) -// -// which brings us to 15 fundamental arithmetic data types in GNU C++. -// -// -// Since a numeric_limits<> is a bit tricky to get right, we rely on -// an interface composed of macros which should be defined in config/os -// or config/cpu when they differ from the generic (read arbitrary) -// definitions given here. -// - -// These values can be overridden in the target configuration file. -// The default values are appropriate for many 32-bit targets. - -#ifndef __glibcpp_char_bits -#define __glibcpp_char_bits 8 -#endif -#ifdef __CHAR_UNSIGNED__ -#define __glibcpp_plain_char_is_signed false -#else -#define __glibcpp_plain_char_is_signed true -#endif -#ifndef __glibcpp_short_bits -#define __glibcpp_short_bits 16 -#endif -#ifndef __glibcpp_int_bits -#define __glibcpp_int_bits 32 -#endif -#ifndef __glibcpp_long_bits -#define __glibcpp_long_bits 32 -#endif -#ifndef __glibcpp_wchar_t_bits -#define __glibcpp_wchar_t_bits 32 -#endif -#ifndef __glibcpp_wchar_t_is_signed -#define __glibcpp_wchar_t_is_signed true -#endif -#ifndef __glibcpp_long_long_bits -#define __glibcpp_long_long_bits 64 -#endif -#ifndef __glibcpp_float_bits -#define __glibcpp_float_bits 32 -#endif -#ifndef __glibcpp_double_bits -#define __glibcpp_double_bits 64 -#endif -#ifndef __glibcpp_long_double_bits -#define __glibcpp_long_double_bits 128 -#endif - -#ifndef __glibcpp_char_traps -#define __glibcpp_char_traps true -#endif -#ifndef __glibcpp_short_traps -#define __glibcpp_short_traps true -#endif -#ifndef __glibcpp_int_traps -#define __glibcpp_int_traps true -#endif -#ifndef __glibcpp_long_traps -#define __glibcpp_long_traps true -#endif -#ifndef __glibcpp_wchar_t_traps -#define __glibcpp_wchar_t_traps true -#endif -#ifndef __glibcpp_long_long_traps -#define __glibcpp_long_long_traps true -#endif - -// You should not need to define any macros below this point, unless -// you have a machine with non-standard bit-widths. - -// These values are the minimums and maximums for standard data types -// of common widths. - -#define __glibcpp_s8_max 127 -#define __glibcpp_s8_min (-__glibcpp_s8_max - 1) -#define __glibcpp_s8_digits 7 -#define __glibcpp_s8_digits10 2 -#define __glibcpp_u8_min 0U -#define __glibcpp_u8_max (__glibcpp_s8_max * 2 + 1) -#define __glibcpp_u8_digits 8 -#define __glibcpp_u8_digits10 2 -#define __glibcpp_s16_max 32767 -#define __glibcpp_s16_min (-__glibcpp_s16_max - 1) -#define __glibcpp_s16_digits 15 -#define __glibcpp_s16_digits10 4 -#define __glibcpp_u16_min 0U -#define __glibcpp_u16_max (__glibcpp_s16_max * 2 + 1) -#define __glibcpp_u16_digits 16 -#define __glibcpp_u16_digits10 4 -#define __glibcpp_s32_max 2147483647L -#define __glibcpp_s32_min (-__glibcpp_s32_max - 1) -#define __glibcpp_s32_digits 31 -#define __glibcpp_s32_digits10 9 -#define __glibcpp_u32_min 0UL -#define __glibcpp_u32_max (__glibcpp_s32_max * 2U + 1) -#define __glibcpp_u32_digits 32 -#define __glibcpp_u32_digits10 9 -#define __glibcpp_s64_max 9223372036854775807LL -#define __glibcpp_s64_min (-__glibcpp_s64_max - 1) -#define __glibcpp_s64_digits 63 -#define __glibcpp_s64_digits10 18 -#define __glibcpp_u64_min 0ULL -#define __glibcpp_u64_max (__glibcpp_s64_max * 2ULL + 1) -#define __glibcpp_u64_digits 64 -#define __glibcpp_u64_digits10 19 - -#define __glibcpp_f32_min 1.17549435e-38F -#define __glibcpp_f32_max 3.40282347e+38F -#define __glibcpp_f32_digits 24 -#define __glibcpp_f32_digits10 6 -#define __glibcpp_f32_radix 2 -#define __glibcpp_f32_epsilon 1.19209290e-07F -#define __glibcpp_f32_round_error 1.0F -#define __glibcpp_f32_min_exponent -125 -#define __glibcpp_f32_min_exponent10 -37 -#define __glibcpp_f32_max_exponent 128 -#define __glibcpp_f32_max_exponent10 38 -#define __glibcpp_f64_min 2.2250738585072014e-308 -#define __glibcpp_f64_max 1.7976931348623157e+308 -#define __glibcpp_f64_digits 53 -#define __glibcpp_f64_digits10 15 -#define __glibcpp_f64_radix 2 -#define __glibcpp_f64_epsilon 2.2204460492503131e-16 -#define __glibcpp_f64_round_error 1.0 -#define __glibcpp_f64_min_exponent -1021 -#define __glibcpp_f64_min_exponent10 -307 -#define __glibcpp_f64_max_exponent 1024 -#define __glibcpp_f64_max_exponent10 308 -#define __glibcpp_f80_min 3.36210314311209350626e-4932L -#define __glibcpp_f80_max 1.18973149535723176502e+4932L -#define __glibcpp_f80_digits 64 -#define __glibcpp_f80_digits10 18 -#define __glibcpp_f80_radix 2 -#define __glibcpp_f80_epsilon 1.08420217248550443401e-19L -#define __glibcpp_f80_round_error 1.0L -#define __glibcpp_f80_min_exponent -16381 -#define __glibcpp_f80_min_exponent10 -4931 -#define __glibcpp_f80_max_exponent 16384 -#define __glibcpp_f80_max_exponent10 4932 -#define __glibcpp_f96_min 1.68105157155604675313e-4932L -#define __glibcpp_f96_max 1.18973149535723176502e+4932L -#define __glibcpp_f96_digits 64 -#define __glibcpp_f96_digits10 18 -#define __glibcpp_f96_radix 2 -#define __glibcpp_f96_epsilon 1.08420217248550443401e-19L -#define __glibcpp_f96_round_error 1.0L -#define __glibcpp_f96_min_exponent -16382 -#define __glibcpp_f96_min_exponent10 -4931 -#define __glibcpp_f96_max_exponent 16384 -#define __glibcpp_f96_max_exponent10 4932 -#define __glibcpp_f128_min 3.362103143112093506262677817321752603E-4932L -#define __glibcpp_f128_max 1.189731495357231765085759326628007016E+4932L -#define __glibcpp_f128_digits 113 -#define __glibcpp_f128_digits10 33 -#define __glibcpp_f128_radix 2 -#define __glibcpp_f128_epsilon 1.925929944387235853055977942584927319E-34L -#define __glibcpp_f128_round_error 1.0L -#define __glibcpp_f128_min_exponent -16381 -#define __glibcpp_f128_min_exponent10 -4931 -#define __glibcpp_f128_max_exponent 16384 -#define __glibcpp_f128_max_exponent10 4932 - -// bool-specific hooks: -// __glibcpp_bool_digits __glibcpp_int_traps __glibcpp_long_traps - -// This is actually CHAR_BITS because the new ABI says a bool -// is one (1) byte wide. - -#ifndef __glibcpp_bool_digits -#define __glibcpp_bool_digits __glibcpp_char_bits -#endif - -// char. - -#define __glibcpp_plain_char_traps true -#define __glibcpp_signed_char_traps true -#define __glibcpp_unsigned_char_traps true -#ifndef __glibcpp_char_is_modulo -#define __glibcpp_char_is_modulo true -#endif -#ifndef __glibcpp_signed_char_is_modulo -#define __glibcpp_signed_char_is_modulo true -#endif -#if __glibcpp_char_bits == 8 -#define __glibcpp_signed_char_min __glibcpp_s8_min -#define __glibcpp_signed_char_max __glibcpp_s8_max -#define __glibcpp_signed_char_digits __glibcpp_s8_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_char_min __glibcpp_u8_min -#define __glibcpp_unsigned_char_max __glibcpp_u8_max -#define __glibcpp_unsigned_char_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_char_bits == 16 -#define __glibcpp_signed_char_min __glibcpp_s16_min -#define __glibcpp_signed_char_max __glibcpp_s16_max -#define __glibcpp_signed_char_digits __glibcpp_s16_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_char_min __glibcpp_u16_min -#define __glibcpp_unsigned_char_max __glibcpp_u16_max -#define __glibcpp_unsigned_char_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_char_bits == 32 -#define __glibcpp_signed_char_min (signed char)__glibcpp_s32_min -#define __glibcpp_signed_char_max (signed char)__glibcpp_s32_max -#define __glibcpp_signed_char_digits __glibcpp_s32_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u32_min -#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u32_max -#define __glibcpp_unsigned_char_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_char_bits == 64 -#define __glibcpp_signed_char_min (signed char)__glibcpp_s64_min -#define __glibcpp_signed_char_max (signed char)__glibcpp_s64_max -#define __glibcpp_signed_char_digits __glibcpp_s64_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u64_min -#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u64_max -#define __glibcpp_unsigned_char_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -#if __glibcpp_plain_char_is_signed -#define __glibcpp_char_min (char)__glibcpp_signed_char_min -#define __glibcpp_char_max (char)__glibcpp_signed_char_max -#define __glibcpp_char_digits __glibcpp_signed_char_digits -#define __glibcpp_char_digits10 __glibcpp_signed_char_digits -#else -#define __glibcpp_char_min (char)__glibcpp_unsigned_char_min -#define __glibcpp_char_max (char)__glibcpp_unsigned_char_max -#define __glibcpp_char_digits __glibcpp_unsigned_char_digits -#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits -#endif - -// short - -#define __glibcpp_signed_short_traps true -#define __glibcpp_unsigned_short_traps true -#ifndef __glibcpp_signed_short_is_modulo -#define __glibcpp_signed_short_is_modulo true -#endif -#if __glibcpp_short_bits == 8 -#define __glibcpp_signed_short_min __glibcpp_s8_min -#define __glibcpp_signed_short_max __glibcpp_s8_max -#define __glibcpp_signed_short_digits __glibcpp_s8_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_short_min __glibcpp_u8_min -#define __glibcpp_unsigned_short_max __glibcpp_u8_max -#define __glibcpp_unsigned_short_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_short_bits == 16 -#define __glibcpp_signed_short_min __glibcpp_s16_min -#define __glibcpp_signed_short_max __glibcpp_s16_max -#define __glibcpp_signed_short_digits __glibcpp_s16_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_short_min __glibcpp_u16_min -#define __glibcpp_unsigned_short_max __glibcpp_u16_max -#define __glibcpp_unsigned_short_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_short_bits == 32 -#define __glibcpp_signed_short_min (short)__glibcpp_s32_min -#define __glibcpp_signed_short_max (short)__glibcpp_s32_max -#define __glibcpp_signed_short_digits __glibcpp_s32_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u32_min -#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u32_max -#define __glibcpp_unsigned_short_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_short_bits == 64 -#define __glibcpp_signed_short_min (short)__glibcpp_s64_min -#define __glibcpp_signed_short_max (short)__glibcpp_s64_max -#define __glibcpp_signed_short_digits __glibcpp_s64_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u64_min -#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u64_max -#define __glibcpp_unsigned_short_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// int - -#define __glibcpp_signed_int_traps true -#define __glibcpp_unsigned_int_traps true -#ifndef __glibcpp_signed_int_is_modulo -#define __glibcpp_signed_int_is_modulo true -#endif -#if __glibcpp_int_bits == 8 -#define __glibcpp_signed_int_min __glibcpp_s8_min -#define __glibcpp_signed_int_max __glibcpp_s8_max -#define __glibcpp_signed_int_digits __glibcpp_s8_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_int_min __glibcpp_u8_min -#define __glibcpp_unsigned_int_max __glibcpp_u8_max -#define __glibcpp_unsigned_int_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_int_bits == 16 -#define __glibcpp_signed_int_min __glibcpp_s16_min -#define __glibcpp_signed_int_max __glibcpp_s16_max -#define __glibcpp_signed_int_digits __glibcpp_s16_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_int_min __glibcpp_u16_min -#define __glibcpp_unsigned_int_max __glibcpp_u16_max -#define __glibcpp_unsigned_int_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_int_bits == 32 -#define __glibcpp_signed_int_min (int)__glibcpp_s32_min -#define __glibcpp_signed_int_max (int)__glibcpp_s32_max -#define __glibcpp_signed_int_digits __glibcpp_s32_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u32_min -#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u32_max -#define __glibcpp_unsigned_int_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_int_bits == 64 -#define __glibcpp_signed_int_min (int)__glibcpp_s64_min -#define __glibcpp_signed_int_max (int)__glibcpp_s64_max -#define __glibcpp_signed_int_digits __glibcpp_s64_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u64_min -#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u64_max -#define __glibcpp_unsigned_int_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// long - -#define __glibcpp_signed_long_traps true -#define __glibcpp_unsigned_long_traps true -#ifndef __glibcpp_signed_long_is_modulo -#define __glibcpp_signed_long_is_modulo true -#endif -#if __glibcpp_long_bits == 8 -#define __glibcpp_signed_long_min __glibcpp_s8_min -#define __glibcpp_signed_long_max __glibcpp_s8_max -#define __glibcpp_signed_long_digits __glibcpp_s8_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u8_min -#define __glibcpp_unsigned_long_max __glibcpp_u8_max -#define __glibcpp_unsigned_long_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_long_bits == 16 -#define __glibcpp_signed_long_min __glibcpp_s16_min -#define __glibcpp_signed_long_max __glibcpp_s16_max -#define __glibcpp_signed_long_digits __glibcpp_s16_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u16_min -#define __glibcpp_unsigned_long_max __glibcpp_u16_max -#define __glibcpp_unsigned_long_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_long_bits == 32 -#define __glibcpp_signed_long_min __glibcpp_s32_min -#define __glibcpp_signed_long_max __glibcpp_s32_max -#define __glibcpp_signed_long_digits __glibcpp_s32_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u32_min -#define __glibcpp_unsigned_long_max __glibcpp_u32_max -#define __glibcpp_unsigned_long_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_long_bits == 64 -#define __glibcpp_signed_long_min (long)__glibcpp_s64_min -#define __glibcpp_signed_long_max (long)__glibcpp_s64_max -#define __glibcpp_signed_long_digits __glibcpp_s64_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_long_min (unsigned long)__glibcpp_u64_min -#define __glibcpp_unsigned_long_max (unsigned long)__glibcpp_u64_max -#define __glibcpp_unsigned_long_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// long long - -#define __glibcpp_signed_long_long_traps true -#define __glibcpp_signed_long_long_traps true -#ifndef __glibcpp_signed_long_long_is_modulo -#define __glibcpp_signed_long_long_is_modulo true -#endif -#if __glibcpp_long_long_bits == 8 -#define __glibcpp_signed_long_long_min __glibcpp_s8_min -#define __glibcpp_signed_long_long_max __glibcpp_s8_max -#define __glibcpp_signed_long_long_digits __glibcpp_s8_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u8_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u8_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_long_long_bits == 16 -#define __glibcpp_signed_long_long_min __glibcpp_s16_min -#define __glibcpp_signed_long_long_max __glibcpp_s16_max -#define __glibcpp_signed_long_long_digits __glibcpp_s16_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u16_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u16_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_long_long_bits == 32 -#define __glibcpp_signed_long_long_min __glibcpp_s32_min -#define __glibcpp_signed_long_long_max __glibcpp_s32_max -#define __glibcpp_signed_long_long_digits __glibcpp_s32_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u32_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u32_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_long_long_bits == 64 -#define __glibcpp_signed_long_long_min __glibcpp_s64_min -#define __glibcpp_signed_long_long_max __glibcpp_s64_max -#define __glibcpp_signed_long_long_digits __glibcpp_s64_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s64_digits10 -#define __glibcpp_signed_long_long_traps true -#define __glibcpp_unsigned_long_long_min __glibcpp_u64_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u64_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u64_digits10 -#define __glibcpp_unsigned_long_long_traps true -#else -// You must define these macros in the configuration file. -#endif - -// wchar_t - -#define __glibcpp_wchar_t_traps true -#ifndef __glibcpp_wchar_t_is_modulo -#define __glibcpp_wchar_t_is_modulo true -#endif -#if __glibcpp_wchar_t_is_signed -#if __glibcpp_wchar_t_bits == 8 -#define __glibcpp_wchar_t_min __glibcpp_s8_min -#define __glibcpp_wchar_t_max __glibcpp_s8_max -#define __glibcpp_wchar_t_digits __glibcpp_s8_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s8_digits10 -#elif __glibcpp_wchar_t_bits == 16 -#define __glibcpp_wchar_t_min __glibcpp_s16_min -#define __glibcpp_wchar_t_max __glibcpp_s16_max -#define __glibcpp_wchar_t_digits __glibcpp_s16_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s16_digits10 -#elif __glibcpp_wchar_t_bits == 32 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s32_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s32_max -#define __glibcpp_wchar_t_digits __glibcpp_s32_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s32_digits10 -#elif __glibcpp_wchar_t_bits == 64 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s64_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s64_max -#define __glibcpp_wchar_t_digits __glibcpp_s64_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s64_digits10 -#else -// You must define these macros in the configuration file. -#endif -#else -#if __glibcpp_wchar_t_bits == 8 -#define __glibcpp_wchar_t_min __glibcpp_u8_min -#define __glibcpp_wchar_t_max __glibcpp_u8_max -#define __glibcpp_wchar_t_digits __glibcpp_u8_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_wchar_t_bits == 16 -#define __glibcpp_wchar_t_min __glibcpp_u16_min -#define __glibcpp_wchar_t_max __glibcpp_u16_max -#define __glibcpp_wchar_t_digits __glibcpp_u16_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_wchar_t_bits == 32 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u32_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u32_max -#define __glibcpp_wchar_t_digits __glibcpp_u32_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_wchar_t_bits == 64 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u64_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u64_max -#define __glibcpp_wchar_t_digits __glibcpp_u64_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif -#endif - -// float -// - -#if __glibcpp_float_bits == 32 -#define __glibcpp_float_min __glibcpp_f32_min -#define __glibcpp_float_max __glibcpp_f32_max -#define __glibcpp_float_digits __glibcpp_f32_digits -#define __glibcpp_float_digits10 __glibcpp_f32_digits10 -#define __glibcpp_float_radix __glibcpp_f32_radix -#define __glibcpp_float_epsilon __glibcpp_f32_epsilon -#define __glibcpp_float_round_error __glibcpp_f32_round_error -#define __glibcpp_float_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_float_bits == 64 -#define __glibcpp_float_min __glibcpp_f64_min -#define __glibcpp_float_max __glibcpp_f64_max -#define __glibcpp_float_digits __glibcpp_f64_digits -#define __glibcpp_float_digits10 __glibcpp_f64_digits10 -#define __glibcpp_float_radix __glibcpp_f64_radix -#define __glibcpp_float_epsilon __glibcpp_f64_epsilon -#define __glibcpp_float_round_error __glibcpp_f64_round_error -#define __glibcpp_float_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_float_bits == 80 -#define __glibcpp_float_min __glibcpp_f80_min -#define __glibcpp_float_max __glibcpp_f80_max -#define __glibcpp_float_digits __glibcpp_f80_digits -#define __glibcpp_float_digits10 __glibcpp_f80_digits10 -#define __glibcpp_float_radix __glibcpp_f80_radix -#define __glibcpp_float_epsilon __glibcpp_f80_epsilon -#define __glibcpp_float_round_error __glibcpp_f80_round_error -#define __glibcpp_float_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f80_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_float_has_infinity -#define __glibcpp_float_has_infinity false -#endif - -#ifndef __glibcpp_float_has_quiet_NaM -#define __glibcpp_float_has_quiet_NaN false -#endif - -#ifndef __glibcpp_float_has_signaling_NaN -#define __glibcpp_float_has_signaling_NaN false -#endif - -#ifndef __glibcpp_float_has_denorm -#define __glibcpp_float_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_float_has_denorm_loss -#define __glibcpp_float_has_denorm_loss false -#endif - -#ifndef __glibcpp_float_infinity -#define __glibcpp_float_infinity 0.0F -#endif - -#ifndef __glibcpp_float_quiet_NaN -#define __glibcpp_float_quiet_NaN 0.0F -#endif - -#ifndef __glibcpp_float_signaling_NaN -#define __glibcpp_float_signaling_NaN 0.0F -#endif - -#ifndef __glibcpp_float_denorm_min -#define __glibcpp_float_denorm_min 0.0F -#endif - -#ifndef __glibcpp_float_is_iec559 -#define __glibcpp_float_is_iec559 false -#endif - -#ifndef __glibcpp_float_is_bounded -#define __glibcpp_float_is_bounded true -#endif - -#ifndef __glibcpp_float_is_modulo -#define __glibcpp_float_is_modulo false -#endif - -#ifndef __glibcpp_float_traps -#define __glibcpp_float_traps false -#endif - -#ifndef __glibcpp_float_tinyness_before -#define __glibcpp_float_tinyness_before false -#endif - -#ifndef __glibcpp_float_round_style -#define __glibcpp_float_round_style round_toward_zero -#endif - -// double - -#if __glibcpp_double_bits == 32 -#define __glibcpp_double_min __glibcpp_f32_min -#define __glibcpp_double_max __glibcpp_f32_max -#define __glibcpp_double_digits __glibcpp_f32_digits -#define __glibcpp_double_digits10 __glibcpp_f32_digits10 -#define __glibcpp_double_radix __glibcpp_f32_radix -#define __glibcpp_double_epsilon __glibcpp_f32_epsilon -#define __glibcpp_double_round_error __glibcpp_f32_round_error -#define __glibcpp_double_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_double_bits == 64 -#define __glibcpp_double_min __glibcpp_f64_min -#define __glibcpp_double_max __glibcpp_f64_max -#define __glibcpp_double_digits __glibcpp_f64_digits -#define __glibcpp_double_digits10 __glibcpp_f64_digits10 -#define __glibcpp_double_radix __glibcpp_f64_radix -#define __glibcpp_double_epsilon __glibcpp_f64_epsilon -#define __glibcpp_double_round_error __glibcpp_f64_round_error -#define __glibcpp_double_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_double_bits == 80 -#define __glibcpp_double_min __glibcpp_f80_min -#define __glibcpp_double_max __glibcpp_f80_max -#define __glibcpp_double_digits __glibcpp_f80_digits -#define __glibcpp_double_digits10 __glibcpp_f80_digits10 -#define __glibcpp_double_radix __glibcpp_f80_radix -#define __glibcpp_double_epsilon __glibcpp_f80_epsilon -#define __glibcpp_double_round_error __glibcpp_f80_round_error -#define __glibcpp_double_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f80_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_double_has_infinity -#define __glibcpp_double_has_infinity false -#endif - -#ifndef __glibcpp_double_has_quiet_NaM -#define __glibcpp_double_has_quiet_NaN false -#endif - -#ifndef __glibcpp_double_has_signaling_NaN -#define __glibcpp_double_has_signaling_NaN false -#endif - -#ifndef __glibcpp_double_has_denorm -#define __glibcpp_double_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_double_has_denorm_loss -#define __glibcpp_double_has_denorm_loss false -#endif - -#ifndef __glibcpp_double_infinity -#define __glibcpp_double_infinity 0.0 -#endif - -#ifndef __glibcpp_double_quiet_NaN -#define __glibcpp_double_quiet_NaN 0.0 -#endif - -#ifndef __glibcpp_double_signaling_NaN -#define __glibcpp_double_signaling_NaN 0.0 -#endif - -#ifndef __glibcpp_double_denorm_min -#define __glibcpp_double_denorm_min 0.0 -#endif - -#ifndef __glibcpp_double_is_iec559 -#define __glibcpp_double_is_iec559 false -#endif - -#ifndef __glibcpp_double_is_bounded -#define __glibcpp_double_is_bounded true -#endif - -#ifndef __glibcpp_double_is_modulo -#define __glibcpp_double_is_modulo false -#endif - -#ifndef __glibcpp_double_traps -#define __glibcpp_double_traps false -#endif - -#ifndef __glibcpp_double_tinyness_before -#define __glibcpp_double_tinyness_before false -#endif - -#ifndef __glibcpp_double_round_style -#define __glibcpp_double_round_style round_toward_zero -#endif - -// long double - -#if __glibcpp_long_double_bits == 32 -#define __glibcpp_long_double_min __glibcpp_f32_min -#define __glibcpp_long_double_max __glibcpp_f32_max -#define __glibcpp_long_double_digits __glibcpp_f32_digits -#define __glibcpp_long_double_digits10 __glibcpp_f32_digits10 -#define __glibcpp_long_double_radix __glibcpp_f32_radix -#define __glibcpp_long_double_epsilon __glibcpp_f32_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f32_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_long_double_bits == 64 -#define __glibcpp_long_double_min __glibcpp_f64_min -#define __glibcpp_long_double_max __glibcpp_f64_max -#define __glibcpp_long_double_digits __glibcpp_f64_digits -#define __glibcpp_long_double_digits10 __glibcpp_f64_digits10 -#define __glibcpp_long_double_radix __glibcpp_f64_radix -#define __glibcpp_long_double_epsilon __glibcpp_f64_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f64_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_long_double_bits == 80 -#define __glibcpp_long_double_min __glibcpp_f80_min -#define __glibcpp_long_double_max __glibcpp_f80_max -#define __glibcpp_long_double_digits __glibcpp_f80_digits -#define __glibcpp_long_double_digits10 __glibcpp_f80_digits10 -#define __glibcpp_long_double_radix __glibcpp_f80_radix -#define __glibcpp_long_double_epsilon __glibcpp_f80_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f80_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f80_max_exponent10 -#elif __glibcpp_long_double_bits == 96 -#define __glibcpp_long_double_min __glibcpp_f96_min -#define __glibcpp_long_double_max __glibcpp_f96_max -#define __glibcpp_long_double_digits __glibcpp_f96_digits -#define __glibcpp_long_double_digits10 __glibcpp_f96_digits10 -#define __glibcpp_long_double_radix __glibcpp_f96_radix -#define __glibcpp_long_double_epsilon __glibcpp_f96_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f96_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f96_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f96_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f96_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f96_max_exponent10 -#elif __glibcpp_long_double_bits == 128 -#define __glibcpp_long_double_min __glibcpp_f128_min -#define __glibcpp_long_double_max __glibcpp_f128_max -#define __glibcpp_long_double_digits __glibcpp_f128_digits -#define __glibcpp_long_double_digits10 __glibcpp_f128_digits10 -#define __glibcpp_long_double_radix __glibcpp_f128_radix -#define __glibcpp_long_double_epsilon __glibcpp_f128_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f128_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f128_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f128_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f128_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f128_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_long_double_has_infinity -#define __glibcpp_long_double_has_infinity false -#endif - -#ifndef __glibcpp_long_double_has_quiet_NaN -#define __glibcpp_long_double_has_quiet_NaN false -#endif - -#ifndef __glibcpp_long_double_has_signaling_NaN -#define __glibcpp_long_double_has_signaling_NaN false -#endif - -#ifndef __glibcpp_long_double_has_denorm -#define __glibcpp_long_double_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_long_double_has_denorm_loss -#define __glibcpp_long_double_has_denorm_loss false -#endif - -#ifndef __glibcpp_long_double_infinity -#define __glibcpp_long_double_infinity 0.0L -#endif - -#ifndef __glibcpp_long_double_quiet_NaN -#define __glibcpp_long_double_quiet_NaN 0.0L -#endif - -#ifndef __glibcpp_long_double_signaling_NaN -#define __glibcpp_long_double_signaling_NaN 0.0L -#endif - -#ifndef __glibcpp_long_double_denorm_min -#define __glibcpp_long_double_denorm_min 0.0L -#endif - -#ifndef __glibcpp_long_double_is_iec559 -#define __glibcpp_long_double_is_iec559 false -#endif - -#ifndef __glibcpp_long_double_is_bounded -#define __glibcpp_long_double_is_bounded true -#endif - -#ifndef __glibcpp_long_double_is_modulo -#define __glibcpp_long_double_is_modulo false -#endif - -#ifndef __glibcpp_long_double_traps -#define __glibcpp_long_double_traps false -#endif - -#ifndef __glibcpp_long_double_tinyness_before -#define __glibcpp_long_double_tinyness_before false -#endif - -#ifndef __glibcpp_long_double_round_style -#define __glibcpp_long_double_round_style round_toward_zero -#endif - - -namespace std -{ - enum float_round_style - { - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, - round_toward_neg_infinity = 3 - }; - - enum float_denorm_style - { - denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 - }; - - // - // The primary class traits - // - template<typename _Tp> - struct numeric_limits - { - static const bool is_specialized = false; - - static _Tp min() throw() { return static_cast<_Tp>(0); } - static _Tp max() throw() { return static_cast<_Tp>(0); } - - static const int digits = 0; - static const int digits10 = 0; - static const bool is_signed = false; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = 0; - - static _Tp epsilon() throw() { return static_cast<_Tp>(0); } - static _Tp round_error() throw() { return static_cast<_Tp>(0); } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static _Tp infinity() throw() { return static_cast<_Tp>(0); } - static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); } - static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); } - static _Tp denorm_min() throw() { return static_cast<_Tp>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = false; - static const bool is_modulo = false; - - static const bool traps = false; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_specialized; - - template<typename _Tp> - const int - numeric_limits<_Tp>::digits; - - template<typename _Tp> - const int - numeric_limits<_Tp>::digits10; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_signed; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_integer; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_exact; - - template<typename _Tp> - const int - numeric_limits<_Tp>::radix; - - template<typename _Tp> - const int - numeric_limits<_Tp>::min_exponent; - - template<typename _Tp> - const int - numeric_limits<_Tp>::min_exponent10; - - template<typename _Tp> - const int - numeric_limits<_Tp>::max_exponent; - - template<typename _Tp> - const int - numeric_limits<_Tp>::max_exponent10; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::has_infinity; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::has_quiet_NaN; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::has_signaling_NaN; - - template<typename _Tp> - const float_denorm_style - numeric_limits<_Tp>::has_denorm; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::has_denorm_loss; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_iec559; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_bounded; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::is_modulo; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::traps; - - template<typename _Tp> - const bool - numeric_limits<_Tp>::tinyness_before; - - template<typename _Tp> - const float_round_style - numeric_limits<_Tp>::round_style; - - // Now there follow 15 explicit specializations. Yes, 15. Make sure - // you get the count right. - - template<> - struct numeric_limits<bool> - { - static const bool is_specialized = true; - - static bool min() throw() - { return false; } - - static bool max() throw() - { return true; } - - static const int digits = __glibcpp_bool_digits; - static const int digits10 = 0; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static bool epsilon() throw() - { return false; } - static bool round_error() throw() - { return false; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static bool infinity() throw() - { return false; } - static bool quiet_NaN() throw() - { return false; } - static bool signaling_NaN() throw() - { return false; } - static bool denorm_min() throw() - { return false; } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - // It is not clear what it means for a boolean type to trap. - // This is a DR on the LWG issue list. Here, I use integer - // promotion semantics. - static const bool traps = __glibcpp_signed_int_traps - || __glibcpp_signed_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_bool_digits - - template<> - struct numeric_limits<char> - { - static const bool is_specialized = true; - - static char min() throw() - { return __glibcpp_char_min; } - static char max() throw() - { return __glibcpp_char_max; } - - static const int digits = __glibcpp_char_digits; - static const int digits10 = __glibcpp_char_digits10; - static const bool is_signed = __glibcpp_plain_char_is_signed; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static char epsilon() throw() - { return char(); } - static char round_error() throw() - { return char(); } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static char infinity() throw() - { return char(); } - static char quiet_NaN() throw() - { return char(); } - static char signaling_NaN() throw() - { return char(); } - static char denorm_min() throw() - { return static_cast<char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_char_is_modulo; - - static const bool traps = __glibcpp_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_char_min -#undef __glibcpp_char_max -#undef __glibcpp_char_digits -#undef __glibcpp_char_digits10 -#undef __glibcpp_char_is_signed -#undef __glibcpp_char_is_modulo -#undef __glibcpp_char_traps - - - - template<> - struct numeric_limits<signed char> - { - static const bool is_specialized = true; - - static signed char min() throw() - { return __glibcpp_signed_char_min; } - static signed char max() throw() - { return __glibcpp_signed_char_max; } - - static const int digits = __glibcpp_signed_char_digits; - static const int digits10 = __glibcpp_signed_char_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static signed char epsilon() throw() - { return 0; } - static signed char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static signed char infinity() throw() - { return static_cast<signed char>(0); } - static signed char quiet_NaN() throw() - { return static_cast<signed char>(0); } - static signed char signaling_NaN() throw() - { return static_cast<signed char>(0); } - static signed char denorm_min() throw() - { return static_cast<signed char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_char_is_modulo; - - static const bool traps = __glibcpp_signed_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_char_min -#undef __glibcpp_signed_char_max -#undef __glibcpp_signed_char_digits -#undef __glibcpp_signed_char_digits10 -#undef __glibcpp_signed_char_is_modulo -#undef __glibcpp_signed_char_traps - - template<> - struct numeric_limits<unsigned char> - { - static const bool is_specialized = true; - - static unsigned char min() throw() - { return 0; } - static unsigned char max() throw() - { return __glibcpp_unsigned_char_max; } - - static const int digits = __glibcpp_unsigned_char_digits; - static const int digits10 = __glibcpp_unsigned_char_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned char epsilon() throw() - { return 0; } - static unsigned char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned char infinity() throw() - { return static_cast<unsigned char>(0); } - static unsigned char quiet_NaN() throw() - { return static_cast<unsigned char>(0); } - static unsigned char signaling_NaN() throw() - { return static_cast<unsigned char>(0); } - static unsigned char denorm_min() throw() - { return static_cast<unsigned char>(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_char_max -#undef __glibcpp_unsigned_char_digits -#undef __glibcpp_unsigned_char_digits10 -#undef __glibcpp_unsigned_char_traps - - template<> - struct numeric_limits<wchar_t> - { - static const bool is_specialized = true; - - static wchar_t min() throw() - { return __glibcpp_wchar_t_min; } - static wchar_t max() throw() - { return __glibcpp_wchar_t_max; } - - static const int digits = __glibcpp_wchar_t_digits; - static const int digits10 = __glibcpp_wchar_t_digits10; - static const bool is_signed = __glibcpp_wchar_t_is_signed; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static wchar_t epsilon() throw() - { return 0; } - static wchar_t round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static wchar_t infinity() throw() - { return wchar_t(); } - static wchar_t quiet_NaN() throw() - { return wchar_t(); } - static wchar_t signaling_NaN() throw() - { return wchar_t(); } - static wchar_t denorm_min() throw() - { return wchar_t(); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_wchar_t_is_modulo; - - static const bool traps = __glibcpp_wchar_t_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_wchar_t_min -#undef __glibcpp_wchar_t_max -#undef __glibcpp_wchar_t_digits -#undef __glibcpp_wchar_t_digits10 -#undef __glibcpp_wchar_t_is_signed -#undef __glibcpp_wchar_t_is_modulo -#undef __glibcpp_wchar_t_traps - - template<> - struct numeric_limits<short> - { - static const bool is_specialized = true; - - static short min() throw() - { return __glibcpp_signed_short_min; } - static short max() throw() - { return __glibcpp_signed_short_max; } - - static const int digits = __glibcpp_signed_short_digits; - static const int digits10 = __glibcpp_signed_short_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static short epsilon() throw() - { return 0; } - static short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static short infinity() throw() - { return short(); } - static short quiet_NaN() throw() - { return short(); } - static short signaling_NaN() throw() - { return short(); } - static short denorm_min() throw() - { return short(); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_short_is_modulo; - - static const bool traps = __glibcpp_signed_short_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_short_min -#undef __glibcpp_signed_short_max -#undef __glibcpp_signed_short_digits -#undef __glibcpp_signed_short_digits10 -#undef __glibcpp_signed_short_is_modulo -#undef __glibcpp_signed_short_traps - - template<> - struct numeric_limits<unsigned short> - { - static const bool is_specialized = true; - - static unsigned short min() throw() - { return 0; } - static unsigned short max() throw() - { return __glibcpp_unsigned_short_max; } - - static const int digits = __glibcpp_unsigned_short_digits; - static const int digits10 = __glibcpp_unsigned_short_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned short epsilon() throw() - { return 0; } - static unsigned short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned short infinity() throw() - { return static_cast<unsigned short>(0); } - static unsigned short quiet_NaN() throw() - { return static_cast<unsigned short>(0); } - static unsigned short signaling_NaN() throw() - { return static_cast<unsigned short>(0); } - static unsigned short denorm_min() throw() - { return static_cast<unsigned short>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_short_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_short_max -#undef __glibcpp_unsigned_short_digits -#undef __glibcpp_unsigned_short_digits10 -#undef __glibcpp_unsigned_short_traps - - template<> - struct numeric_limits<int> - { - static const bool is_specialized = true; - - static int min() throw() - { return __glibcpp_signed_int_min; } - static int max() throw() - { return __glibcpp_signed_int_max; } - - static const int digits = __glibcpp_signed_int_digits; - static const int digits10 = __glibcpp_signed_int_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static int epsilon() throw() - { return 0; } - static int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static int infinity() throw() - { return static_cast<int>(0); } - static int quiet_NaN() throw() - { return static_cast<int>(0); } - static int signaling_NaN() throw() - { return static_cast<int>(0); } - static int denorm_min() throw() - { return static_cast<int>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_int_is_modulo; - - static const bool traps = __glibcpp_signed_int_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_int_min -#undef __glibcpp_signed_int_max -#undef __glibcpp_signed_int_digits -#undef __glibcpp_signed_int_digits10 -#undef __glibcpp_signed_int_is_modulo -#undef __glibcpp_signed_int_traps - - template<> - struct numeric_limits<unsigned int> - { - static const bool is_specialized = true; - - static unsigned int min() throw() - { return 0; } - static unsigned int max() throw() - { return __glibcpp_unsigned_int_max; } - - static const int digits = __glibcpp_unsigned_int_digits; - static const int digits10 = __glibcpp_unsigned_int_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned int epsilon() throw() - { return 0; } - static unsigned int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned int infinity() throw() - { return static_cast<unsigned int>(0); } - static unsigned int quiet_NaN() throw() - { return static_cast<unsigned int>(0); } - static unsigned int signaling_NaN() throw() - { return static_cast<unsigned int>(0); } - static unsigned int denorm_min() throw() - { return static_cast<unsigned int>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_int_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_int_max -#undef __glibcpp_unsigned_int_digits -#undef __glibcpp_unsigned_int_digits10 -#undef __glibcpp_unsigned_int_traps - - template<> - struct numeric_limits<long> - { - static const bool is_specialized = true; - - static long min() throw() - { return __glibcpp_signed_long_min; } - static long max() throw() - { return __glibcpp_signed_long_max; } - - static const int digits = __glibcpp_signed_long_digits; - static const int digits10 = __glibcpp_signed_long_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long epsilon() throw() - { return 0; } - static long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long infinity() throw() - { return static_cast<long>(0); } - static long quiet_NaN() throw() - { return static_cast<long>(0); } - static long signaling_NaN() throw() - { return static_cast<long>(0); } - static long denorm_min() throw() - { return static_cast<long>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_long_is_modulo; - - static const bool traps = __glibcpp_signed_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_long_min -#undef __glibcpp_signed_long_max -#undef __glibcpp_signed_long_digits -#undef __glibcpp_signed_long_digits10 -#undef __glibcpp_signed_long_is_modulo -#undef __glibcpp_signed_long_traps - - template<> - struct numeric_limits<unsigned long> - { - static const bool is_specialized = true; - - static unsigned long min() throw() - { return 0; } - static unsigned long max() throw() - { return __glibcpp_unsigned_long_max; } - - static const int digits = __glibcpp_unsigned_long_digits; - static const int digits10 = __glibcpp_unsigned_long_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long epsilon() throw() - { return 0; } - static unsigned long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long infinity() throw() - { return static_cast<unsigned long>(0); } - static unsigned long quiet_NaN() throw() - { return static_cast<unsigned long>(0); } - static unsigned long signaling_NaN() throw() - { return static_cast<unsigned long>(0); } - static unsigned long denorm_min() throw() - { return static_cast<unsigned long>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_long_max -#undef __glibcpp_unsigned_long_digits -#undef __glibcpp_unsigned_long_digits10 -#undef __glibcpp_unsigned_long_traps - - template<> - struct numeric_limits<long long> - { - static const bool is_specialized = true; - - static long long min() throw() - { return __glibcpp_signed_long_long_min; } - static long long max() throw() - { return __glibcpp_signed_long_long_max; } - - static const int digits = __glibcpp_signed_long_long_digits; - static const int digits10 = __glibcpp_signed_long_long_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long long epsilon() throw() - { return 0; } - static long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long long infinity() throw() - { return static_cast<long long>(0); } - static long long quiet_NaN() throw() - { return static_cast<long long>(0); } - static long long signaling_NaN() throw() - { return static_cast<long long>(0); } - static long long denorm_min() throw() - { return static_cast<long long>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_long_long_is_modulo; - - static const bool traps = __glibcpp_signed_long_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_long_long_min -#undef __glibcpp_signed_long_long_max -#undef __glibcpp_signed_long_long_digits -#undef __glibcpp_signed_long_long_digits10 -#undef __glibcpp_signed_long_long_is_modulo -#undef __glibcpp_signed_long_long_traps - - template<> - struct numeric_limits<unsigned long long> - { - static const bool is_specialized = true; - - static unsigned long long min() throw() - { return 0; } - static unsigned long long max() throw() - { return __glibcpp_unsigned_long_long_max; } - - static const int digits = __glibcpp_unsigned_long_long_digits; - static const int digits10 = __glibcpp_unsigned_long_long_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long long epsilon() throw() - { return 0; } - static unsigned long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long long infinity() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long quiet_NaN() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long signaling_NaN() throw() - { return static_cast<unsigned long long>(0); } - static unsigned long long denorm_min() throw() - { return static_cast<unsigned long long>(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = true; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_long_long_max -#undef __glibcpp_unsigned_long_long_digits -#undef __glibcpp_unsigned_long_long_digits10 -#undef __glibcpp_unsigned_long_long_traps - - template<> - struct numeric_limits<float> - { - static const bool is_specialized = true; - - static float min() throw() - { return __glibcpp_float_min; } - static float max() throw() - { return __glibcpp_float_max; } - - static const int digits = __glibcpp_float_digits; - static const int digits10 = __glibcpp_float_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_float_radix; - static float epsilon() throw() - { return __glibcpp_float_epsilon; } - static float round_error() throw() - { return __glibcpp_float_round_error; } - - static const int min_exponent = __glibcpp_float_min_exponent; - static const int min_exponent10 = __glibcpp_float_min_exponent10; - static const int max_exponent = __glibcpp_float_max_exponent; - static const int max_exponent10 = __glibcpp_float_max_exponent10; - - static const bool has_infinity = __glibcpp_float_has_infinity; - static const bool has_quiet_NaN = __glibcpp_float_has_quiet_NaN; - static const bool has_signaling_NaN = __glibcpp_float_has_signaling_NaN; - static const float_denorm_style has_denorm = __glibcpp_float_has_denorm; - static const bool has_denorm_loss = __glibcpp_float_has_denorm_loss; - - static float infinity() throw() - { return __glibcpp_float_infinity; } - static float quiet_NaN() throw() - { return __glibcpp_float_quiet_NaN; } - static float signaling_NaN() throw() - { return __glibcpp_float_signaling_NaN; } - static float denorm_min() throw() - { return __glibcpp_float_denorm_min; } - - static const bool is_iec559 = __glibcpp_float_is_iec559; - static const bool is_bounded = __glibcpp_float_is_bounded; - static const bool is_modulo = __glibcpp_float_is_modulo; - - static const bool traps = __glibcpp_float_traps; - static const bool tinyness_before = __glibcpp_float_tinyness_before; - static const float_round_style round_style = __glibcpp_float_round_style; - }; - -#undef __glibcpp_float_min -#undef __glibcpp_float_max -#undef __glibcpp_float_digits -#undef __glibcpp_float_digits10 -#undef __glibcpp_float_radix -#undef __glibcpp_float_round_error -#undef __glibcpp_float_min_exponent -#undef __glibcpp_float_min_exponent10 -#undef __glibcpp_float_max_exponent -#undef __glibcpp_float_max_exponent10 -#undef __glibcpp_float_has_infinity -#undef __glibcpp_float_has_quiet_NaN -#undef __glibcpp_float_has_signaling_NaN -#undef __glibcpp_float_has_denorm -#undef __glibcpp_float_has_denorm_loss -#undef __glibcpp_float_infinity -#undef __glibcpp_float_quiet_NaN -#undef __glibcpp_float_signaling_NaN -#undef __glibcpp_float_denorm_min -#undef __glibcpp_float_is_iec559 -#undef __glibcpp_float_is_bounded -#undef __glibcpp_float_is_modulo -#undef __glibcpp_float_traps -#undef __glibcpp_float_tinyness_before -#undef __glibcpp_float_round_style - - template<> - struct numeric_limits<double> - { - static const bool is_specialized = true; - - static double min() throw() - { return __glibcpp_double_min; } - static double max() throw() - { return __glibcpp_double_max; } - - static const int digits = __glibcpp_double_digits; - static const int digits10 = __glibcpp_double_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_double_radix; - static double epsilon() throw() - { return __glibcpp_double_epsilon; } - static double round_error() throw() - { return __glibcpp_double_round_error; } - - static const int min_exponent = __glibcpp_double_min_exponent; - static const int min_exponent10 = __glibcpp_double_min_exponent10; - static const int max_exponent = __glibcpp_double_max_exponent; - static const int max_exponent10 = __glibcpp_double_max_exponent10; - - static const bool has_infinity = __glibcpp_double_has_infinity; - static const bool has_quiet_NaN = __glibcpp_double_has_quiet_NaN; - static const bool has_signaling_NaN = __glibcpp_double_has_signaling_NaN; - static const float_denorm_style has_denorm = - __glibcpp_double_has_denorm; - static const bool has_denorm_loss = __glibcpp_double_has_denorm_loss; - - static double infinity() throw() - { return __glibcpp_double_infinity; } - static double quiet_NaN() throw() - { return __glibcpp_double_quiet_NaN; } - static double signaling_NaN() throw() - { return __glibcpp_double_signaling_NaN; } - static double denorm_min() throw() - { return __glibcpp_double_denorm_min; } - - static const bool is_iec559 = __glibcpp_double_is_iec559; - static const bool is_bounded = __glibcpp_double_is_bounded; - static const bool is_modulo = __glibcpp_double_is_modulo; - - static const bool traps = __glibcpp_double_traps; - static const bool tinyness_before = __glibcpp_double_tinyness_before; - static const float_round_style round_style = - __glibcpp_double_round_style; - }; - -#undef __glibcpp_double_min -#undef __glibcpp_double_max -#undef __glibcpp_double_digits -#undef __glibcpp_double_digits10 -#undef __glibcpp_double_radix -#undef __glibcpp_double_round_error -#undef __glibcpp_double_min_exponent -#undef __glibcpp_double_min_exponent10 -#undef __glibcpp_double_max_exponent -#undef __glibcpp_double_max_exponent10 -#undef __glibcpp_double_has_infinity -#undef __glibcpp_double_has_quiet_NaN -#undef __glibcpp_double_has_signaling_NaN -#undef __glibcpp_double_has_denorm -#undef __glibcpp_double_has_denorm_loss -#undef __glibcpp_double_infinity -#undef __glibcpp_double_quiet_NaN -#undef __glibcpp_double_signaling_NaN -#undef __glibcpp_double_denorm_min -#undef __glibcpp_double_is_iec559 -#undef __glibcpp_double_is_bounded -#undef __glibcpp_double_is_modulo -#undef __glibcpp_double_traps -#undef __glibcpp_double_tinyness_before -#undef __glibcpp_double_round_style - - - template<> - struct numeric_limits<long double> - { - static const bool is_specialized = true; - - static long double min() throw() - { return __glibcpp_long_double_min; } - static long double max() throw() - { return __glibcpp_long_double_max; } - - static const int digits = __glibcpp_long_double_digits; - static const int digits10 = __glibcpp_long_double_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_long_double_radix; - static long double epsilon() throw() - { return __glibcpp_long_double_epsilon; } - static long double round_error() throw() - { return __glibcpp_long_double_round_error; } - - static const int min_exponent = __glibcpp_long_double_min_exponent; - static const int min_exponent10 = __glibcpp_long_double_min_exponent10; - static const int max_exponent = __glibcpp_long_double_max_exponent; - static const int max_exponent10 = __glibcpp_long_double_max_exponent10; - - static const bool has_infinity = __glibcpp_long_double_has_infinity; - static const bool has_quiet_NaN = __glibcpp_long_double_has_quiet_NaN; - static const bool has_signaling_NaN = - __glibcpp_long_double_has_signaling_NaN; - static const float_denorm_style has_denorm = - __glibcpp_long_double_has_denorm; - static const bool has_denorm_loss = - __glibcpp_long_double_has_denorm_loss; - - static long double infinity() throw() - { return __glibcpp_long_double_infinity; } - static long double quiet_NaN() throw() - { return __glibcpp_long_double_quiet_NaN; } - static long double signaling_NaN() throw() - { return __glibcpp_long_double_signaling_NaN; } - static long double denorm_min() throw() - { return __glibcpp_long_double_denorm_min; } - - static const bool is_iec559 = __glibcpp_long_double_is_iec559; - static const bool is_bounded = __glibcpp_long_double_is_bounded; - static const bool is_modulo = __glibcpp_long_double_is_modulo; - - static const bool traps = __glibcpp_long_double_traps; - static const bool tinyness_before = __glibcpp_long_double_tinyness_before; - static const float_round_style round_style = - __glibcpp_long_double_round_style; - }; - -#undef __glibcpp_long_double_min -#undef __glibcpp_long_double_max -#undef __glibcpp_long_double_digits -#undef __glibcpp_long_double_digits10 -#undef __glibcpp_long_double_radix -#undef __glibcpp_long_double_round_error -#undef __glibcpp_long_double_min_exponent -#undef __glibcpp_long_double_min_exponent10 -#undef __glibcpp_long_double_max_exponent -#undef __glibcpp_long_double_max_exponent10 -#undef __glibcpp_long_double_has_infinity -#undef __glibcpp_long_double_has_quiet_NaN -#undef __glibcpp_long_double_has_signaling_NaN -#undef __glibcpp_long_double_has_denorm -#undef __glibcpp_long_double_has_denorm_loss -#undef __glibcpp_long_double_infinity -#undef __glibcpp_long_double_quiet_NaN -#undef __glibcpp_long_double_signaling_NaN -#undef __glibcpp_long_double_denorm_min -#undef __glibcpp_long_double_is_iec559 -#undef __glibcpp_long_double_is_bounded -#undef __glibcpp_long_double_is_modulo -#undef __glibcpp_long_double_traps -#undef __glibcpp_long_double_tinyness_before -#undef __glibcpp_long_double_round_style - -} // namespace std - -#endif // _CPP_NUMERIC_LIMITS diff --git a/libstdc++-v3/include/bits/std_list.h b/libstdc++-v3/include/bits/std_list.h deleted file mode 100644 index 683e0a7..0000000 --- a/libstdc++-v3/include/bits/std_list.h +++ /dev/null @@ -1,77 +0,0 @@ -// <list> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_list.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_LIST -#define _CPP_LIST 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_list.h> - -#endif /* _CPP_LIST */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_locale.h b/libstdc++-v3/include/bits/std_locale.h deleted file mode 100644 index 82089d0..0000000 --- a/libstdc++-v3/include/bits/std_locale.h +++ /dev/null @@ -1,52 +0,0 @@ -// Locale support -*- C++ -*- - -// Copyright (C) 1997-1999 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 22.1 Locales -// - -/** @file std_locale.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_LOCALE -#define _CPP_LOCALE 1 - -#pragma GCC system_header - -#include <bits/localefwd.h> -#include <bits/locale_facets.h> -#include <bits/locale_facets.tcc> - -#endif - -// Local Variables: -// mode:c++ -// End: diff --git a/libstdc++-v3/include/bits/std_map.h b/libstdc++-v3/include/bits/std_map.h deleted file mode 100644 index 0dd38bf..0000000 --- a/libstdc++-v3/include/bits/std_map.h +++ /dev/null @@ -1,74 +0,0 @@ -// <map> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_map.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_MAP -#define _CPP_MAP 1 - -#pragma GCC system_header - -#include <bits/stl_tree.h> -#include <bits/stl_map.h> -#include <bits/stl_multimap.h> - -#endif /* _CPP_MAP */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_memory.h b/libstdc++-v3/include/bits/std_memory.h deleted file mode 100644 index c9a2e59..0000000 --- a/libstdc++-v3/include/bits/std_memory.h +++ /dev/null @@ -1,149 +0,0 @@ -// <memory> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * Copyright (c) 1997-1999 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -/** @file std_memory.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_MEMORY -#define _CPP_MEMORY 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_iterator_base_types.h> //for iterator_traits -#include <bits/stl_tempbuf.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_raw_storage_iter.h> - -namespace std -{ - - template<class _Tp1> struct auto_ptr_ref { - _Tp1* _M_ptr; - auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {} -}; - -/** - * A simple smart pointer providing strict ownership semantics. (More later.) -*/ -template <class _Tp> class auto_ptr { -private: - _Tp* _M_ptr; - -public: - typedef _Tp element_type; - - explicit auto_ptr(_Tp* __p = 0) throw() : _M_ptr(__p) {} - auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) {} - - template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) throw() - : _M_ptr(__a.release()) {} - - auto_ptr& operator=(auto_ptr& __a) throw() { - reset(__a.release()); - return *this; - } - - template <class _Tp1> - auto_ptr& operator=(auto_ptr<_Tp1>& __a) throw() { - reset(__a.release()); - return *this; - } - - // Note: The C++ standard says there is supposed to be an empty throw - // specification here, but omitting it is standard conforming. Its - // presence can be detected only if _Tp::~_Tp() throws, but (17.4.3.6/2) - // this is prohibited. - ~auto_ptr() { delete _M_ptr; } - - _Tp& operator*() const throw() { - return *_M_ptr; - } - _Tp* operator->() const throw() { - return _M_ptr; - } - _Tp* get() const throw() { - return _M_ptr; - } - _Tp* release() throw() { - _Tp* __tmp = _M_ptr; - _M_ptr = 0; - return __tmp; - } - void reset(_Tp* __p = 0) throw() { - if (__p != _M_ptr) { - delete _M_ptr; - _M_ptr = __p; - } - } - -public: - auto_ptr(auto_ptr_ref<_Tp> __ref) throw() - : _M_ptr(__ref._M_ptr) {} - - auto_ptr& operator=(auto_ptr_ref<_Tp> __ref) throw() { - if (__ref._M_ptr != this->get()) { - delete _M_ptr; - _M_ptr = __ref._M_ptr; - } - return *this; - } - - template <class _Tp1> operator auto_ptr_ref<_Tp1>() throw() - { return auto_ptr_ref<_Tp>(this->release()); } - template <class _Tp1> operator auto_ptr<_Tp1>() throw() - { return auto_ptr<_Tp1>(this->release()); } -}; - -} // namespace std - -#endif /* _CPP_MEMORY */ - - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_numeric.h b/libstdc++-v3/include/bits/std_numeric.h deleted file mode 100644 index 097c9c3..0000000 --- a/libstdc++-v3/include/bits/std_numeric.h +++ /dev/null @@ -1,75 +0,0 @@ -// <numeric> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_numeric.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_NUMERIC -#define _CPP_NUMERIC 1 - -#pragma GCC system_header -#include <bits/c++config.h> -#include <bits/std_cstddef.h> -#include <bits/std_iterator.h> -#include <bits/stl_function.h> -#include <bits/stl_numeric.h> - -#endif /* _CPP_NUMERIC */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_ostream.h b/libstdc++-v3/include/bits/std_ostream.h deleted file mode 100644 index c1c79db..0000000 --- a/libstdc++-v3/include/bits/std_ostream.h +++ /dev/null @@ -1,288 +0,0 @@ -// Output streams -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.6.2 Output streams -// - -/** @file std_ostream.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_OSTREAM -#define _CPP_OSTREAM 1 - -#pragma GCC system_header - -#include <bits/std_ios.h> - -namespace std -{ - // 27.6.2.1 Template class basic_ostream - template<typename _CharT, typename _Traits> - class basic_ostream : virtual public basic_ios<_CharT, _Traits> - { - public: - - // Types (inherited from basic_ios (27.4.4)): - typedef _CharT char_type; - typedef typename _Traits::int_type int_type; - typedef typename _Traits::pos_type pos_type; - typedef typename _Traits::off_type off_type; - typedef _Traits traits_type; - - // Non-standard Types: - typedef basic_streambuf<_CharT, _Traits> __streambuf_type; - typedef basic_ios<_CharT, _Traits> __ios_type; - typedef basic_ostream<_CharT, _Traits> __ostream_type; - typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter; - typedef num_put<_CharT, __ostreambuf_iter> __numput_type; - typedef ctype<_CharT> __ctype_type; - - // 27.6.2.2 Constructor/destructor: - explicit - basic_ostream(__streambuf_type* __sb) - { this->init(__sb); } - - virtual - ~basic_ostream() { } - - // 27.6.2.3 Prefix/suffix: - class sentry; - friend class sentry; - - // 27.6.2.5 Formatted output: - // 27.6.2.5.3 basic_ostream::operator<< - __ostream_type& - operator<<(__ostream_type& (*__pf)(__ostream_type&)); - - __ostream_type& - operator<<(__ios_type& (*__pf)(__ios_type&)); - - __ostream_type& - operator<<(ios_base& (*__pf) (ios_base&)); - - // 27.6.2.5.2 Arithmetic Inserters - __ostream_type& - operator<<(long __n); - - __ostream_type& - operator<<(unsigned long __n); - - __ostream_type& - operator<<(bool __n); - - __ostream_type& - operator<<(short __n) - { - ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) - return this->operator<<(static_cast<unsigned long> - (static_cast<unsigned short>(__n))); - else - return this->operator<<(static_cast<long>(__n)); - } - - __ostream_type& - operator<<(unsigned short __n) - { return this->operator<<(static_cast<unsigned long>(__n)); } - - __ostream_type& - operator<<(int __n) - { - ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) - return this->operator<<(static_cast<unsigned long> - (static_cast<unsigned int>(__n))); - else - return this->operator<<(static_cast<long>(__n)); - } - - __ostream_type& - operator<<(unsigned int __n) - { return this->operator<<(static_cast<unsigned long>(__n)); } - -#ifdef _GLIBCPP_USE_LONG_LONG - __ostream_type& - operator<<(long long __n); - - __ostream_type& - operator<<(unsigned long long __n); -#endif - - __ostream_type& - operator<<(double __f); - - __ostream_type& - operator<<(float __f) - { return this->operator<<(static_cast<double>(__f)); } - - __ostream_type& - operator<<(long double __f); - - __ostream_type& - operator<<(const void* __p); - - __ostream_type& - operator<<(__streambuf_type* __sb); - - // Unformatted output: - __ostream_type& - put(char_type __c); - - __ostream_type& - write(const char_type* __s, streamsize __n); - - __ostream_type& - flush(); - - // Seeks: - pos_type - tellp(); - - __ostream_type& - seekp(pos_type); - - __ostream_type& - seekp(off_type, ios_base::seekdir); - - private: -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not defined. (Side effect of DR 50.) - __ostream_type& - operator=(const __ostream_type&); - - basic_ostream(const __ostream_type&); -#endif - }; - - // 27.6.2.3 Class basic_ostream::sentry - template <typename _CharT, typename _Traits> - class basic_ostream<_CharT, _Traits>::sentry - { - // Data Members: - bool _M_ok; - basic_ostream<_CharT,_Traits>& _M_os; - - public: - explicit - sentry(basic_ostream<_CharT,_Traits>& __os); - - ~sentry() - { - // XXX MT - if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception()) - { - // Can't call flush directly or else will get into recursive lock. - if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1) - _M_os.setstate(ios_base::badbit); - } - } - - operator bool() - { return _M_ok; } - }; - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c); - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) - { return (__out << __out.widen(__c)); } - - // Specialization - template <class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, char __c); - - // Signed and unsigned - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, signed char __c) - { return (__out << static_cast<char>(__c)); } - - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) - { return (__out << static_cast<char>(__c)); } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s); - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits> & - operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); - - // Partial specializationss - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, const char* __s); - - // Signed and unsigned - template<class _Traits> - basic_ostream<char, _Traits>& - operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) - { return (__out << reinterpret_cast<const char*>(__s)); } - - template<class _Traits> - basic_ostream<char, _Traits> & - operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) - { return (__out << reinterpret_cast<const char*>(__s)); } - - // 27.6.2.7 Standard basic_ostream manipulators - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - endl(basic_ostream<_CharT, _Traits>& __os) - { return flush(__os.put(__os.widen('\n'))); } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - ends(basic_ostream<_CharT, _Traits>& __os) - { return __os.put(_CharT()); } - - template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& - flush(basic_ostream<_CharT, _Traits>& __os) - { return __os.flush(); } - -} // namespace std - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# define export -#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS -# include <bits/ostream.tcc> -#endif -#endif - -#endif /* _CPP_OSTREAM */ - diff --git a/libstdc++-v3/include/bits/std_queue.h b/libstdc++-v3/include/bits/std_queue.h deleted file mode 100644 index ecf7f4c..0000000 --- a/libstdc++-v3/include/bits/std_queue.h +++ /dev/null @@ -1,81 +0,0 @@ -// <queue> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_queue.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_QUEUE -#define _CPP_QUEUE 1 - -#pragma GCC system_header -#include <bits/c++config.h> -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_vector.h> -#include <bits/stl_heap.h> -#include <bits/stl_deque.h> -#include <bits/stl_function.h> -#include <bits/stl_queue.h> - -#endif /* _CPP_QUEUE */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_set.h b/libstdc++-v3/include/bits/std_set.h deleted file mode 100644 index dab8e71..0000000 --- a/libstdc++-v3/include/bits/std_set.h +++ /dev/null @@ -1,74 +0,0 @@ -// <set> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_set.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_SET -#define _CPP_SET 1 - -#pragma GCC system_header - -#include <bits/stl_tree.h> -#include <bits/stl_set.h> -#include <bits/stl_multiset.h> - -#endif /* _CPP_SET */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_sstream.h b/libstdc++-v3/include/bits/std_sstream.h deleted file mode 100644 index d36070a..0000000 --- a/libstdc++-v3/include/bits/std_sstream.h +++ /dev/null @@ -1,372 +0,0 @@ -// String based streams -*- C++ -*- - -// Copyright (C) 1997-1999 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.7 String-based streams -// - -/** @file std_sstream.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_SSTREAM -#define _CPP_SSTREAM 1 - -#pragma GCC system_header - -#include <bits/std_istream.h> -#include <bits/std_ostream.h> - -namespace std -{ - template<typename _CharT, typename _Traits, typename _Alloc> - class basic_stringbuf : public basic_streambuf<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS -// 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; -#endif - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard Types: - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - typedef basic_string<char_type, _Traits, _Alloc> __string_type; - typedef typename __string_type::size_type __size_type; - - private: - // Data Members: - __string_type _M_string; - - public: - // Constructors: - explicit - basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out) - : __streambuf_type(), _M_string() - { _M_stringbuf_init(__mode); } - - explicit - basic_stringbuf(const __string_type& __str, - ios_base::openmode __mode = ios_base::in | ios_base::out) - : __streambuf_type(), _M_string(__str.data(), __str.size()) - { _M_stringbuf_init(__mode); } - - // Get and set: - __string_type - str() const - { - if (_M_mode & ios_base::out) - { - // This is the deal: _M_string.size() is a value that - // represents the size of the initial string that makes - // _M_string, and may not be the correct size of the - // current stringbuf internal buffer. - __size_type __len = _M_string.size(); - if (_M_out_cur > _M_out_beg) - __len = max(__size_type(_M_out_end - _M_out_beg), __len); - return __string_type(_M_out_beg, _M_out_beg + __len); - } - else - return _M_string; - } - - void - str(const __string_type& __s) - { - _M_string = __s; - _M_stringbuf_init(_M_mode); - } - - protected: - // Common initialization code for both ctors goes here. - void - _M_stringbuf_init(ios_base::openmode __mode) - { - // _M_buf_size is a convenient alias for "what the streambuf - // thinks the allocated size of the string really is." This is - // necessary as ostringstreams are implemented with the - // streambufs having control of the allocation and - // re-allocation of the internal string object, _M_string. - _M_buf_size = _M_string.size(); - - // NB: Start ostringstream buffers at 512 bytes. This is an - // experimental value (pronounced "arbitrary" in some of the - // hipper english-speaking countries), and can be changed to - // suite particular needs. - _M_buf_size_opt = 512; - _M_mode = __mode; - if (_M_mode & ios_base::ate) - _M_really_sync(0, _M_buf_size); - else - _M_really_sync(0, 0); - } - - // Overridden virtual functions: - virtual int_type - underflow() - { - if (_M_in_cur && _M_in_cur < _M_in_end) - return traits_type::to_int_type(*gptr()); - else - return traits_type::eof(); - } - - virtual int_type - pbackfail(int_type __c = traits_type::eof()); - - virtual int_type - overflow(int_type __c = traits_type::eof()); - - virtual __streambuf_type* - setbuf(char_type* __s, streamsize __n) - { - if (__s && __n) - { - _M_string = __string_type(__s, __n); - _M_really_sync(0, 0); - } - return this; - } - - virtual pos_type - seekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - virtual pos_type - seekpos(pos_type __sp, - ios_base::openmode __mode = ios_base::in | ios_base::out); - - // Internal function for correctly updating the internal buffer - // for a particular _M_string, due to initialization or - // re-sizing of an existing _M_string. - // Assumes: contents of _M_string and internal buffer match exactly. - // __i == _M_in_cur - _M_in_beg - // __o == _M_out_cur - _M_out_beg - virtual int - _M_really_sync(__size_type __i, __size_type __o) - { - char_type* __base = const_cast<char_type*>(_M_string.data()); - bool __testin = _M_mode & ios_base::in; - bool __testout = _M_mode & ios_base::out; - __size_type __len = _M_string.size(); - - _M_buf = __base; - if (__testin) - this->setg(__base, __base + __i, __base + __len); - if (__testout) - { - this->setp(__base, __base + __len); - _M_out_cur += __o; - } - return 0; - } - }; - - - // 27.7.2 Template class basic_istringstream - template<typename _CharT, typename _Traits, typename _Alloc> - class basic_istringstream : public basic_istream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS -// 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; -#endif - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_istream<char_type, traits_type> __istream_type; - - private: - __stringbuf_type _M_stringbuf; - - public: - // Constructors: - explicit - basic_istringstream(ios_base::openmode __mode = ios_base::in) - : __istream_type(NULL), _M_stringbuf(__mode | ios_base::in) - { this->init(&_M_stringbuf); } - - explicit - basic_istringstream(const __string_type& __str, - ios_base::openmode __mode = ios_base::in) - : __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in) - { this->init(&_M_stringbuf); } - - ~basic_istringstream() - { } - - // Members: - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - __string_type - str() const - { return _M_stringbuf.str(); } - - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; - - - // 27.7.3 Template class basic_ostringstream - template <typename _CharT, typename _Traits, typename _Alloc> - class basic_ostringstream : public basic_ostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS -// 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; -#endif - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_ostream<char_type, traits_type> __ostream_type; - - private: - __stringbuf_type _M_stringbuf; - - public: - // Constructors/destructor: - explicit - basic_ostringstream(ios_base::openmode __mode = ios_base::out) - : __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out) - { this->init(&_M_stringbuf); } - - explicit - basic_ostringstream(const __string_type& __str, - ios_base::openmode __mode = ios_base::out) - : __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out) - { this->init(&_M_stringbuf); } - - ~basic_ostringstream() - { } - - // Members: - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - __string_type - str() const - { return _M_stringbuf.str(); } - - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; - - - // 27.7.4 Template class basic_stringstream - template <typename _CharT, typename _Traits, typename _Alloc> - class basic_stringstream : public basic_iostream<_CharT, _Traits> - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS -// 251. basic_stringbuf missing allocator_type - typedef _Alloc allocator_type; -#endif - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard Types: - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; - typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; - typedef basic_iostream<char_type, traits_type> __iostream_type; - - private: - __stringbuf_type _M_stringbuf; - - public: - // Constructors/destructors - explicit - basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in) - : __iostream_type(NULL), _M_stringbuf(__m) - { this->init(&_M_stringbuf); } - - explicit - basic_stringstream(const __string_type& __str, - ios_base::openmode __m = ios_base::out | ios_base::in) - : __iostream_type(NULL), _M_stringbuf(__str, __m) - { this->init(&_M_stringbuf); } - - ~basic_stringstream() - { } - - // Members: - __stringbuf_type* - rdbuf() const - { return const_cast<__stringbuf_type*>(&_M_stringbuf); } - - __string_type - str() const - { return _M_stringbuf.str(); } - - void - str(const __string_type& __s) - { _M_stringbuf.str(__s); } - }; -} // namespace std - - - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# define export -#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS -# include <bits/sstream.tcc> -#endif -#endif - -#endif // _CPP_SSTREAM diff --git a/libstdc++-v3/include/bits/std_stack.h b/libstdc++-v3/include/bits/std_stack.h deleted file mode 100644 index 166f428..0000000 --- a/libstdc++-v3/include/bits/std_stack.h +++ /dev/null @@ -1,77 +0,0 @@ -// <stack> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_stack.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_STACK -#define _CPP_STACK 1 - -#pragma GCC system_header - -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_deque.h> -#include <bits/stl_stack.h> - -#endif /* _CPP_STACK */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_stdexcept.h b/libstdc++-v3/include/bits/std_stdexcept.h deleted file mode 100644 index 66bac50..0000000 --- a/libstdc++-v3/include/bits/std_stdexcept.h +++ /dev/null @@ -1,150 +0,0 @@ -// Standard exception classes -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 19.1 Exception classes -// - -/** @file std_stdexcept.h - * The Standard C++ library provides classes to be used to report certain - * errors (17.4.4.8) in C++ programs. In the error model reflected in these - * classes, errors are divided into two broad categories: logic errors and - * runtime errors. - */ - -#ifndef _CPP_STDEXCEPT -#define _CPP_STDEXCEPT 1 - -#pragma GCC system_header - -#include <exception> -#include <string> - -namespace std -{ - /** Logic errors represent problems in the internal logic of a program; - * in theory, these are preventable, and even detectable before the - * program runs (e.g., violations of class invariants). - * @brief One of two subclasses of exception. - */ - class logic_error : public exception - { - string _M_msg; - - public: - /** Takes a character string describing the error. */ - explicit - logic_error(const string& __arg); - - virtual - ~logic_error() throw(); - - /** Returns a C-style character string describing the general cause of - * the current error (the same string passed to the ctor). */ - virtual const char* - what() const throw(); - }; - - /** Thrown by the library, or by you, to report domain errors (domain in - * the mathmatical sense). */ - class domain_error : public logic_error - { - public: - explicit domain_error(const string& __arg); - }; - - /** Thrown to report invalid arguments to functions. */ - class invalid_argument : public logic_error - { - public: - explicit invalid_argument(const string& __arg); - }; - - /** Thrown when an object is constructed that would exceed its maximum - * permitted size (e.g., a basic_string instance). */ - class length_error : public logic_error - { - public: - explicit length_error(const string& __arg); - }; - - /** This represents an argument whose value is not within the expected - * range (e.g., boundary checks in basic_string). */ - class out_of_range : public logic_error - { - public: - explicit out_of_range(const string& __arg); - }; - - /** Runtime errors represent problems outside the scope of a program; - * they cannot be easily predicted and can generally only be caught as - * the program executes. - * @brief One of two subclasses of exception. - */ - class runtime_error : public exception - { - string _M_msg; - - public: - /** Takes a character string describing the error. */ - explicit - runtime_error(const string& __arg); - - virtual - ~runtime_error() throw(); - - /** Returns a C-style character string describing the general cause of - * the current error (the same string passed to the ctor). */ - virtual const char* - what() const throw(); - }; - - /** Thrown to indicate range errors in internal computations. */ - class range_error : public runtime_error - { - public: - explicit range_error(const string& __arg); - }; - - /** Thrown to indicate arithmetic overflow. */ - class overflow_error : public runtime_error - { - public: - explicit overflow_error(const string& __arg); - }; - - /** Thrown to indicate arithmetic underflow. */ - class underflow_error : public runtime_error - { - public: - explicit underflow_error(const string& __arg); - }; -} // namespace std - -#endif // _CPP_STDEXCEPT diff --git a/libstdc++-v3/include/bits/std_streambuf.h b/libstdc++-v3/include/bits/std_streambuf.h deleted file mode 100644 index 8ef20ff..0000000 --- a/libstdc++-v3/include/bits/std_streambuf.h +++ /dev/null @@ -1,540 +0,0 @@ -// Stream buffer classes -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 27.5 Stream buffers -// - -/** @file std_streambuf.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_STREAMBUF -#define _CPP_STREAMBUF 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/std_iosfwd.h> -#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END -#include <bits/localefwd.h> -#include <bits/ios_base.h> - -namespace std -{ - template<typename _CharT, typename _Traits> - streamsize - __copy_streambufs(basic_ios<_CharT, _Traits>& _ios, - basic_streambuf<_CharT, _Traits>* __sbin, - basic_streambuf<_CharT, _Traits>* __sbout); - - // 27.5.2 Template class basic_streambuf<_CharT, _Traits> - template<typename _CharT, typename _Traits> - class basic_streambuf - { - public: - // Types: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // Non-standard Types: - typedef ctype<char_type> __ctype_type; - typedef basic_streambuf<char_type, traits_type> __streambuf_type; - - friend class basic_ios<char_type, traits_type>; - friend class basic_istream<char_type, traits_type>; - friend class basic_ostream<char_type, traits_type>; - friend class istreambuf_iterator<char_type, traits_type>; - friend class ostreambuf_iterator<char_type, traits_type>; - - friend streamsize - __copy_streambufs<>(basic_ios<char_type, traits_type>& __ios, - __streambuf_type* __sbin,__streambuf_type* __sbout); - - protected: - - // Pointer to the beginning of internally-allocated - // space. Filebuf manually allocates/deallocates this, whereas - // stringstreams attempt to use the built-in intelligence of the - // string class. If you are managing memory, set this. If not, - // leave it NULL. - char_type* _M_buf; - - // Actual size of allocated internal buffer, in bytes. - int_type _M_buf_size; - - // Optimal or preferred size of internal buffer, in bytes. - int_type _M_buf_size_opt; - - // True iff _M_in_* and _M_out_* buffers should always point to - // the same place. True for fstreams, false for sstreams. - bool _M_buf_unified; - - // This is based on _IO_FILE, just reordered to be more - // consistent, and is intended to be the most minimal abstraction - // for an internal buffer. - // get == input == read - // put == output == write - char_type* _M_in_beg; // Start of get area. - char_type* _M_in_cur; // Current read area. - char_type* _M_in_end; // End of get area. - char_type* _M_out_beg; // Start of put area. - char_type* _M_out_cur; // Current put area. - char_type* _M_out_end; // End of put area. - - // Place to stash in || out || in | out settings for current streambuf. - ios_base::openmode _M_mode; - - // Current locale setting. - locale _M_buf_locale; - - // True iff locale is initialized. - bool _M_buf_locale_init; - - // Necessary bits for putback buffer management. Only used in - // the basic_filebuf class, as necessary for the standard - // requirements. The only basic_streambuf member function that - // needs access to these data members is in_avail... - // NB: pbacks of over one character are not currently supported. - int_type _M_pback_size; - char_type* _M_pback; - char_type* _M_pback_cur_save; - char_type* _M_pback_end_save; - bool _M_pback_init; - - // Initializes pback buffers, and moves normal buffers to safety. - // Assumptions: - // _M_in_cur has already been moved back - void - _M_pback_create() - { - if (!_M_pback_init) - { - int_type __dist = _M_in_end - _M_in_cur; - int_type __len = min(_M_pback_size, __dist); - traits_type::copy(_M_pback, _M_in_cur, __len); - _M_pback_cur_save = _M_in_cur; - _M_pback_end_save = _M_in_end; - this->setg(_M_pback, _M_pback, _M_pback + __len); - _M_pback_init = true; - } - } - - // Deactivates pback buffer contents, and restores normal buffer. - // Assumptions: - // The pback buffer has only moved forward. - void - _M_pback_destroy() - { - if (_M_pback_init) - { - // Length _M_in_cur moved in the pback buffer. - int_type __off_cur = _M_in_cur - _M_pback; - - // For in | out buffers, the end can be pushed back... - int_type __off_end = 0; - int_type __pback_len = _M_in_end - _M_pback; - int_type __save_len = _M_pback_end_save - _M_buf; - if (__pback_len > __save_len) - __off_end = __pback_len - __save_len; - - this->setg(_M_buf, _M_pback_cur_save + __off_cur, - _M_pback_end_save + __off_end); - _M_pback_cur_save = NULL; - _M_pback_end_save = NULL; - _M_pback_init = false; - } - } - - // Correctly sets the _M_in_cur pointer, and bumps the - // _M_out_cur pointer as well if necessary. - void - _M_in_cur_move(off_type __n) // argument needs to be +- - { - bool __testout = _M_out_cur; - _M_in_cur += __n; - if (__testout && _M_buf_unified) - _M_out_cur += __n; - } - - // Correctly sets the _M_out_cur pointer, and bumps the - // appropriate _M_*_end pointers as well. Necessary for the - // un-tied stringbufs, in in|out mode. - // Invariant: - // __n + _M_out_[cur, end] <= _M_buf + _M_buf_size - // Assuming all _M_*_[beg, cur, end] pointers are operating on - // the same range: - // _M_buf <= _M_*_ <= _M_buf + _M_buf_size - void - _M_out_cur_move(off_type __n) // argument needs to be +- - { - bool __testin = _M_in_cur; - - _M_out_cur += __n; - if (__testin && _M_buf_unified) - _M_in_cur += __n; - if (_M_out_cur > _M_out_end) - { - _M_out_end = _M_out_cur; - // NB: in | out buffers drag the _M_in_end pointer along... - if (__testin) - _M_in_end += __n; - } - } - - // Return the size of the output buffer. This depends on the - // buffer in use: allocated buffers have a stored size in - // _M_buf_size and setbuf() buffers don't. - off_type - _M_out_buf_size() - { - off_type __ret = 0; - if (_M_out_cur) - { - // Using allocated buffer. - if (_M_out_beg == _M_buf) - __ret = _M_out_beg + _M_buf_size - _M_out_cur; - // Using non-allocated buffer. - else - __ret = _M_out_end - _M_out_cur; - } - return __ret; - } - - // These three functions are used to clarify internal buffer - // maintenance. After an overflow, or after a seekoff call that - // started at beg or end, or possibly when the stream becomes - // unbuffered, and a myrid other obscure corner cases, the - // internal buffer does not truly reflect the contents of the - // external buffer. At this point, for whatever reason, it is in - // an indeterminate state. - void - _M_set_indeterminate(void) - { - if (_M_mode & ios_base::in) - this->setg(_M_buf, _M_buf, _M_buf); - if (_M_mode & ios_base::out) - this->setp(_M_buf, _M_buf); - } - - void - _M_set_determinate(off_type __off) - { - bool __testin = _M_mode & ios_base::in; - bool __testout = _M_mode & ios_base::out; - if (__testin) - this->setg(_M_buf, _M_buf, _M_buf + __off); - if (__testout) - this->setp(_M_buf, _M_buf + __off); - } - - bool - _M_is_indeterminate(void) - { - bool __ret = false; - // Don't return true if unbuffered. - if (_M_buf) - { - if (_M_mode & ios_base::in) - __ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end; - if (_M_mode & ios_base::out) - __ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end; - } - return __ret; - } - - public: - virtual - ~basic_streambuf() - { - _M_buf_unified = false; - _M_buf_size = 0; - _M_buf_size_opt = 0; - _M_mode = ios_base::openmode(0); - _M_buf_locale_init = false; - } - - // Locales: - locale - pubimbue(const locale &__loc) - { - locale __tmp(this->getloc()); - this->imbue(__loc); - return __tmp; - } - - locale - getloc() const - { - if (_M_buf_locale_init) - return _M_buf_locale; - else - return locale(); - } - - // Buffer and positioning: - __streambuf_type* - pubsetbuf(char_type* __s, streamsize __n) - { return this->setbuf(__s, __n); } - - pos_type - pubseekoff(off_type __off, ios_base::seekdir __way, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { return this->seekoff(__off, __way, __mode); } - - pos_type - pubseekpos(pos_type __sp, - ios_base::openmode __mode = ios_base::in | ios_base::out) - { return this->seekpos(__sp, __mode); } - - int - pubsync() { return this->sync(); } - - // Get and put areas: - // Get area: - streamsize - in_avail() - { - streamsize __ret; - if (_M_in_cur && _M_in_cur < _M_in_end) - { - if (_M_pback_init) - { - int_type __save_len = _M_pback_end_save - _M_pback_cur_save; - int_type __pback_len = _M_in_cur - _M_pback; - __ret = __save_len - __pback_len; - } - else - __ret = this->egptr() - this->gptr(); - } - else - __ret = this->showmanyc(); - return __ret; - } - - int_type - snextc() - { - int_type __eof = traits_type::eof(); - return (this->sbumpc() == __eof ? __eof : this->sgetc()); - } - - int_type - sbumpc(); - - int_type - sgetc() - { - int_type __ret; - if (_M_in_cur && _M_in_cur < _M_in_end) - __ret = traits_type::to_int_type(*(this->gptr())); - else - __ret = this->underflow(); - return __ret; - } - - streamsize - sgetn(char_type* __s, streamsize __n) - { return this->xsgetn(__s, __n); } - - // Putback: - int_type - sputbackc(char_type __c); - - int_type - sungetc(); - - // Put area: - int_type - sputc(char_type __c); - - streamsize - sputn(const char_type* __s, streamsize __n) - { return this->xsputn(__s, __n); } - - protected: - basic_streambuf() - : _M_buf(NULL), _M_buf_size(0), - _M_buf_size_opt(static_cast<int_type>(BUFSIZ)), _M_buf_unified(false), - _M_in_beg(0), _M_in_cur(0), _M_in_end(0), _M_out_beg(0), _M_out_cur(0), - _M_out_end(0), _M_mode(ios_base::openmode(0)), _M_buf_locale(locale()), - _M_buf_locale_init(false), _M_pback_size(1), _M_pback(NULL), - _M_pback_cur_save(NULL), _M_pback_end_save(NULL), _M_pback_init(false) - { } - - // Get area: - char_type* - eback() const { return _M_in_beg; } - - char_type* - gptr() const { return _M_in_cur; } - - char_type* - egptr() const { return _M_in_end; } - - void - gbump(int __n) { _M_in_cur += __n; } - - void - setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) - { - _M_in_beg = __gbeg; - _M_in_cur = __gnext; - _M_in_end = __gend; - if (!(_M_mode & ios_base::in) && __gbeg && __gnext && __gend) - _M_mode = _M_mode | ios_base::in; - } - - // Put area: - char_type* - pbase() const { return _M_out_beg; } - - char_type* - pptr() const { return _M_out_cur; } - - char_type* - epptr() const { return _M_out_end; } - - void - pbump(int __n) { _M_out_cur += __n; } - - void - setp(char_type* __pbeg, char_type* __pend) - { - _M_out_beg = _M_out_cur = __pbeg; - _M_out_end = __pend; - if (!(_M_mode & ios_base::out) && __pbeg && __pend) - _M_mode = _M_mode | ios_base::out; - } - - // Virtual functions: - // Locales: - virtual void - imbue(const locale& __loc) - { - _M_buf_locale_init = true; - if (_M_buf_locale != __loc) - _M_buf_locale = __loc; - } - - // Buffer management and positioning: - virtual basic_streambuf<char_type,_Traits>* - setbuf(char_type*, streamsize) - { return this; } - - virtual pos_type - seekoff(off_type, ios_base::seekdir, - ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) - { return pos_type(off_type(-1)); } - - virtual pos_type - seekpos(pos_type, - ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) - { return pos_type(off_type(-1)); } - - virtual int - sync() { return 0; } - - // Get area: - virtual streamsize - showmanyc() { return 0; } - - virtual streamsize - xsgetn(char_type* __s, streamsize __n); - - virtual int_type - underflow() - { return traits_type::eof(); } - - virtual int_type - uflow() - { - int_type __ret = traits_type::eof(); - bool __testeof = this->underflow() == __ret; - bool __testpending = _M_in_cur && _M_in_cur < _M_in_end; - if (!__testeof && __testpending) - { - __ret = traits_type::to_int_type(*_M_in_cur); - ++_M_in_cur; - if (_M_buf_unified && _M_mode & ios_base::out) - ++_M_out_cur; - } - return __ret; - } - - // Putback: - virtual int_type - pbackfail(int_type /* __c */ = traits_type::eof()) - { return traits_type::eof(); } - - // Put area: - virtual streamsize - xsputn(const char_type* __s, streamsize __n); - - virtual int_type - overflow(int_type /* __c */ = traits_type::eof()) - { return traits_type::eof(); } - -#ifdef _GLIBCPP_DEPRECATED - public: - void - stossc() - { - if (_M_in_cur < _M_in_end) - ++_M_in_cur; - else - this->uflow(); - } -#endif - -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Side effect of DR 50. - private: - basic_streambuf(const __streambuf_type&); - - __streambuf_type& - operator=(const __streambuf_type&); -#endif - }; - -} // namespace std - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# define export -#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS -#include <bits/streambuf.tcc> -#endif -#endif - -#endif /* _CPP_STREAMBUF */ - diff --git a/libstdc++-v3/include/bits/std_string.h b/libstdc++-v3/include/bits/std_string.h deleted file mode 100644 index d93fa20..0000000 --- a/libstdc++-v3/include/bits/std_string.h +++ /dev/null @@ -1,60 +0,0 @@ -// Components for manipulating sequences of characters -*- C++ -*- - -// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// -// ISO C++ 14882: 21 Strings library -// - -/** @file std_string.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_STRING -#define _CPP_STRING 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/stringfwd.h> -#include <bits/char_traits.h> -#include <bits/std_memory.h> // For allocator. -#include <bits/type_traits.h> -#include <bits/std_iosfwd.h> // For operators >>, <<, and getline decls. -#include <bits/stl_iterator.h> -#include <bits/stl_function.h> // For less -#include <bits/basic_string.h> - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# include <bits/std_algorithm.h> // for find_if -# include <bits/basic_string.tcc> -#endif - -#endif /* _CPP_STRING */ - diff --git a/libstdc++-v3/include/bits/std_utility.h b/libstdc++-v3/include/bits/std_utility.h deleted file mode 100644 index 5917c83..0000000 --- a/libstdc++-v3/include/bits/std_utility.h +++ /dev/null @@ -1,73 +0,0 @@ -// <utility> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996,1997 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_utility.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_UTILITY -#define _CPP_UTILITY 1 - -#pragma GCC system_header -#include <bits/c++config.h> -#include <bits/stl_relops.h> -#include <bits/stl_pair.h> - -#endif /* _CPP_UTILITY */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/std_valarray.h b/libstdc++-v3/include/bits/std_valarray.h deleted file mode 100644 index 5f4c112..0000000 --- a/libstdc++-v3/include/bits/std_valarray.h +++ /dev/null @@ -1,742 +0,0 @@ -// The template and inlines for the -*- C++ -*- valarray class. - -// Copyright (C) 1997-1999, 2000, 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> - -/** @file std_valarray.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_VALARRAY -#define _CPP_VALARRAY 1 - -#pragma GCC system_header - -#include <bits/c++config.h> -#include <bits/std_cstddef.h> -#include <bits/std_cmath.h> -#include <bits/std_cstdlib.h> -#include <bits/std_numeric.h> -#include <bits/std_functional.h> -#include <bits/std_algorithm.h> - -namespace std -{ - template<class _Clos, typename _Tp> class _Expr; - - template<typename _Tp1, typename _Tp2> class _ValArray; - - template<template<class> class _Oper, - template<class, class> class _Meta, class _Dom> struct _UnClos; - - template<template<class> class _Oper, - template<class, class> class _Meta1, - template<class, class> class _Meta2, - class _Dom1, class _Dom2> class _BinClos; - - template<template<class, class> class _Meta, class _Dom> class _SClos; - - template<template<class, class> class _Meta, class _Dom> class _GClos; - - template<template<class, class> class _Meta, class _Dom> class _IClos; - - template<template<class, class> class _Meta, class _Dom> class _ValFunClos; - - template<template<class, class> class _Meta, class _Dom> class _RefFunClos; - - template<class _Tp> struct _Unary_plus; - template<class _Tp> struct _Bitwise_and; - template<class _Tp> struct _Bitwise_or; - template<class _Tp> struct _Bitwise_xor; - template<class _Tp> struct _Bitwise_not; - template<class _Tp> struct _Shift_left; - template<class _Tp> struct _Shift_right; - - template<class _Tp> class valarray; // An array of type _Tp - class slice; // BLAS-like slice out of an array - template<class _Tp> class slice_array; - class gslice; // generalized slice out of an array - template<class _Tp> class gslice_array; - template<class _Tp> class mask_array; // masked array - template<class _Tp> class indirect_array; // indirected array - -} // namespace std - -#include <bits/valarray_array.h> -#include <bits/valarray_meta.h> - -namespace std -{ - template<class _Tp> class valarray - { - public: - typedef _Tp value_type; - - // _lib.valarray.cons_ construct/destroy: - valarray(); - explicit valarray(size_t); - valarray(const _Tp&, size_t); - valarray(const _Tp* __restrict__, size_t); - valarray(const valarray&); - valarray(const slice_array<_Tp>&); - valarray(const gslice_array<_Tp>&); - valarray(const mask_array<_Tp>&); - valarray(const indirect_array<_Tp>&); - template<class _Dom> - valarray(const _Expr<_Dom,_Tp>& __e); - ~valarray(); - - // _lib.valarray.assign_ assignment: - valarray<_Tp>& operator=(const valarray<_Tp>&); - valarray<_Tp>& operator=(const _Tp&); - valarray<_Tp>& operator=(const slice_array<_Tp>&); - valarray<_Tp>& operator=(const gslice_array<_Tp>&); - valarray<_Tp>& operator=(const mask_array<_Tp>&); - valarray<_Tp>& operator=(const indirect_array<_Tp>&); - - template<class _Dom> valarray<_Tp>& - operator= (const _Expr<_Dom,_Tp>&); - - // _lib.valarray.access_ element access: - // XXX: LWG to be resolved. - const _Tp& operator[](size_t) const; - _Tp& operator[](size_t); - // _lib.valarray.sub_ subset operations: - _Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const; - slice_array<_Tp> operator[](slice); - _Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const; - gslice_array<_Tp> operator[](const gslice&); - valarray<_Tp> operator[](const valarray<bool>&) const; - mask_array<_Tp> operator[](const valarray<bool>&); - _Expr<_IClos<_ValArray, _Tp>, _Tp> - operator[](const valarray<size_t>&) const; - indirect_array<_Tp> operator[](const valarray<size_t>&); - - // _lib.valarray.unary_ unary operators: - _Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const; - _Expr<_UnClos<negate,_ValArray,_Tp>,_Tp> operator- () const; - _Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const; - _Expr<_UnClos<logical_not,_ValArray,_Tp>,bool> operator! () const; - - // _lib.valarray.cassign_ computed assignment: - valarray<_Tp>& operator*= (const _Tp&); - valarray<_Tp>& operator/= (const _Tp&); - valarray<_Tp>& operator%= (const _Tp&); - valarray<_Tp>& operator+= (const _Tp&); - valarray<_Tp>& operator-= (const _Tp&); - valarray<_Tp>& operator^= (const _Tp&); - valarray<_Tp>& operator&= (const _Tp&); - valarray<_Tp>& operator|= (const _Tp&); - valarray<_Tp>& operator<<=(const _Tp&); - valarray<_Tp>& operator>>=(const _Tp&); - valarray<_Tp>& operator*= (const valarray<_Tp>&); - valarray<_Tp>& operator/= (const valarray<_Tp>&); - valarray<_Tp>& operator%= (const valarray<_Tp>&); - valarray<_Tp>& operator+= (const valarray<_Tp>&); - valarray<_Tp>& operator-= (const valarray<_Tp>&); - valarray<_Tp>& operator^= (const valarray<_Tp>&); - valarray<_Tp>& operator|= (const valarray<_Tp>&); - valarray<_Tp>& operator&= (const valarray<_Tp>&); - valarray<_Tp>& operator<<=(const valarray<_Tp>&); - valarray<_Tp>& operator>>=(const valarray<_Tp>&); - - template<class _Dom> - valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&); - template<class _Dom> - valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&); - - - // _lib.valarray.members_ member functions: - size_t size() const; - _Tp sum() const; - _Tp min() const; - _Tp max() const; - -// // FIXME: Extension -// _Tp product () const; - - valarray<_Tp> shift (int) const; - valarray<_Tp> cshift(int) const; - _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const; - _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const; - void resize(size_t __size, _Tp __c = _Tp()); - - private: - size_t _M_size; - _Tp* __restrict__ _M_data; - - friend class _Array<_Tp>; - }; - - - template<typename _Tp> struct _Unary_plus : unary_function<_Tp,_Tp> { - _Tp operator() (const _Tp& __t) const { return __t; } - }; - - template<typename _Tp> struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; } - }; - - template<typename _Tp> struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; } - }; - - template<typename _Tp> struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; } - }; - - template<typename _Tp> struct _Bitwise_not : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __t) const { return ~__t; } - }; - - template<typename _Tp> struct _Shift_left : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; } - }; - - template<typename _Tp> struct _Shift_right : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; } - }; - - - template<typename _Tp> - inline const _Tp& - valarray<_Tp>::operator[] (size_t __i) const - { return _M_data[__i]; } - - template<typename _Tp> - inline _Tp& - valarray<_Tp>::operator[] (size_t __i) - { return _M_data[__i]; } - -} // std:: - -#include <bits/slice.h> -#include <bits/slice_array.h> -#include <bits/gslice.h> -#include <bits/gslice_array.h> -#include <bits/mask_array.h> -#include <bits/indirect_array.h> - -namespace std -{ - template<typename _Tp> - inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {} - - template<typename _Tp> - inline valarray<_Tp>::valarray (size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { __valarray_default_construct(_M_data, _M_data + __n); } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const _Tp& __t, size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { __valarray_fill_construct (_M_data, _M_data + __n, __t); } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const _Tp* __restrict__ __p, size_t __n) - : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) - { __valarray_copy_construct (__p, __p + __n, _M_data); } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const valarray<_Tp>& __v) - : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size)) - { __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const slice_array<_Tp>& __sa) - : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz)) - { - __valarray_copy - (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data)); - } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const gslice_array<_Tp>& __ga) - : _M_size(__ga._M_index.size()), - _M_data(__valarray_get_storage<_Tp>(_M_size)) - { - __valarray_copy - (__ga._M_array, _Array<size_t>(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const mask_array<_Tp>& __ma) - : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz)) - { - __valarray_copy - (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> - inline valarray<_Tp>::valarray (const indirect_array<_Tp>& __ia) - : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz)) - { - __valarray_copy - (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size); - } - - template<typename _Tp> template<class _Dom> - inline valarray<_Tp>::valarray (const _Expr<_Dom, _Tp>& __e) - : _M_size(__e.size ()), _M_data(__valarray_get_storage<_Tp>(_M_size)) - { __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); } - - template<typename _Tp> - inline valarray<_Tp>::~valarray () - { - __valarray_destroy_elements(_M_data, _M_data + _M_size); - __valarray_release_memory(_M_data); - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const valarray<_Tp>& __v) - { - __valarray_copy(__v._M_data, _M_size, _M_data); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const _Tp& __t) - { - __valarray_fill (_M_data, _M_size, __t); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const slice_array<_Tp>& __sa) - { - __valarray_copy (__sa._M_array, __sa._M_sz, - __sa._M_stride, _Array<_Tp>(_M_data)); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga) - { - __valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const mask_array<_Tp>& __ma) - { - __valarray_copy (__ma._M_array, __ma._M_mask, - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const indirect_array<_Tp>& __ia) - { - __valarray_copy (__ia._M_array, __ia._M_index, - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template<typename _Tp> template<class _Dom> - inline valarray<_Tp>& - valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e) - { - __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); - return *this; - } - - template<typename _Tp> - inline _Expr<_SClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[] (slice __s) const - { - typedef _SClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp> (_Closure (_Array<_Tp>(_M_data), __s)); - } - - template<typename _Tp> - inline slice_array<_Tp> - valarray<_Tp>::operator[] (slice __s) - { - return slice_array<_Tp> (_Array<_Tp>(_M_data), __s); - } - - template<typename _Tp> - inline _Expr<_GClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[] (const gslice& __gs) const - { - typedef _GClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp> - (_Closure (_Array<_Tp>(_M_data), __gs._M_index->_M_index)); - } - - template<typename _Tp> - inline gslice_array<_Tp> - valarray<_Tp>::operator[] (const gslice& __gs) - { - return gslice_array<_Tp> - (_Array<_Tp>(_M_data), __gs._M_index->_M_index); - } - - template<typename _Tp> - inline valarray<_Tp> - valarray<_Tp>::operator[] (const valarray<bool>& __m) const - { - size_t __s (0); - size_t __e (__m.size ()); - for (size_t __i=0; __i<__e; ++__i) - if (__m[__i]) ++__s; - return valarray<_Tp> (mask_array<_Tp> (_Array<_Tp>(_M_data), __s, - _Array<bool> (__m))); - } - - template<typename _Tp> - inline mask_array<_Tp> - valarray<_Tp>::operator[] (const valarray<bool>& __m) - { - size_t __s (0); - size_t __e (__m.size ()); - for (size_t __i=0; __i<__e; ++__i) - if (__m[__i]) ++__s; - return mask_array<_Tp> (_Array<_Tp>(_M_data), __s, _Array<bool> (__m)); - } - - template<typename _Tp> - inline _Expr<_IClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[] (const valarray<size_t>& __i) const - { - typedef _IClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp> (_Closure (*this, __i)); - } - - template<typename _Tp> - inline indirect_array<_Tp> - valarray<_Tp>::operator[] (const valarray<size_t>& __i) - { - return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(), - _Array<size_t> (__i)); - } - - template<class _Tp> - inline size_t valarray<_Tp>::size () const { return _M_size; } - - template<class _Tp> - inline _Tp - valarray<_Tp>::sum () const - { - return __valarray_sum(_M_data, _M_data + _M_size); - } - -// template<typename _Tp> -// inline _Tp -// valarray<_Tp>::product () const -// { -// return __valarray_product(_M_data, _M_data + _M_size); -// } - - template <class _Tp> - inline valarray<_Tp> - valarray<_Tp>::shift(int __n) const - { - _Tp* const __a = static_cast<_Tp*> - (__builtin_alloca(sizeof(_Tp) * _M_size)); - if (__n == 0) // no shift - __valarray_copy_construct(_M_data, _M_data + _M_size, __a); - else if (__n > 0) // __n > 0: shift left - { - if (size_t(__n) > _M_size) - __valarray_default_construct(__a, __a + __n); - else - { - __valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); - __valarray_default_construct(__a+_M_size-__n, __a + _M_size); - } - } - else // __n < 0: shift right - { - __valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n); - __valarray_default_construct(__a, __a - __n); - } - return valarray<_Tp> (__a, _M_size); - } - - template <class _Tp> - inline valarray<_Tp> - valarray<_Tp>::cshift (int __n) const - { - _Tp* const __a = static_cast<_Tp*> - (__builtin_alloca (sizeof(_Tp) * _M_size)); - if (__n == 0) // no cshift - __valarray_copy_construct(_M_data, _M_data + _M_size, __a); - else if (__n > 0) // cshift left - { - __valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n); - __valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); - } - else // cshift right - { - __valarray_copy_construct - (_M_data + _M_size+__n, _M_data + _M_size, __a); - __valarray_copy_construct - (_M_data, _M_data + _M_size+__n, __a - __n); - } - return valarray<_Tp>(__a, _M_size); - } - - template <class _Tp> - inline void - valarray<_Tp>::resize (size_t __n, _Tp __c) - { - // This complication is so to make valarray<valarray<T> > work - // even though it is not required by the standard. Nobody should - // be saying valarray<valarray<T> > anyway. See the specs. - __valarray_destroy_elements(_M_data, _M_data + _M_size); - if (_M_size != __n) - { - __valarray_release_memory(_M_data); - _M_size = __n; - _M_data = __valarray_get_storage<_Tp>(__n); - } - __valarray_fill_construct(_M_data, _M_data + __n, __c); - } - - template<typename _Tp> - inline _Tp - valarray<_Tp>::min() const - { - return *min_element (_M_data, _M_data+_M_size); - } - - template<typename _Tp> - inline _Tp - valarray<_Tp>::max() const - { - return *max_element (_M_data, _M_data+_M_size); - } - - template<class _Tp> - inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> - valarray<_Tp>::apply (_Tp func (_Tp)) const - { - typedef _ValFunClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure,_Tp> (_Closure (*this, func)); - } - - template<class _Tp> - inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> - valarray<_Tp>::apply (_Tp func (const _Tp &)) const - { - typedef _RefFunClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure,_Tp> (_Closure (*this, func)); - } - -#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \ - valarray<_Tp>::operator _Op() const \ - { \ - typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \ - return _Expr<_Closure, _Tp> (_Closure (*this)); \ - } - - _DEFINE_VALARRAY_UNARY_OPERATOR(+, _Unary_plus) - _DEFINE_VALARRAY_UNARY_OPERATOR(-, negate) - _DEFINE_VALARRAY_UNARY_OPERATOR(~, _Bitwise_not) - -#undef _DEFINE_VALARRAY_UNARY_OPERATOR - - template<typename _Tp> - inline _Expr<_UnClos<logical_not,_ValArray,_Tp>, bool> - valarray<_Tp>::operator!() const - { - typedef _UnClos<logical_not,_ValArray,_Tp> _Closure; - return _Expr<_Closure, bool> (_Closure (*this)); - } - -#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \ - template<class _Tp> \ - inline valarray<_Tp> & \ - valarray<_Tp>::operator _Op##= (const _Tp &__t) \ - { \ - _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \ - return *this; \ - } \ - \ - template<class _Tp> \ - inline valarray<_Tp> & \ - valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v) \ - { \ - _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \ - _Array<_Tp>(__v._M_data)); \ - return *this; \ - } - -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, plus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, minus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, multiplies) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, divides) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, modulus) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, xor) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, and) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, or) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, shift_left) -_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right) - -#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT - - -} // std:: - - -namespace std -{ - -#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \ - template<class _Tp> template<class _Dom> \ - inline valarray<_Tp> & \ - valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e) \ - { \ - _Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \ - return *this; \ - } - -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, plus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, minus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, multiplies) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, divides) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, modulus) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, xor) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, and) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, or) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, shift_left) -_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right) - -#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT - - -#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \ - operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \ - { \ - typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \ - operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \ - { \ - typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \ - } \ - \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \ - operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \ - { \ - typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \ - } - -_DEFINE_BINARY_OPERATOR(+, plus) -_DEFINE_BINARY_OPERATOR(-, minus) -_DEFINE_BINARY_OPERATOR(*, multiplies) -_DEFINE_BINARY_OPERATOR(/, divides) -_DEFINE_BINARY_OPERATOR(%, modulus) -_DEFINE_BINARY_OPERATOR(^, _Bitwise_xor) -_DEFINE_BINARY_OPERATOR(&, _Bitwise_and) -_DEFINE_BINARY_OPERATOR(|, _Bitwise_or) -_DEFINE_BINARY_OPERATOR(<<, _Shift_left) -_DEFINE_BINARY_OPERATOR(>>, _Shift_right) - -#undef _DEFINE_BINARY_OPERATOR - -#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \ - template<typename _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \ - operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \ - { \ - typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, bool> (_Closure (__v, __w)); \ - } \ - \ - template<class _Tp> \ - inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \ - operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \ - { \ - typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, bool> (_Closure (__v, __t)); \ - } \ - \ - template<class _Tp> \ - inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \ - operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \ - { \ - typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \ - return _Expr<_Closure, bool> (_Closure (__t, __v)); \ - } - -_DEFINE_LOGICAL_OPERATOR(&&, logical_and) -_DEFINE_LOGICAL_OPERATOR(||, logical_or) -_DEFINE_LOGICAL_OPERATOR(==, equal_to) -_DEFINE_LOGICAL_OPERATOR(!=, not_equal_to) -_DEFINE_LOGICAL_OPERATOR(<, less) -_DEFINE_LOGICAL_OPERATOR(>, greater) -_DEFINE_LOGICAL_OPERATOR(<=, less_equal) -_DEFINE_LOGICAL_OPERATOR(>=, greater_equal) - -#undef _DEFINE_LOGICAL_OPERATOR - -} // namespace std - -#endif // _CPP_VALARRAY - -// Local Variables: -// mode:c++ -// End: diff --git a/libstdc++-v3/include/bits/std_vector.h b/libstdc++-v3/include/bits/std_vector.h deleted file mode 100644 index 995daec..0000000 --- a/libstdc++-v3/include/bits/std_vector.h +++ /dev/null @@ -1,78 +0,0 @@ -// <vector> -*- C++ -*- - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * - * Copyright (c) 1996 - * Silicon Graphics Computer Systems, Inc. - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Silicon Graphics makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - */ - -/** @file std_vector.h - * This is an internal header file, included by other library headers. - * You should not attempt to use it directly. - */ - -#ifndef _CPP_VECTOR -#define _CPP_VECTOR 1 - -#pragma GCC system_header - -#include <bits/functexcept.h> -#include <bits/stl_algobase.h> -#include <bits/stl_alloc.h> -#include <bits/stl_construct.h> -#include <bits/stl_uninitialized.h> -#include <bits/stl_vector.h> -#include <bits/stl_bvector.h> - -#endif /* _CPP_VECTOR */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 2453976..6e488ea 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -1,6 +1,6 @@ // Bits and pieces used in algorithms -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002 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 @@ -62,15 +62,14 @@ #define __GLIBCPP_INTERNAL_ALGOBASE_H #include <bits/c++config.h> +#include <cstring> +#include <climits> +#include <cstdlib> +#include <cstddef> +#include <new> +#include <iosfwd> #include <bits/stl_pair.h> #include <bits/type_traits.h> -#include <bits/std_cstring.h> -#include <bits/std_climits.h> -#include <bits/std_cstdlib.h> -#include <bits/std_cstddef.h> -#include <new> - -#include <bits/std_iosfwd.h> #include <bits/stl_iterator_base_types.h> #include <bits/stl_iterator_base_funcs.h> #include <bits/stl_iterator.h> @@ -78,7 +77,6 @@ namespace std { - // swap and iter_swap /** diff --git a/libstdc++-v3/include/bits/stl_alloc.h b/libstdc++-v3/include/bits/stl_alloc.h index 751dffe..66d2ef6 100644 --- a/libstdc++-v3/include/bits/stl_alloc.h +++ b/libstdc++-v3/include/bits/stl_alloc.h @@ -78,12 +78,11 @@ * or online at http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#3 */ - -#include <bits/functexcept.h> // for __throw_bad_alloc -#include <bits/std_cstddef.h> -#include <bits/std_cstdlib.h> -#include <bits/std_cstring.h> -#include <bits/std_cassert.h> +#include <cstddef> +#include <cstdlib> +#include <cstring> +#include <cassert> +#include <bits/functexcept.h> // For __throw_bad_alloc #include <bits/stl_threads.h> namespace std diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index f679d52..866b20b 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -61,7 +61,7 @@ #ifndef _CPP_BITS_STL_UNINITIALIZED_H #define _CPP_BITS_STL_UNINITIALIZED_H 1 -#include <bits/std_cstring.h> +#include <cstring> namespace std { diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h index 1ef10e6..5b425e4 100644 --- a/libstdc++-v3/include/bits/valarray_array.h +++ b/libstdc++-v3/include/bits/valarray_array.h @@ -41,8 +41,8 @@ #include <bits/c++config.h> #include <bits/cpp_type_traits.h> -#include <bits/std_cstdlib.h> -#include <bits/std_cstring.h> +#include <cstdlib> +#include <cstring> #include <new> namespace std diff --git a/libstdc++-v3/include/c/bits/std_cassert.h b/libstdc++-v3/include/c/cassert index 3292838..3292838 100644 --- a/libstdc++-v3/include/c/bits/std_cassert.h +++ b/libstdc++-v3/include/c/cassert diff --git a/libstdc++-v3/include/c/bits/std_cctype.h b/libstdc++-v3/include/c/cctype index 5a423a0..5a423a0 100644 --- a/libstdc++-v3/include/c/bits/std_cctype.h +++ b/libstdc++-v3/include/c/cctype diff --git a/libstdc++-v3/include/c/bits/std_cerrno.h b/libstdc++-v3/include/c/cerrno index 23a0060..23a0060 100644 --- a/libstdc++-v3/include/c/bits/std_cerrno.h +++ b/libstdc++-v3/include/c/cerrno diff --git a/libstdc++-v3/include/c/bits/std_cfloat.h b/libstdc++-v3/include/c/cfloat index 7446997..7446997 100644 --- a/libstdc++-v3/include/c/bits/std_cfloat.h +++ b/libstdc++-v3/include/c/cfloat diff --git a/libstdc++-v3/include/std/ciso646 b/libstdc++-v3/include/c/ciso646 index c9f49fb..c9f49fb 100644 --- a/libstdc++-v3/include/std/ciso646 +++ b/libstdc++-v3/include/c/ciso646 diff --git a/libstdc++-v3/include/c/bits/std_climits.h b/libstdc++-v3/include/c/climits index 05795a6..05795a6 100644 --- a/libstdc++-v3/include/c/bits/std_climits.h +++ b/libstdc++-v3/include/c/climits diff --git a/libstdc++-v3/include/c/bits/std_clocale.h b/libstdc++-v3/include/c/clocale index 69ea1f6..69ea1f6 100644 --- a/libstdc++-v3/include/c/bits/std_clocale.h +++ b/libstdc++-v3/include/c/clocale diff --git a/libstdc++-v3/include/c/bits/std_cmath.h b/libstdc++-v3/include/c/cmath index 2625eac..2625eac 100644 --- a/libstdc++-v3/include/c/bits/std_cmath.h +++ b/libstdc++-v3/include/c/cmath diff --git a/libstdc++-v3/include/c/bits/std_csetjmp.h b/libstdc++-v3/include/c/csetjmp index 45e3da5..45e3da5 100644 --- a/libstdc++-v3/include/c/bits/std_csetjmp.h +++ b/libstdc++-v3/include/c/csetjmp diff --git a/libstdc++-v3/include/c/bits/std_csignal.h b/libstdc++-v3/include/c/csignal index da585dd..da585dd 100644 --- a/libstdc++-v3/include/c/bits/std_csignal.h +++ b/libstdc++-v3/include/c/csignal diff --git a/libstdc++-v3/include/c/bits/std_cstdarg.h b/libstdc++-v3/include/c/cstdarg index 5d2a2d8..5d2a2d8 100644 --- a/libstdc++-v3/include/c/bits/std_cstdarg.h +++ b/libstdc++-v3/include/c/cstdarg diff --git a/libstdc++-v3/include/c/bits/std_cstddef.h b/libstdc++-v3/include/c/cstddef index 456f6ca..456f6ca 100644 --- a/libstdc++-v3/include/c/bits/std_cstddef.h +++ b/libstdc++-v3/include/c/cstddef diff --git a/libstdc++-v3/include/c/bits/std_cstdio.h b/libstdc++-v3/include/c/cstdio index b7b2970..b7b2970 100644 --- a/libstdc++-v3/include/c/bits/std_cstdio.h +++ b/libstdc++-v3/include/c/cstdio diff --git a/libstdc++-v3/include/c/bits/std_cstdlib.h b/libstdc++-v3/include/c/cstdlib index 75402e4..75402e4 100644 --- a/libstdc++-v3/include/c/bits/std_cstdlib.h +++ b/libstdc++-v3/include/c/cstdlib diff --git a/libstdc++-v3/include/c/bits/std_cstring.h b/libstdc++-v3/include/c/cstring index 6a17655..6a17655 100644 --- a/libstdc++-v3/include/c/bits/std_cstring.h +++ b/libstdc++-v3/include/c/cstring diff --git a/libstdc++-v3/include/c/bits/std_ctime.h b/libstdc++-v3/include/c/ctime index bf53c50..bf53c50 100644 --- a/libstdc++-v3/include/c/bits/std_ctime.h +++ b/libstdc++-v3/include/c/ctime diff --git a/libstdc++-v3/include/c/bits/std_cwchar.h b/libstdc++-v3/include/c/cwchar index 713f444..713f444 100644 --- a/libstdc++-v3/include/c/bits/std_cwchar.h +++ b/libstdc++-v3/include/c/cwchar diff --git a/libstdc++-v3/include/c/bits/std_cwctype.h b/libstdc++-v3/include/c/cwctype index 6f8a7c8..6f8a7c8 100644 --- a/libstdc++-v3/include/c/bits/std_cwctype.h +++ b/libstdc++-v3/include/c/cwctype diff --git a/libstdc++-v3/include/c_std/bits/std_cassert.h b/libstdc++-v3/include/c_std/cassert index b0e1f13..b0e1f13 100644 --- a/libstdc++-v3/include/c_std/bits/std_cassert.h +++ b/libstdc++-v3/include/c_std/cassert diff --git a/libstdc++-v3/include/c_std/bits/std_cctype.h b/libstdc++-v3/include/c_std/cctype index 189f4f5..189f4f5 100644 --- a/libstdc++-v3/include/c_std/bits/std_cctype.h +++ b/libstdc++-v3/include/c_std/cctype diff --git a/libstdc++-v3/include/c_std/bits/std_cerrno.h b/libstdc++-v3/include/c_std/cerrno index 7f1cdf6..7f1cdf6 100644 --- a/libstdc++-v3/include/c_std/bits/std_cerrno.h +++ b/libstdc++-v3/include/c_std/cerrno diff --git a/libstdc++-v3/include/c_std/bits/std_cfloat.h b/libstdc++-v3/include/c_std/cfloat index 80f5ea5..80f5ea5 100644 --- a/libstdc++-v3/include/c_std/bits/std_cfloat.h +++ b/libstdc++-v3/include/c_std/cfloat diff --git a/libstdc++-v3/include/std/cmath b/libstdc++-v3/include/c_std/ciso646 index d565307..c9f49fb 100644 --- a/libstdc++-v3/include/std/cmath +++ b/libstdc++-v3/include/c_std/ciso646 @@ -27,15 +27,12 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file cmath +/** @file ciso646 * This is a Standard C++ Library file. You should @c #include this file * in your programs, rather than any of the "st[dl]_*.h" implementation files. * - * This is the C++ version of the Standard C Library header @c math.h, + * This is the C++ version of the Standard C Library header @c iso646.h, * and its contents are (mostly) the same as that header, but are all * contained in the namespace @c std. */ -#ifndef _CPP_CMATH -#include <bits/std_cmath.h> -#endif diff --git a/libstdc++-v3/include/c_std/bits/std_climits.h b/libstdc++-v3/include/c_std/climits index 48f6acf..48f6acf 100644 --- a/libstdc++-v3/include/c_std/bits/std_climits.h +++ b/libstdc++-v3/include/c_std/climits diff --git a/libstdc++-v3/include/c_std/bits/std_clocale.h b/libstdc++-v3/include/c_std/clocale index 02eb8fc..02eb8fc 100644 --- a/libstdc++-v3/include/c_std/bits/std_clocale.h +++ b/libstdc++-v3/include/c_std/clocale diff --git a/libstdc++-v3/include/c_std/bits/std_cmath.h b/libstdc++-v3/include/c_std/cmath index fedc5fb..79644ce 100644 --- a/libstdc++-v3/include/c_std/bits/std_cmath.h +++ b/libstdc++-v3/include/c_std/cmath @@ -647,7 +647,7 @@ namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export -# include <bits/cmath.tcc> +# include <cmath.tcc> #endif #endif diff --git a/libstdc++-v3/include/c_std/bits/cmath.tcc b/libstdc++-v3/include/c_std/cmath.tcc index 9b86bbb..9b86bbb 100644 --- a/libstdc++-v3/include/c_std/bits/cmath.tcc +++ b/libstdc++-v3/include/c_std/cmath.tcc diff --git a/libstdc++-v3/include/c_std/bits/std_csetjmp.h b/libstdc++-v3/include/c_std/csetjmp index 5db98e7..5db98e7 100644 --- a/libstdc++-v3/include/c_std/bits/std_csetjmp.h +++ b/libstdc++-v3/include/c_std/csetjmp diff --git a/libstdc++-v3/include/c_std/bits/std_csignal.h b/libstdc++-v3/include/c_std/csignal index 818e7bb..818e7bb 100644 --- a/libstdc++-v3/include/c_std/bits/std_csignal.h +++ b/libstdc++-v3/include/c_std/csignal diff --git a/libstdc++-v3/include/c_std/bits/std_cstdarg.h b/libstdc++-v3/include/c_std/cstdarg index 58faa3b..58faa3b 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdarg.h +++ b/libstdc++-v3/include/c_std/cstdarg diff --git a/libstdc++-v3/include/c_std/bits/std_cstddef.h b/libstdc++-v3/include/c_std/cstddef index deb2db4..deb2db4 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstddef.h +++ b/libstdc++-v3/include/c_std/cstddef diff --git a/libstdc++-v3/include/c_std/bits/std_cstdio.h b/libstdc++-v3/include/c_std/cstdio index a4c67d2..a6c78d2 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdio.h +++ b/libstdc++-v3/include/c_std/cstdio @@ -35,7 +35,7 @@ #define _CPP_CSTDIO 1 #include <bits/c++config.h> -#include <bits/std_cstddef.h> +#include <cstddef> #pragma GCC system_header #include <stdio.h> diff --git a/libstdc++-v3/include/c_std/bits/std_cstdlib.h b/libstdc++-v3/include/c_std/cstdlib index b67ce44..73176db 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstdlib.h +++ b/libstdc++-v3/include/c_std/cstdlib @@ -35,7 +35,7 @@ #define _CPP_CSTDLIB 1 #include <bits/c++config.h> -#include <bits/std_cstddef.h> +#include <cstddef> #pragma GCC system_header #include <stdlib.h> diff --git a/libstdc++-v3/include/c_std/bits/std_cstring.h b/libstdc++-v3/include/c_std/cstring index ab6a6a6..9708c89 100644 --- a/libstdc++-v3/include/c_std/bits/std_cstring.h +++ b/libstdc++-v3/include/c_std/cstring @@ -34,7 +34,7 @@ #ifndef _CPP_CSTRING #define _CPP_CSTRING 1 -#include <bits/std_cstddef.h> +#include <cstddef> #pragma GCC system_header #include <string.h> diff --git a/libstdc++-v3/include/c_std/bits/std_ctime.h b/libstdc++-v3/include/c_std/ctime index a9051b4..c5c108b 100644 --- a/libstdc++-v3/include/c_std/bits/std_ctime.h +++ b/libstdc++-v3/include/c_std/ctime @@ -34,7 +34,7 @@ #ifndef _CPP_CTIME #define _CPP_CTIME 1 -#include <bits/std_cstddef.h> +#include <cstddef> #pragma GCC system_header #include <time.h> diff --git a/libstdc++-v3/include/c_std/bits/std_cwchar.h b/libstdc++-v3/include/c_std/cwchar index b19cfea..8e69d51 100644 --- a/libstdc++-v3/include/c_std/bits/std_cwchar.h +++ b/libstdc++-v3/include/c_std/cwchar @@ -35,8 +35,8 @@ #define _CPP_CWCHAR 1 #include <bits/c++config.h> -#include <bits/std_cstddef.h> -#include <bits/std_ctime.h> +#include <cstddef> +#include <ctime> #if _GLIBCPP_HAVE_WCHAR_H #pragma GCC system_header diff --git a/libstdc++-v3/include/c_std/bits/std_cwctype.h b/libstdc++-v3/include/c_std/cwctype index 39ae076..39ae076 100644 --- a/libstdc++-v3/include/c_std/bits/std_cwctype.h +++ b/libstdc++-v3/include/c_std/cwctype diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm index 588c722..5b7fbff 100644 --- a/libstdc++-v3/include/ext/algorithm +++ b/libstdc++-v3/include/ext/algorithm @@ -57,7 +57,7 @@ #define _EXT_ALGORITHM #pragma GCC system_header -#include <bits/std_algorithm.h> +#include <algorithm> namespace __gnu_cxx { diff --git a/libstdc++-v3/include/ext/functional b/libstdc++-v3/include/ext/functional index 8a17161..cee3558 100644 --- a/libstdc++-v3/include/ext/functional +++ b/libstdc++-v3/include/ext/functional @@ -57,7 +57,7 @@ #define _EXT_FUNCTIONAL #pragma GCC system_header -#include <bits/std_functional.h> +#include <functional> namespace __gnu_cxx { diff --git a/libstdc++-v3/include/ext/iterator b/libstdc++-v3/include/ext/iterator index 73fd6c8..c7acdda 100644 --- a/libstdc++-v3/include/ext/iterator +++ b/libstdc++-v3/include/ext/iterator @@ -63,7 +63,7 @@ #pragma GCC system_header #include <bits/concept_check.h> -#include <bits/std_iterator.h> +#include <iterator> namespace __gnu_cxx { diff --git a/libstdc++-v3/include/ext/memory b/libstdc++-v3/include/ext/memory index 84c31f0..73fa427 100644 --- a/libstdc++-v3/include/ext/memory +++ b/libstdc++-v3/include/ext/memory @@ -57,7 +57,7 @@ #define _EXT_MEMORY #pragma GCC system_header -#include <bits/std_memory.h> +#include <memory> namespace __gnu_cxx { diff --git a/libstdc++-v3/include/ext/numeric b/libstdc++-v3/include/ext/numeric index 9336467..5b33a89 100644 --- a/libstdc++-v3/include/ext/numeric +++ b/libstdc++-v3/include/ext/numeric @@ -58,7 +58,7 @@ #pragma GCC system_header #include <bits/concept_check.h> -#include <bits/std_numeric.h> +#include <numeric> #include <ext/functional> // For identity_element diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h index b3e694c..19618ef 100644 --- a/libstdc++-v3/include/ext/ropeimpl.h +++ b/libstdc++-v3/include/ext/ropeimpl.h @@ -45,8 +45,8 @@ * You should not attempt to use it directly. */ -#include <bits/std_cstdio.h> -#include <bits/std_iostream.h> +#include <cstdio> +#include <iostream> #include <bits/functexcept.h> #include <ext/algorithm> // For copy_n and lexicographical_compare_3way diff --git a/libstdc++-v3/include/ext/stl_hash_fun.h b/libstdc++-v3/include/ext/stl_hash_fun.h index 64ddab8..c251ed3 100644 --- a/libstdc++-v3/include/ext/stl_hash_fun.h +++ b/libstdc++-v3/include/ext/stl_hash_fun.h @@ -61,7 +61,7 @@ #ifndef _CPP_BITS_STL_HASH_FUN_H #define _CPP_BITS_STL_HASH_FUN_H 1 -#include <bits/std_cstddef.h> +#include <cstddef> namespace __gnu_cxx { diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm index 33ed872..746eb47 100644 --- a/libstdc++-v3/include/std/algorithm +++ b/libstdc++-v3/include/std/algorithm @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <algorithm> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,50 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file algorithm - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_algorithm.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_ALGORITHM -#include <bits/std_algorithm.h> -#endif +#define _CPP_ALGORITHM 1 + +#pragma GCC system_header + +#include <bits/stl_algobase.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_tempbuf.h> +#include <bits/stl_algo.h> + +#endif /* _CPP_ALGORITHM */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 830ee7c..d9119e1 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <bitset> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,788 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file bitset - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * Copyright (c) 1998 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_bitset.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ -#ifndef _CPP_BITSET -#include <bits/std_bitset.h> -#endif +#ifndef __GLIBCPP_BITSET +#define __GLIBCPP_BITSET + +#pragma GCC system_header + +// A bitset of size N has N % (sizeof(unsigned long) * CHAR_BIT) unused +// bits. (They are the high- order bits in the highest word.) It is +// a class invariant of class bitset<> that those unused bits are +// always zero. + +// Most of the actual code isn't contained in bitset<> itself, but in the +// base class _Base_bitset. The base class works with whole words, not with +// individual bits. This allows us to specialize _Base_bitset for the +// important special case where the bitset is only a single word. + + +#include <cstddef> // for size_t +#include <cstring> // for memset +#include <string> +#include <stdexcept> +#include <bits/functexcept.h> // for invalid_argument, out_of_range, + // overflow_error +#include <ostream> // for ostream (operator<<) +#include <istream> // for istream (operator>>) + +#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long)) +#define __BITSET_WORDS(__n) \ + ((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD) + +namespace std +{ + +// structure to aid in counting bits +template<bool __dummy> +struct _Bit_count { + static unsigned char _S_bit_count[256]; +}; + +// Mapping from 8 bit unsigned integers to the index of the first one +// bit: +template<bool __dummy> +struct _First_one { + static unsigned char _S_first_one[256]; +}; + +// +// Base class: general case. +// + +template<size_t _Nw> +struct _Base_bitset { + typedef unsigned long _WordT; + + _WordT _M_w[_Nw]; // 0 is the least significant word. + + _Base_bitset( void ) { _M_do_reset(); } + _Base_bitset(unsigned long __val) { + _M_do_reset(); + _M_w[0] = __val; + } + + static size_t _S_whichword( size_t __pos ) + { return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; } + static size_t _S_whichbyte( size_t __pos ) + { return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; } + static size_t _S_whichbit( size_t __pos ) + { return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; } + static _WordT _S_maskbit( size_t __pos ) + { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } + + _WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; } + _WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; } + + _WordT& _M_hiword() { return _M_w[_Nw - 1]; } + _WordT _M_hiword() const { return _M_w[_Nw - 1]; } + + void _M_do_and(const _Base_bitset<_Nw>& __x) { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _M_w[__i] &= __x._M_w[__i]; + } + } + + void _M_do_or(const _Base_bitset<_Nw>& __x) { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _M_w[__i] |= __x._M_w[__i]; + } + } + + void _M_do_xor(const _Base_bitset<_Nw>& __x) { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _M_w[__i] ^= __x._M_w[__i]; + } + } + + void _M_do_left_shift(size_t __shift); + void _M_do_right_shift(size_t __shift); + + void _M_do_flip() { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _M_w[__i] = ~_M_w[__i]; + } + } + + void _M_do_set() { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _M_w[__i] = ~static_cast<_WordT>(0); + } + } + + void _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); } + + bool _M_is_equal(const _Base_bitset<_Nw>& __x) const { + for (size_t __i = 0; __i < _Nw; ++__i) { + if (_M_w[__i] != __x._M_w[__i]) + return false; + } + return true; + } + + bool _M_is_any() const { + for ( size_t __i = 0; __i < _Nw; __i++ ) { + if ( _M_w[__i] != static_cast<_WordT>(0) ) + return true; + } + return false; + } + + size_t _M_do_count() const { + size_t __result = 0; + const unsigned char* __byte_ptr = (const unsigned char*)_M_w; + const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw); + + while ( __byte_ptr < __end_ptr ) { + __result += _Bit_count<true>::_S_bit_count[*__byte_ptr]; + __byte_ptr++; + } + return __result; + } + + unsigned long _M_do_to_ulong() const; + + // find first "on" bit + size_t _M_do_find_first(size_t __not_found) const; + + // find the next "on" bit that follows "prev" + size_t _M_do_find_next(size_t __prev, size_t __not_found) const; +}; + +// +// Definitions of non-inline functions from _Base_bitset. +// + +template<size_t _Nw> +void _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift) +{ + if (__shift != 0) { + const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD; + const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD; + + if (__offset == 0) + for (size_t __n = _Nw - 1; __n >= __wshift; --__n) + _M_w[__n] = _M_w[__n - __wshift]; + + else { + const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset; + for (size_t __n = _Nw - 1; __n > __wshift; --__n) + _M_w[__n] = (_M_w[__n - __wshift] << __offset) | + (_M_w[__n - __wshift - 1] >> __sub_offset); + _M_w[__wshift] = _M_w[0] << __offset; + } + + fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0)); + } +} + +template<size_t _Nw> +void _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift) +{ + if (__shift != 0) { + const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD; + const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD; + const size_t __limit = _Nw - __wshift - 1; + + if (__offset == 0) + for (size_t __n = 0; __n <= __limit; ++__n) + _M_w[__n] = _M_w[__n + __wshift]; + + else { + const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset; + for (size_t __n = 0; __n < __limit; ++__n) + _M_w[__n] = (_M_w[__n + __wshift] >> __offset) | + (_M_w[__n + __wshift + 1] << __sub_offset); + _M_w[__limit] = _M_w[_Nw-1] >> __offset; + } + + fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0)); + } +} + +template<size_t _Nw> +unsigned long _Base_bitset<_Nw>::_M_do_to_ulong() const +{ + for (size_t __i = 1; __i < _Nw; ++__i) + if (_M_w[__i]) + __throw_overflow_error("bitset"); + + return _M_w[0]; +} + +template<size_t _Nw> +size_t _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const +{ + for ( size_t __i = 0; __i < _Nw; __i++ ) { + _WordT __thisword = _M_w[__i]; + if ( __thisword != static_cast<_WordT>(0) ) { + // find byte within word + for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) { + unsigned char __this_byte + = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one<true>::_S_first_one[__this_byte]; + + __thisword >>= CHAR_BIT; + } + } + } + // not found, so return an indication of failure. + return __not_found; +} + +template<size_t _Nw> +size_t +_Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const +{ + // make bound inclusive + ++__prev; + + // check out of bounds + if ( __prev >= _Nw * _GLIBCPP_BITSET_BITS_PER_WORD ) + return __not_found; + + // search first word + size_t __i = _S_whichword(__prev); + _WordT __thisword = _M_w[__i]; + + // mask off bits below bound + __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev); + + if ( __thisword != static_cast<_WordT>(0) ) { + // find byte within word + // get first byte into place + __thisword >>= _S_whichbyte(__prev) * CHAR_BIT; + for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) { + unsigned char __this_byte + = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one<true>::_S_first_one[__this_byte]; + + __thisword >>= CHAR_BIT; + } + } + + // check subsequent words + __i++; + for ( ; __i < _Nw; __i++ ) { + __thisword = _M_w[__i]; + if ( __thisword != static_cast<_WordT>(0) ) { + // find byte within word + for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) { + unsigned char __this_byte + = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one<true>::_S_first_one[__this_byte]; + + __thisword >>= CHAR_BIT; + } + } + } + + // not found, so return an indication of failure. + return __not_found; +} // end _M_do_find_next + + +// ------------------------------------------------------------ + +// +// Base class: specialization for a single word. +// + +template<> struct _Base_bitset<1> { + typedef unsigned long _WordT; + _WordT _M_w; + + _Base_bitset( void ) : _M_w(0) {} + _Base_bitset(unsigned long __val) : _M_w(__val) {} + + static size_t _S_whichword( size_t __pos ) + { return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; } + static size_t _S_whichbyte( size_t __pos ) + { return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; } + static size_t _S_whichbit( size_t __pos ) + { return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; } + static _WordT _S_maskbit( size_t __pos ) + { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); } + + _WordT& _M_getword(size_t) { return _M_w; } + _WordT _M_getword(size_t) const { return _M_w; } + + _WordT& _M_hiword() { return _M_w; } + _WordT _M_hiword() const { return _M_w; } + + void _M_do_and(const _Base_bitset<1>& __x) { _M_w &= __x._M_w; } + void _M_do_or(const _Base_bitset<1>& __x) { _M_w |= __x._M_w; } + void _M_do_xor(const _Base_bitset<1>& __x) { _M_w ^= __x._M_w; } + void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; } + void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; } + void _M_do_flip() { _M_w = ~_M_w; } + void _M_do_set() { _M_w = ~static_cast<_WordT>(0); } + void _M_do_reset() { _M_w = 0; } + + bool _M_is_equal(const _Base_bitset<1>& __x) const + { return _M_w == __x._M_w; } + bool _M_is_any() const + { return _M_w != 0; } + + size_t _M_do_count() const { + size_t __result = 0; + const unsigned char* __byte_ptr = (const unsigned char*)&_M_w; + const unsigned char* __end_ptr + = ((const unsigned char*)&_M_w)+sizeof(_M_w); + while ( __byte_ptr < __end_ptr ) { + __result += _Bit_count<true>::_S_bit_count[*__byte_ptr]; + __byte_ptr++; + } + return __result; + } + + unsigned long _M_do_to_ulong() const { return _M_w; } + + size_t _M_do_find_first(size_t __not_found) const; + + // find the next "on" bit that follows "prev" + size_t _M_do_find_next(size_t __prev, size_t __not_found) const; + +}; + + +// ------------------------------------------------------------ +// Helper class to zero out the unused high-order bits in the highest word. + +template <size_t _Extrabits> struct _Sanitize { + static void _M_do_sanitize(unsigned long& __val) + { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); } +}; + +template<> struct _Sanitize<0> { + static void _M_do_sanitize(unsigned long) {} +}; + + + +// ------------------------------------------------------------ +// Class bitset. +// _Nb may be any nonzero number of type size_t. + +template<size_t _Nb> +class bitset : private _Base_bitset<__BITSET_WORDS(_Nb)> +{ +private: + typedef _Base_bitset<__BITSET_WORDS(_Nb)> _Base; + typedef unsigned long _WordT; + +private: + void _M_do_sanitize() { + _Sanitize<_Nb%_GLIBCPP_BITSET_BITS_PER_WORD>::_M_do_sanitize(this->_M_hiword()); + } + +public: + + // bit reference: + class reference; + friend class reference; + + class reference { + friend class bitset; + + _WordT *_M_wp; + size_t _M_bpos; + + // left undefined + reference(); + + public: + reference( bitset& __b, size_t __pos ) { + _M_wp = &__b._M_getword(__pos); + _M_bpos = _Base::_S_whichbit(__pos); + } + + ~reference() {} + + // for b[i] = __x; + reference& operator=(bool __x) { + if ( __x ) + *_M_wp |= _Base::_S_maskbit(_M_bpos); + else + *_M_wp &= ~_Base::_S_maskbit(_M_bpos); + + return *this; + } + + // for b[i] = b[__j]; + reference& operator=(const reference& __j) { + if ( (*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)) ) + *_M_wp |= _Base::_S_maskbit(_M_bpos); + else + *_M_wp &= ~_Base::_S_maskbit(_M_bpos); + + return *this; + } + + // flips the bit + bool operator~() const + { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; } + + // for __x = b[i]; + operator bool() const + { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; } + + // for b[i].flip(); + reference& flip() { + *_M_wp ^= _Base::_S_maskbit(_M_bpos); + return *this; + } + }; + + // 23.3.5.1 constructors: + bitset() {} + bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val) + { _M_do_sanitize(); } + + template<class _CharT, class _Traits, class _Alloc> + explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, + size_t __pos = 0) + : _Base() + { + if (__pos > __s.size()) + __throw_out_of_range("bitset"); + _M_copy_from_string(__s, __pos, + basic_string<_CharT, _Traits, _Alloc>::npos); + } + template<class _CharT, class _Traits, class _Alloc> + bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, + size_t __pos, + size_t __n) + : _Base() + { + if (__pos > __s.size()) + __throw_out_of_range("bitset"); + _M_copy_from_string(__s, __pos, __n); + } + + // 23.3.5.2 bitset operations: + bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) { + this->_M_do_and(__rhs); + return *this; + } + + bitset<_Nb>& operator|=(const bitset<_Nb>& __rhs) { + this->_M_do_or(__rhs); + return *this; + } + + bitset<_Nb>& operator^=(const bitset<_Nb>& __rhs) { + this->_M_do_xor(__rhs); + return *this; + } + + bitset<_Nb>& operator<<=(size_t __pos) { + this->_M_do_left_shift(__pos); + this->_M_do_sanitize(); + return *this; + } + + bitset<_Nb>& operator>>=(size_t __pos) { + this->_M_do_right_shift(__pos); + this->_M_do_sanitize(); + return *this; + } + + // + // Extension: + // Versions of single-bit set, reset, flip, test with no range checking. + // + + bitset<_Nb>& _Unchecked_set(size_t __pos) { + this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); + return *this; + } + + bitset<_Nb>& _Unchecked_set(size_t __pos, int __val) { + if (__val) + this->_M_getword(__pos) |= _Base::_S_maskbit(__pos); + else + this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); + + return *this; + } + + bitset<_Nb>& _Unchecked_reset(size_t __pos) { + this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos); + return *this; + } + + bitset<_Nb>& _Unchecked_flip(size_t __pos) { + this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos); + return *this; + } + + bool _Unchecked_test(size_t __pos) const { + return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos)) + != static_cast<_WordT>(0); + } + + // Set, reset, and flip. + + bitset<_Nb>& set() { + this->_M_do_set(); + this->_M_do_sanitize(); + return *this; + } + + bitset<_Nb>& set(size_t __pos, bool __val = true) { + if (__pos >= _Nb) + __throw_out_of_range("bitset"); + + return _Unchecked_set(__pos, __val); + } + + bitset<_Nb>& reset() { + this->_M_do_reset(); + return *this; + } + + bitset<_Nb>& reset(size_t __pos) { + if (__pos >= _Nb) + __throw_out_of_range("bitset"); + + return _Unchecked_reset(__pos); + } + + bitset<_Nb>& flip() { + this->_M_do_flip(); + this->_M_do_sanitize(); + return *this; + } + + bitset<_Nb>& flip(size_t __pos) { + if (__pos >= _Nb) + __throw_out_of_range("bitset"); + + return _Unchecked_flip(__pos); + } + + bitset<_Nb> operator~() const { + return bitset<_Nb>(*this).flip(); + } + + // element access: + //for b[i]; + // _GLIBCPP_RESOLVE_LIB_DEFECTS Note that this implementation already + // resolves DR 11 (items 1 and 2), but does not do the range-checking + // required by that DR's resolution. -pme + reference operator[](size_t __pos) { return reference(*this,__pos); } + bool operator[](size_t __pos) const { return _Unchecked_test(__pos); } + + unsigned long to_ulong() const { return this->_M_do_to_ulong(); } + + template <class _CharT, class _Traits, class _Alloc> + basic_string<_CharT, _Traits, _Alloc> to_string() const { + basic_string<_CharT, _Traits, _Alloc> __result; + _M_copy_to_string(__result); + return __result; + } + + // Helper functions for string operations. + template<class _CharT, class _Traits, class _Alloc> + void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, + size_t, + size_t); + + template<class _CharT, class _Traits, class _Alloc> + void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const; + + size_t count() const { return this->_M_do_count(); } + + size_t size() const { return _Nb; } + + bool operator==(const bitset<_Nb>& __rhs) const { + return this->_M_is_equal(__rhs); + } + bool operator!=(const bitset<_Nb>& __rhs) const { + return !this->_M_is_equal(__rhs); + } + + bool test(size_t __pos) const { + if (__pos >= _Nb) + __throw_out_of_range("bitset"); + + return _Unchecked_test(__pos); + } + + bool any() const { return this->_M_is_any(); } + bool none() const { return !this->_M_is_any(); } + + bitset<_Nb> operator<<(size_t __pos) const + { return bitset<_Nb>(*this) <<= __pos; } + bitset<_Nb> operator>>(size_t __pos) const + { return bitset<_Nb>(*this) >>= __pos; } + + // + // EXTENSIONS: bit-find operations. These operations are + // experimental, and are subject to change or removal in future + // versions. + // + + // find the index of the first "on" bit + size_t _Find_first() const + { return this->_M_do_find_first(_Nb); } + + // find the index of the next "on" bit after prev + size_t _Find_next( size_t __prev ) const + { return this->_M_do_find_next(__prev, _Nb); } + +}; + +// +// Definitions of non-inline member functions. +// + +template <size_t _Nb> +template<class _CharT, class _Traits, class _Alloc> +void bitset<_Nb> + ::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, + size_t __pos, + size_t __n) +{ + reset(); + const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos)); + for (size_t __i = 0; __i < __nbits; ++__i) { + switch(__s[__pos + __nbits - __i - 1]) { + case '0': + break; + case '1': + set(__i); + break; + default: + __throw_invalid_argument("bitset"); + } + } +} + +template <size_t _Nb> +template <class _CharT, class _Traits, class _Alloc> +void bitset<_Nb> + ::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const +{ + __s.assign(_Nb, '0'); + + for (size_t __i = 0; __i < _Nb; ++__i) + if (_Unchecked_test(__i)) + __s[_Nb - 1 - __i] = '1'; +} + +// ------------------------------------------------------------ + +// +// 23.3.5.3 bitset operations: +// + +template <size_t _Nb> +inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result &= __y; + return __result; +} + + +template <size_t _Nb> +inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result |= __y; + return __result; +} + +template <size_t _Nb> +inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result ^= __y; + return __result; +} + +template <class _CharT, class _Traits, size_t _Nb> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) +{ + typedef typename _Traits::char_type char_type; + basic_string<_CharT, _Traits> __tmp; + __tmp.reserve(_Nb); + + // Skip whitespace + typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); + if (__sentry) { + basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); + for (size_t __i = 0; __i < _Nb; ++__i) { + static typename _Traits::int_type __eof = _Traits::eof(); + + typename _Traits::int_type __c1 = __buf->sbumpc(); + if (_Traits::eq_int_type(__c1, __eof)) { + __is.setstate(ios_base::eofbit); + break; + } + else { + char_type __c2 = _Traits::to_char_type(__c1); + char_type __c = __is.narrow(__c2, '*'); + + if (__c == '0' || __c == '1') + __tmp.push_back(__c); + else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) { + __is.setstate(ios_base::failbit); + break; + } + } + } + + if (__tmp.empty()) + __is.setstate(ios_base::failbit); + else + __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); + } + + return __is; +} + +template <class _CharT, class _Traits, size_t _Nb> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) +{ + basic_string<_CharT, _Traits> __tmp; + __x._M_copy_to_string(__tmp); + return __os << __tmp; +} + +} // namespace std + +#undef __BITSET_WORDS + +#endif /* __GLIBCPP_BITSET */ + + +// Local Variables: +// mode:C++ +// End: + diff --git a/libstdc++-v3/include/std/cassert b/libstdc++-v3/include/std/cassert deleted file mode 100644 index 5cb1e01..0000000 --- a/libstdc++-v3/include/std/cassert +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cassert - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c assert.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -// This one should not have include guards. -#include <bits/std_cassert.h> - diff --git a/libstdc++-v3/include/std/cctype b/libstdc++-v3/include/std/cctype deleted file mode 100644 index b5bf928..0000000 --- a/libstdc++-v3/include/std/cctype +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cctype - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c ctype.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CCTYPE -#include <bits/std_cctype.h> -#endif diff --git a/libstdc++-v3/include/std/cerrno b/libstdc++-v3/include/std/cerrno deleted file mode 100644 index 0c17749..0000000 --- a/libstdc++-v3/include/std/cerrno +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cerrno - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c errno.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CERRNO -#include <bits/std_cerrno.h> -#endif diff --git a/libstdc++-v3/include/std/cfloat b/libstdc++-v3/include/std/cfloat deleted file mode 100644 index fa5756d..0000000 --- a/libstdc++-v3/include/std/cfloat +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cfloat - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c float.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CFLOAT -#include <bits/std_cfloat.h> -#endif diff --git a/libstdc++-v3/include/std/climits b/libstdc++-v3/include/std/climits deleted file mode 100644 index 345ad61..0000000 --- a/libstdc++-v3/include/std/climits +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file climits - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c limits.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CLIMITS -#include <bits/std_climits.h> -#endif diff --git a/libstdc++-v3/include/std/clocale b/libstdc++-v3/include/std/clocale deleted file mode 100644 index 3775010..0000000 --- a/libstdc++-v3/include/std/clocale +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file clocale - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c locale.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CLOCALE -#include <bits/std_clocale.h> -#endif diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index 6b7abcf..18dd867 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// The template and inlines for the -*- C++ -*- complex number classes. -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -27,11 +27,1032 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file complex - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 26.2 Complex Numbers +// Note: this is not a conforming implementation. +// Initially implemented by Ulrich Drepper <drepper@cygnus.com> +// Improved by Gabriel Dos Reis <dosreis@cmla.ens-cachan.fr> +// + +/** @file std_complex.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_COMPLEX -#include <bits/std_complex.h> +#define _CPP_COMPLEX 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <bits/cpp_type_traits.h> +#include <cmath> +#include <sstream> + +namespace std +{ + // Forward declarations + template<typename _Tp> class complex; + template<> class complex<float>; + template<> class complex<double>; + template<> class complex<long double>; + + template<typename _Tp> _Tp abs(const complex<_Tp>&); + template<typename _Tp> _Tp arg(const complex<_Tp>&); + template<typename _Tp> _Tp norm(const complex<_Tp>&); + + template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0); + + // Transcendentals: + template<typename _Tp> complex<_Tp> cos(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> cosh(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> exp(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> log(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> log10(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, int); + template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&); + template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, + const complex<_Tp>&); + template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&); + template<typename _Tp> complex<_Tp> sin(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> sinh(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> sqrt(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&); + template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&); + + + // 26.2.2 Primary template class complex + template<typename _Tp> + class complex + { + public: + typedef _Tp value_type; + + complex(const _Tp& = _Tp(), const _Tp & = _Tp()); + + // Let's the compiler synthetize the copy constructor + // complex (const complex<_Tp>&); + template<typename _Up> + complex(const complex<_Up>&); + + _Tp real() const; + _Tp imag() const; + + complex<_Tp>& operator=(const _Tp&); + complex<_Tp>& operator+=(const _Tp&); + complex<_Tp>& operator-=(const _Tp&); + complex<_Tp>& operator*=(const _Tp&); + complex<_Tp>& operator/=(const _Tp&); + + // Let's the compiler synthetize the + // copy and assignment operator + // complex<_Tp>& operator= (const complex<_Tp>&); + template<typename _Up> + complex<_Tp>& operator=(const complex<_Up>&); + template<typename _Up> + complex<_Tp>& operator+=(const complex<_Up>&); + template<typename _Up> + complex<_Tp>& operator-=(const complex<_Up>&); + template<typename _Up> + complex<_Tp>& operator*=(const complex<_Up>&); + template<typename _Up> + complex<_Tp>& operator/=(const complex<_Up>&); + + private: + _Tp _M_real, _M_imag; + }; + + template<typename _Tp> + inline _Tp + complex<_Tp>::real() const { return _M_real; } + + template<typename _Tp> + inline _Tp + complex<_Tp>::imag() const { return _M_imag; } + + template<typename _Tp> + inline + complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) + : _M_real(__r), _M_imag(__i) { } + + template<typename _Tp> + template<typename _Up> + inline + complex<_Tp>::complex(const complex<_Up>& __z) + : _M_real(__z.real()), _M_imag(__z.imag()) { } + + template<typename _Tp> + complex<_Tp>& + complex<_Tp>::operator=(const _Tp& __t) + { + _M_real = __t; + _M_imag = _Tp(); + return *this; + } + + // 26.2.5/1 + template<typename _Tp> + inline complex<_Tp>& + complex<_Tp>::operator+=(const _Tp& __t) + { + _M_real += __t; + return *this; + } + + // 26.2.5/3 + template<typename _Tp> + inline complex<_Tp>& + complex<_Tp>::operator-=(const _Tp& __t) + { + _M_real -= __t; + return *this; + } + + // 26.2.5/5 + template<typename _Tp> + complex<_Tp>& + complex<_Tp>::operator*=(const _Tp& __t) + { + _M_real *= __t; + _M_imag *= __t; + return *this; + } + + // 26.2.5/7 + template<typename _Tp> + complex<_Tp>& + complex<_Tp>::operator/=(const _Tp& __t) + { + _M_real /= __t; + _M_imag /= __t; + return *this; + } + + template<typename _Tp> + template<typename _Up> + complex<_Tp>& + complex<_Tp>::operator=(const complex<_Up>& __z) + { + _M_real = __z.real(); + _M_imag = __z.imag(); + return *this; + } + + // 26.2.5/9 + template<typename _Tp> + template<typename _Up> + complex<_Tp>& + complex<_Tp>::operator+=(const complex<_Up>& __z) + { + _M_real += __z.real(); + _M_imag += __z.imag(); + return *this; + } + + // 26.2.5/11 + template<typename _Tp> + template<typename _Up> + complex<_Tp>& + complex<_Tp>::operator-=(const complex<_Up>& __z) + { + _M_real -= __z.real(); + _M_imag -= __z.imag(); + return *this; + } + + // 26.2.5/13 + // XXX: This is a grammar school implementation. + template<typename _Tp> + template<typename _Up> + complex<_Tp>& + complex<_Tp>::operator*=(const complex<_Up>& __z) + { + const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag(); + _M_imag = _M_real * __z.imag() + _M_imag * __z.real(); + _M_real = __r; + return *this; + } + + // 26.2.5/15 + // XXX: This is a grammar school implementation. + template<typename _Tp> + template<typename _Up> + complex<_Tp>& + complex<_Tp>::operator/=(const complex<_Up>& __z) + { + const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); + const _Tp __n = norm(__z); + _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; + _M_real = __r / __n; + return *this; + } + + // Operators: + template<typename _Tp> + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) += __y; } + + template<typename _Tp> + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) += __y; } + + template<typename _Tp> + inline complex<_Tp> + operator+(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__y) += __x; } + + template<typename _Tp> + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) -= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) -= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator-(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) -= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) *= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) *= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator*(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__y) *= __x; } + + template<typename _Tp> + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) /= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) /= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator/(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) /= __y; } + + template<typename _Tp> + inline complex<_Tp> + operator+(const complex<_Tp>& __x) + { return __x; } + + template<typename _Tp> + inline complex<_Tp> + operator-(const complex<_Tp>& __x) + { return complex<_Tp>(-__x.real(), -__x.imag()); } + + template<typename _Tp> + inline bool + operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() == __y.real() && __x.imag() == __y.imag(); } + + template<typename _Tp> + inline bool + operator==(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() == __y && __x.imag() == _Tp(); } + + template<typename _Tp> + inline bool + operator==(const _Tp& __x, const complex<_Tp>& __y) + { return __x == __y.real() && _Tp() == __y.imag(); } + + template<typename _Tp> + inline bool + operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() != __y.real() || __x.imag() != __y.imag(); } + + template<typename _Tp> + inline bool + operator!=(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() != __y || __x.imag() != _Tp(); } + + template<typename _Tp> + inline bool + operator!=(const _Tp& __x, const complex<_Tp>& __y) + { return __x != __y.real() || _Tp() != __y.imag(); } + + template<typename _Tp, typename _CharT, class _Traits> + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) + { + _Tp __re_x, __im_x; + _CharT __ch; + __is >> __ch; + if (__ch == '(') + { + __is >> __re_x >> __ch; + if (__ch == ',') + { + __is >> __im_x >> __ch; + if (__ch == ')') + __x = complex<_Tp>(__re_x, __im_x); + else + __is.setstate(ios_base::failbit); + } + else if (__ch == ')') + __x = complex<_Tp>(__re_x, _Tp(0)); + else + __is.setstate(ios_base::failbit); + } + else + { + __is.putback(__ch); + __is >> __re_x; + __x = complex<_Tp>(__re_x, _Tp(0)); + } + return __is; + } + + template<typename _Tp, typename _CharT, class _Traits> + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) + { + basic_ostringstream<_CharT, _Traits> __s; + __s.flags(__os.flags()); + __s.imbue(__os.getloc()); + __s.precision(__os.precision()); + __s << '(' << __x.real() << "," << __x.imag() << ')'; + return __os << __s.str(); + } + + // Values + template<typename _Tp> + inline _Tp + real(const complex<_Tp>& __z) + { return __z.real(); } + + template<typename _Tp> + inline _Tp + imag(const complex<_Tp>& __z) + { return __z.imag(); } + + template<typename _Tp> + inline _Tp + abs(const complex<_Tp>& __z) + { + _Tp __x = __z.real(); + _Tp __y = __z.imag(); + const _Tp __s = max(abs(__x), abs(__y)); + if (__s == _Tp()) // well ... + return __s; + __x /= __s; + __y /= __s; + return __s * sqrt(__x * __x + __y * __y); + } + + template<typename _Tp> + inline _Tp + arg(const complex<_Tp>& __z) + { return atan2(__z.imag(), __z.real()); } + + // 26.2.7/5: norm(__z) returns the squared magintude of __z. + // As defined, norm() is -not- a norm is the common mathematical + // sens used in numerics. The helper class _Norm_helper<> tries to + // distinguish between builtin floating point and the rest, so as + // to deliver an answer as close as possible to the real value. + template<bool> + struct _Norm_helper + { + template<typename _Tp> + static inline _Tp _S_do_it(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return __x * __x + __y * __y; + } + }; + + template<> + struct _Norm_helper<true> + { + template<typename _Tp> + static inline _Tp _S_do_it(const complex<_Tp>& __z) + { + _Tp __res = abs(__z); + return __res * __res; + } + }; + + template<typename _Tp> + inline _Tp + norm(const complex<_Tp>& __z) + { + return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z); + } + + template<typename _Tp> + inline complex<_Tp> + polar(const _Tp& __rho, const _Tp& __theta) + { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } + + template<typename _Tp> + inline complex<_Tp> + conj(const complex<_Tp>& __z) + { return complex<_Tp>(__z.real(), -__z.imag()); } + + // Transcendentals + template<typename _Tp> + inline complex<_Tp> + cos(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); + } + + template<typename _Tp> + inline complex<_Tp> + cosh(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); + } + + template<typename _Tp> + inline complex<_Tp> + exp(const complex<_Tp>& __z) + { return polar(exp(__z.real()), __z.imag()); } + + template<typename _Tp> + inline complex<_Tp> + log(const complex<_Tp>& __z) + { return complex<_Tp>(log(abs(__z)), arg(__z)); } + + template<typename _Tp> + inline complex<_Tp> + log10(const complex<_Tp>& __z) + { return log(__z) / log(_Tp(10.0)); } + + template<typename _Tp> + inline complex<_Tp> + sin(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); + } + + template<typename _Tp> + inline complex<_Tp> + sinh(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); + } + + template<typename _Tp> + complex<_Tp> + sqrt(const complex<_Tp>& __z) + { + _Tp __x = __z.real(); + _Tp __y = __z.imag(); + + if (__x == _Tp()) + { + _Tp __t = sqrt(abs(__y) / 2); + return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); + } + else + { + _Tp __t = sqrt(2 * (abs(__z) + abs(__x))); + _Tp __u = __t / 2; + return __x > _Tp() + ? complex<_Tp>(__u, __y / __t) + : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); + } + } + + template<typename _Tp> + inline complex<_Tp> + tan(const complex<_Tp>& __z) + { + return sin(__z) / cos(__z); + } + + template<typename _Tp> + inline complex<_Tp> + tanh(const complex<_Tp>& __z) + { + return sinh(__z) / cosh(__z); + } + + template<typename _Tp> + inline complex<_Tp> + pow(const complex<_Tp>& __z, int __n) + { + return __pow_helper(__z, __n); + } + + template<typename _Tp> + inline complex<_Tp> + pow(const complex<_Tp>& __x, const _Tp& __y) + { + return exp(__y * log(__x)); + } + + template<typename _Tp> + inline complex<_Tp> + pow(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + return exp(__y * log(__x)); + } + + template<typename _Tp> + inline complex<_Tp> + pow(const _Tp& __x, const complex<_Tp>& __y) + { + return exp(__y * log(__x)); + } + + // 26.2.3 complex specializations + // complex<float> specialization + template<> class complex<float> + { + public: + typedef float value_type; + + complex(float = 0.0f, float = 0.0f); +#ifdef _GLIBCPP_BUGGY_COMPLEX + complex(const complex& __z) : _M_value(__z._M_value) { } +#endif + explicit complex(const complex<double>&); + explicit complex(const complex<long double>&); + + float real() const; + float imag() const; + + complex<float>& operator=(float); + complex<float>& operator+=(float); + complex<float>& operator-=(float); + complex<float>& operator*=(float); + complex<float>& operator/=(float); + + // Let's the compiler synthetize the copy and assignment + // operator. It always does a pretty good job. + // complex& operator= (const complex&); + template<typename _Tp> + complex<float>&operator=(const complex<_Tp>&); + template<typename _Tp> + complex<float>& operator+=(const complex<_Tp>&); + template<class _Tp> + complex<float>& operator-=(const complex<_Tp>&); + template<class _Tp> + complex<float>& operator*=(const complex<_Tp>&); + template<class _Tp> + complex<float>&operator/=(const complex<_Tp>&); + + private: + typedef __complex__ float _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex<double>; + friend class complex<long double>; + }; + + inline float + complex<float>::real() const + { return __real__ _M_value; } + + inline float + complex<float>::imag() const + { return __imag__ _M_value; } + + inline + complex<float>::complex(float r, float i) + { + __real__ _M_value = r; + __imag__ _M_value = i; + } + + inline complex<float>& + complex<float>::operator=(float __f) + { + __real__ _M_value = __f; + __imag__ _M_value = 0.0f; + return *this; + } + + inline complex<float>& + complex<float>::operator+=(float __f) + { + __real__ _M_value += __f; + return *this; + } + + inline complex<float>& + complex<float>::operator-=(float __f) + { + __real__ _M_value -= __f; + return *this; + } + + inline complex<float>& + complex<float>::operator*=(float __f) + { + _M_value *= __f; + return *this; + } + + inline complex<float>& + complex<float>::operator/=(float __f) + { + _M_value /= __f; + return *this; + } + + template<typename _Tp> + inline complex<float>& + complex<float>::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<float>& + complex<float>::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<float>& + complex<float>::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<float>& + complex<float>::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template<typename _Tp> + inline complex<float>& + complex<float>::operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + // 26.2.3 complex specializations + // complex<double> specialization + template<> class complex<double> + { + public: + typedef double value_type; + + complex(double =0.0, double =0.0); +#ifdef _GLIBCPP_BUGGY_COMPLEX + complex(const complex& __z) : _M_value(__z._M_value) { } +#endif + complex(const complex<float>&); + explicit complex(const complex<long double>&); + + double real() const; + double imag() const; + + complex<double>& operator=(double); + complex<double>& operator+=(double); + complex<double>& operator-=(double); + complex<double>& operator*=(double); + complex<double>& operator/=(double); + + // The compiler will synthetize this, efficiently. + // complex& operator= (const complex&); + template<typename _Tp> + complex<double>& operator=(const complex<_Tp>&); + template<typename _Tp> + complex<double>& operator+=(const complex<_Tp>&); + template<typename _Tp> + complex<double>& operator-=(const complex<_Tp>&); + template<typename _Tp> + complex<double>& operator*=(const complex<_Tp>&); + template<typename _Tp> + complex<double>& operator/=(const complex<_Tp>&); + + private: + typedef __complex__ double _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex<float>; + friend class complex<long double>; + }; + + inline double + complex<double>::real() const + { return __real__ _M_value; } + + inline double + complex<double>::imag() const + { return __imag__ _M_value; } + + inline + complex<double>::complex(double __r, double __i) + { + __real__ _M_value = __r; + __imag__ _M_value = __i; + } + + inline complex<double>& + complex<double>::operator=(double __d) + { + __real__ _M_value = __d; + __imag__ _M_value = 0.0; + return *this; + } + + inline complex<double>& + complex<double>::operator+=(double __d) + { + __real__ _M_value += __d; + return *this; + } + + inline complex<double>& + complex<double>::operator-=(double __d) + { + __real__ _M_value -= __d; + return *this; + } + + inline complex<double>& + complex<double>::operator*=(double __d) + { + _M_value *= __d; + return *this; + } + + inline complex<double>& + complex<double>::operator/=(double __d) + { + _M_value /= __d; + return *this; + } + + template<typename _Tp> + inline complex<double>& + complex<double>::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<double>& + complex<double>::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<double>& + complex<double>::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<double>& + complex<double>::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template<typename _Tp> + inline complex<double>& + complex<double>::operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + // 26.2.3 complex specializations + // complex<long double> specialization + template<> class complex<long double> + { + public: + typedef long double value_type; + + complex(long double = 0.0L, long double = 0.0L); +#ifdef _GLIBCPP_BUGGY_COMPLEX + complex(const complex& __z) : _M_value(__z._M_value) { } #endif + complex(const complex<float>&); + complex(const complex<double>&); + + long double real() const; + long double imag() const; + + complex<long double>& operator= (long double); + complex<long double>& operator+= (long double); + complex<long double>& operator-= (long double); + complex<long double>& operator*= (long double); + complex<long double>& operator/= (long double); + + // The compiler knows how to do this efficiently + // complex& operator= (const complex&); + template<typename _Tp> + complex<long double>& operator=(const complex<_Tp>&); + template<typename _Tp> + complex<long double>& operator+=(const complex<_Tp>&); + template<typename _Tp> + complex<long double>& operator-=(const complex<_Tp>&); + template<typename _Tp> + complex<long double>& operator*=(const complex<_Tp>&); + template<typename _Tp> + complex<long double>& operator/=(const complex<_Tp>&); + + private: + typedef __complex__ long double _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex<float>; + friend class complex<double>; + }; + + inline + complex<long double>::complex(long double __r, long double __i) + { + __real__ _M_value = __r; + __imag__ _M_value = __i; + } + + inline long double + complex<long double>::real() const + { return __real__ _M_value; } + + inline long double + complex<long double>::imag() const + { return __imag__ _M_value; } + + inline complex<long double>& + complex<long double>::operator=(long double __r) + { + __real__ _M_value = __r; + __imag__ _M_value = 0.0L; + return *this; + } + + inline complex<long double>& + complex<long double>::operator+=(long double __r) + { + __real__ _M_value += __r; + return *this; + } + + inline complex<long double>& + complex<long double>::operator-=(long double __r) + { + __real__ _M_value -= __r; + return *this; + } + + inline complex<long double>& + complex<long double>::operator*=(long double __r) + { + _M_value *= __r; + return *this; + } + + inline complex<long double>& + complex<long double>::operator/=(long double __r) + { + _M_value /= __r; + return *this; + } + + template<typename _Tp> + inline complex<long double>& + complex<long double>::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<long double>& + complex<long double>::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<long double>& + complex<long double>::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template<typename _Tp> + inline complex<long double>& + complex<long double>::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template<typename _Tp> + inline complex<long double>& + complex<long double>::operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + // These bits have to be at the end of this file, so that the + // specializations have all been defined. + // ??? No, they have to be there because of compiler limitation at + // inlining. It suffices that class specializations be defined. + inline + complex<float>::complex(const complex<double>& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex<float>::complex(const complex<long double>& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex<double>::complex(const complex<float>& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex<double>::complex(const complex<long double>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + } + + inline + complex<long double>::complex(const complex<float>& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex<long double>::complex(const complex<double>& __z) + : _M_value(_ComplexT(__z._M_value)) { } +} // namespace std + +#endif /* _CPP_COMPLEX */ diff --git a/libstdc++-v3/include/std/csetjmp b/libstdc++-v3/include/std/csetjmp deleted file mode 100644 index daf11b3..0000000 --- a/libstdc++-v3/include/std/csetjmp +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file csetjmp - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c setjmp.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSETJMP -#include <bits/std_csetjmp.h> -#endif diff --git a/libstdc++-v3/include/std/csignal b/libstdc++-v3/include/std/csignal deleted file mode 100644 index 3790ff5..0000000 --- a/libstdc++-v3/include/std/csignal +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file csignal - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c signal.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSIGNAL -#include <bits/std_csignal.h> -#endif diff --git a/libstdc++-v3/include/std/cstdarg b/libstdc++-v3/include/std/cstdarg deleted file mode 100644 index 8dfe625..0000000 --- a/libstdc++-v3/include/std/cstdarg +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cstdarg - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdarg.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSTDARG -#include <bits/std_cstdarg.h> -#endif diff --git a/libstdc++-v3/include/std/cstddef b/libstdc++-v3/include/std/cstddef deleted file mode 100644 index 4b3d1f5..0000000 --- a/libstdc++-v3/include/std/cstddef +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cstddef - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stddef.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSTDDEF -#include <bits/std_cstddef.h> -#endif diff --git a/libstdc++-v3/include/std/cstdio b/libstdc++-v3/include/std/cstdio deleted file mode 100644 index b546585..0000000 --- a/libstdc++-v3/include/std/cstdio +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cstdio - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdio.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSTDIO -#include <bits/std_cstdio.h> -#endif diff --git a/libstdc++-v3/include/std/cstdlib b/libstdc++-v3/include/std/cstdlib deleted file mode 100644 index 2feeb53..0000000 --- a/libstdc++-v3/include/std/cstdlib +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cstdlib - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c stdlib.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSTDLIB -#include <bits/std_cstdlib.h> -#endif diff --git a/libstdc++-v3/include/std/cstring b/libstdc++-v3/include/std/cstring deleted file mode 100644 index 5652803..0000000 --- a/libstdc++-v3/include/std/cstring +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cstring - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c string.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CSTRING -#include <bits/std_cstring.h> -#endif diff --git a/libstdc++-v3/include/std/ctime b/libstdc++-v3/include/std/ctime deleted file mode 100644 index e1d6bc9..0000000 --- a/libstdc++-v3/include/std/ctime +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file ctime - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c time.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CTIME -#include <bits/std_ctime.h> -#endif diff --git a/libstdc++-v3/include/std/cwchar b/libstdc++-v3/include/std/cwchar deleted file mode 100644 index aa928d7..0000000 --- a/libstdc++-v3/include/std/cwchar +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cwchar - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c wchar.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CWCHAR -#include <bits/std_cwchar.h> -#endif diff --git a/libstdc++-v3/include/std/cwctype b/libstdc++-v3/include/std/cwctype deleted file mode 100644 index b0de79e..0000000 --- a/libstdc++-v3/include/std/cwctype +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- std header. - -// Copyright (C) 2001 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -/** @file cwctype - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - * - * This is the C++ version of the Standard C Library header @c wctype.h, - * and its contents are (mostly) the same as that header, but are all - * contained in the namespace @c std. - */ - -#ifndef _CPP_CWCTYPE -#include <bits/std_cwctype.h> -#endif diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque index 222d7ca..394eef3 100644 --- a/libstdc++-v3/include/std/deque +++ b/libstdc++-v3/include/std/deque @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <deque> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,51 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file deque - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_deque.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_DEQUE -#include <bits/std_deque.h> -#endif +#define _CPP_DEQUE 1 + +#pragma GCC system_header + +#include <bits/functexcept.h> +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_deque.h> + +#endif /* _CPP_DEQUE */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream index 9d6fcfc..350a691 100644 --- a/libstdc++-v3/include/std/fstream +++ b/libstdc++-v3/include/std/fstream @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// File based streams -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -27,11 +27,408 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file fstream - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.8 File-based streams +// + +/** @file std_fstream.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_FSTREAM -#include <bits/std_fstream.h> +#define _CPP_FSTREAM 1 + +#pragma GCC system_header + +#include <istream> +#include <ostream> +#include <bits/basic_file.h> +#include <locale> // For codecvt +#include <bits/gthr.h> + +namespace std +{ + template<typename _CharT, typename _Traits> + class basic_filebuf : public basic_streambuf<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard Types: + typedef basic_streambuf<char_type, traits_type> __streambuf_type; + typedef basic_filebuf<char_type, traits_type> __filebuf_type; + typedef __basic_file<char_type> __file_type; + typedef typename traits_type::state_type __state_type; + typedef codecvt<char_type, char, __state_type> __codecvt_type; + typedef typename __codecvt_type::result __res_type; + typedef ctype<char_type> __ctype_type; + + friend class ios_base; // For sync_with_stdio. + + private: + // Data Members: + // External buffer. + __file_type* _M_file; + + // Current and beginning state type for codecvt. + __state_type _M_state_cur; + __state_type _M_state_beg; + + // MT lock inherited from libio or other low-level io library. + __c_lock _M_lock; + + // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer.. + bool _M_buf_allocated; + + // XXX Needed? + bool _M_last_overflowed; + + public: + // Constructors/destructor: + basic_filebuf(); + + // Non-standard ctor: + basic_filebuf(__c_file_type* __f, ios_base::openmode __mode, + int_type __s = static_cast<int_type>(BUFSIZ)); + + // Non-standard member: + int + fd(); + + virtual + ~basic_filebuf() + { + this->close(); + _M_last_overflowed = false; + } + + // Members: + bool + is_open(void) const { return _M_file ? _M_file->is_open() : false; } + + __filebuf_type* + open(const char* __s, ios_base::openmode __mode); + + __filebuf_type* + close(void); + + protected: + void + _M_allocate_internal_buffer(); + + void + _M_destroy_internal_buffer(); + + void + _M_allocate_pback_buffer(); + + // Create __file_type object and initialize it properly. + void + _M_allocate_file(); + + // Overridden virtual functions: + virtual streamsize + showmanyc(void); + + // Stroustrup, 1998, p. 628 + // underflow() and uflow() functions are called to get the next + // charater from the real input source when the buffer is empty. + // Buffered input uses underflow() + virtual int_type + underflow(void); + + virtual int_type + pbackfail(int_type __c = _Traits::eof()); + + // NB: For what the standard expects of the overflow function, + // see _M_really_overflow(), below. Because basic_streambuf's + // sputc/sputn call overflow directly, and the complications of + // this implementation's setting of the initial pointers all + // equal to _M_buf when initializing, it seems essential to have + // this in actuality be a helper function that checks for the + // eccentricities of this implementation, and then call + // overflow() if indeed the buffer is full. + virtual int_type + overflow(int_type __c = _Traits::eof()); + + // Stroustrup, 1998, p 648 + // The overflow() function is called to transfer characters to the + // real output destination when the buffer is full. A call to + // overflow(c) outputs the contents of the buffer plus the + // character c. + // 27.5.2.4.5 + // Consume some sequence of the characters in the pending sequence. + int_type + _M_really_overflow(int_type __c = _Traits::eof()); + + virtual __streambuf_type* + setbuf(char_type* __s, streamsize __n); + + virtual pos_type + seekoff(off_type __off, ios_base::seekdir __way, + ios_base::openmode __mode = ios_base::in | ios_base::out); + + virtual pos_type + seekpos(pos_type __pos, + ios_base::openmode __mode = ios_base::in | ios_base::out); + + virtual int + sync(void) + { + bool __testput = _M_out_cur && _M_out_beg < _M_out_end; + if (__testput) + { + // Make sure that libio resyncs its idea of the file position + // with the external file. + _M_file->sync(); + + // Need to restore current position. This interpreted as + // the position of the external byte sequence (_M_file) + // plus the offset in the current internal buffer + // (_M_out_beg - _M_out_cur) + streamoff __cur = _M_file->seekoff(0, ios_base::cur); + off_type __off = _M_out_cur - _M_out_beg; + _M_really_overflow(); + _M_file->seekpos(__cur + __off); + } + _M_last_overflowed = false; + return 0; + } + + virtual void + imbue(const locale& __loc); + + virtual streamsize + xsgetn(char_type* __s, streamsize __n) + { + streamsize __ret = 0; + // Clear out pback buffer before going on to the real deal... + if (_M_pback_init) + { + while (__ret < __n && _M_in_cur < _M_in_end) + { + *__s = *_M_in_cur; + ++__ret; + ++__s; + ++_M_in_cur; + } + _M_pback_destroy(); + } + if (__ret < __n) + __ret += __streambuf_type::xsgetn(__s, __n - __ret); + return __ret; + } + + virtual streamsize + xsputn(const char_type* __s, streamsize __n) + { + _M_pback_destroy(); + return __streambuf_type::xsputn(__s, __n); + } + + void + _M_output_unshift(); + }; + + + // 27.8.1.5 Template class basic_ifstream + template<typename _CharT, typename _Traits> + class basic_ifstream : public basic_istream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard types: + typedef basic_filebuf<char_type, traits_type> __filebuf_type; + typedef basic_istream<char_type, traits_type> __istream_type; + + private: + __filebuf_type _M_filebuf; + + public: + // Constructors/Destructors: + basic_ifstream() + : __istream_type(NULL), _M_filebuf() + { this->init(&_M_filebuf); } + + explicit + basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in) + : __istream_type(NULL), _M_filebuf() + { + this->init(&_M_filebuf); + this->open(__s, __mode); + } + + ~basic_ifstream() + { } + + // Members: + __filebuf_type* + rdbuf() const + { return const_cast<__filebuf_type*>(&_M_filebuf); } + + bool + is_open(void) { return _M_filebuf.is_open(); } + + void + open(const char* __s, ios_base::openmode __mode = ios_base::in) + { + if (_M_filebuf.open(__s, __mode | ios_base::in) == NULL) + this->setstate(ios_base::failbit); + } + + void + close(void) + { + if (!_M_filebuf.close()) + this->setstate(ios_base::failbit); + } + }; + + + // 27.8.1.8 Template class basic_ofstream + template<typename _CharT, typename _Traits> + class basic_ofstream : public basic_ostream<_CharT,_Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard types: + typedef basic_filebuf<char_type, traits_type> __filebuf_type; + typedef basic_ostream<char_type, traits_type> __ostream_type; + + private: + __filebuf_type _M_filebuf; + + public: + // Constructors: + basic_ofstream() + : __ostream_type(NULL), _M_filebuf() + { this->init(&_M_filebuf); } + + explicit + basic_ofstream(const char* __s, + ios_base::openmode __mode = ios_base::out|ios_base::trunc) + : __ostream_type(NULL), _M_filebuf() + { + this->init(&_M_filebuf); + this->open(__s, __mode); + } + + ~basic_ofstream() + { } + + // Members: + __filebuf_type* + rdbuf(void) const + { return const_cast<__filebuf_type*>(&_M_filebuf); } + + bool + is_open(void) { return _M_filebuf.is_open(); } + + void + open(const char* __s, + ios_base::openmode __mode = ios_base::out | ios_base::trunc) + { + if (!_M_filebuf.open(__s, __mode | ios_base::out)) + this->setstate(ios_base::failbit); + } + + void + close(void) + { + if (!_M_filebuf.close()) + setstate(ios_base::failbit); + } + }; + + + // 27.8.1.11 Template class basic_fstream + template<typename _CharT, typename _Traits> + class basic_fstream : public basic_iostream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard types: + typedef basic_filebuf<char_type, traits_type> __filebuf_type; + typedef basic_ios<char_type, traits_type> __ios_type; + typedef basic_iostream<char_type, traits_type> __iostream_type; + + private: + __filebuf_type _M_filebuf; + + public: + // Constructors/destructor: + basic_fstream() + : __iostream_type(NULL), _M_filebuf() + { this->init(&_M_filebuf); } + + explicit + basic_fstream(const char* __s, + ios_base::openmode __mode = ios_base::in | ios_base::out) + : __iostream_type(NULL), _M_filebuf() + { + this->init(&_M_filebuf); + this->open(__s, __mode); + } + + ~basic_fstream() + { } + + // Members: + __filebuf_type* + rdbuf(void) const + { return const_cast<__filebuf_type*>(&_M_filebuf); } + + bool + is_open(void) { return _M_filebuf.is_open(); } + + void + open(const char* __s, + ios_base::openmode __mode = ios_base::in | ios_base::out) + { + if (!_M_filebuf.open(__s, __mode)) + setstate(ios_base::failbit); + } + + void + close(void) + { + if (!_M_filebuf.close()) + setstate(ios_base::failbit); + } + }; +} // namespace std + + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# define export +#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS +# include <bits/fstream.tcc> #endif +#endif + +#endif + diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 10c5525..16702ca 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <functional> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,36 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file functional - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * Copyright (c) 1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +/** @file std_functional.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_FUNCTIONAL -#include <bits/std_functional.h> -#endif +#define _CPP_FUNCTIONAL 1 + +#pragma GCC system_header +#include <bits/c++config.h> +#include <cstddef> +#include <bits/stl_function.h> + +#endif /* _CPP_FUNCTIONAL */ + +// Local Variables: +// mode:C++ +// End: + diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip index 5659918..ab279d2 100644 --- a/libstdc++-v3/include/std/iomanip +++ b/libstdc++-v3/include/std/iomanip @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Standard stream manipulators -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2001 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 @@ -27,11 +27,195 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file iomanip - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.6.3 Standard manipulators +// + +/** @file std_iomanip.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_IOMANIP -#include <bits/std_iomanip.h> -#endif +#define _CPP_IOMANIP 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <istream> +#include <functional> + +namespace std +{ + + struct _Resetiosflags { ios_base::fmtflags _M_mask; }; + + inline _Resetiosflags + resetiosflags(ios_base::fmtflags __mask) + { + _Resetiosflags __x; + __x._M_mask = __mask; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) + { + __is.setf(ios_base::fmtflags(0), __f._M_mask); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f) + { + __os.setf(ios_base::fmtflags(0), __f._M_mask); + return __os; + } + + + struct _Setiosflags { ios_base::fmtflags _M_mask; }; + + inline _Setiosflags + setiosflags(ios_base::fmtflags __mask) + { + _Setiosflags __x; + __x._M_mask = __mask; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) + { + __is.setf(__f._M_mask); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f) + { + __os.setf(__f._M_mask); + return __os; + } + + + struct _Setbase { int _M_base; }; + + inline _Setbase + setbase(int __base) + { + _Setbase __x; + __x._M_base = __base; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f) + { + __is.setf(__f._M_base == 8 ? ios_base::oct : + __f._M_base == 10 ? ios_base::dec : + __f._M_base == 16 ? ios_base::hex : + ios_base::fmtflags(0), ios_base::basefield); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f) + { + __os.setf(__f._M_base == 8 ? ios_base::oct : + __f._M_base == 10 ? ios_base::dec : + __f._M_base == 16 ? ios_base::hex : + ios_base::fmtflags(0), ios_base::basefield); + return __os; + } + + + template<class _CharT> + struct _Setfill { _CharT _M_c; }; + + template<class _CharT> + _Setfill<_CharT> + setfill(_CharT __c) + { + _Setfill<_CharT> __x; + __x._M_c = __c; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) + { + __is.fill(__f._M_c); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f) + { + __os.fill(__f._M_c); + return __os; + } + + + struct _Setprecision { int _M_n; }; + + inline _Setprecision + setprecision(int __n) + { + _Setprecision __x; + __x._M_n = __n; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) + { + __is.precision(__f._M_n); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f) + { + __os.precision(__f._M_n); + return __os; + } + + + struct _Setw { int _M_n; }; + + inline _Setw + setw(int __n) + { + _Setw __x; + __x._M_n = __n; + return __x; + } + + template <class _CharT, class _Traits> + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) + { + __is.width(__f._M_n); + return __is; + } + + template <class _CharT, class _Traits> + basic_ostream<_CharT,_Traits>& + operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f) + { + __os.width(__f._M_n); + return __os; + } +} // namespace std + +#endif diff --git a/libstdc++-v3/include/std/ios b/libstdc++-v3/include/std/ios index a017dd8..1e61c36 100644 --- a/libstdc++-v3/include/std/ios +++ b/libstdc++-v3/include/std/ios @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Iostreams base classes -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2001 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 @@ -27,11 +27,28 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file ios - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.4 Iostreams base classes +// + +/** @file std_ios.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_IOS -#include <bits/std_ios.h> -#endif +#define _CPP_IOS 1 + +#pragma GCC system_header + +#include <iosfwd> +#include <exception> // For ios_base::failure +#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos +#include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END +#include <bits/localefwd.h> // For class locale +#include <bits/ios_base.h> // For ios_base declarations. +#include <streambuf> +#include <bits/basic_ios.h> + +#endif /* _CPP_IOS */ + diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd index e48516a..93c30b3 100644 --- a/libstdc++-v3/include/std/iosfwd +++ b/libstdc++-v3/include/std/iosfwd @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Forwarding declarations -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2001 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 @@ -27,11 +27,110 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file iosfwd - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.2 Forward declarations +// + +/** @file std_iosfwd.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_IOSFWD -#include <bits/std_iosfwd.h> +#define _CPP_IOSFWD 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <bits/stringfwd.h> // For string forward declarations. +#include <bits/fpos.h> +#include <bits/functexcept.h> + +namespace std +{ + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ios; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_streambuf; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_istream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ostream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_iostream; + + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_stringbuf; + + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_istringstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_ostringstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_stringstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_filebuf; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ifstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ofstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_fstream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class istreambuf_iterator; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class ostreambuf_iterator; + +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS + // Not included. (??? Apparently no LWG number?) + class ios_base; +#endif + + typedef basic_ios<char> ios; + typedef basic_streambuf<char> streambuf; + typedef basic_istream<char> istream; + typedef basic_ostream<char> ostream; + typedef basic_iostream<char> iostream; + typedef basic_stringbuf<char> stringbuf; + typedef basic_istringstream<char> istringstream; + typedef basic_ostringstream<char> ostringstream; + typedef basic_stringstream<char> stringstream; + typedef basic_filebuf<char> filebuf; + typedef basic_ifstream<char> ifstream; + typedef basic_ofstream<char> ofstream; + typedef basic_fstream<char> fstream; + +#ifdef _GLIBCPP_USE_WCHAR_T + typedef basic_ios<wchar_t> wios; + typedef basic_streambuf<wchar_t> wstreambuf; + typedef basic_istream<wchar_t> wistream; + typedef basic_ostream<wchar_t> wostream; + typedef basic_iostream<wchar_t> wiostream; + typedef basic_stringbuf<wchar_t> wstringbuf; + typedef basic_istringstream<wchar_t> wistringstream; + typedef basic_ostringstream<wchar_t> wostringstream; + typedef basic_stringstream<wchar_t> wstringstream; + typedef basic_filebuf<wchar_t> wfilebuf; + typedef basic_ifstream<wchar_t> wifstream; + typedef basic_ofstream<wchar_t> wofstream; + typedef basic_fstream<wchar_t> wfstream; +#endif +} // namespace std + #endif diff --git a/libstdc++-v3/include/std/iostream b/libstdc++-v3/include/std/iostream index a8098c6..47b8379 100644 --- a/libstdc++-v3/include/std/iostream +++ b/libstdc++-v3/include/std/iostream @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Standard iostream objects -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2001 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 @@ -27,13 +27,39 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file iostream - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.3 Standard iostream objects +// + +/** @file std_iostream.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_IOSTREAM -#include <bits/std_iostream.h> +#define _CPP_IOSTREAM 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <ostream> +#include <istream> + +namespace std +{ + extern istream cin; + extern ostream cout; + extern ostream cerr; + extern ostream clog; +#ifdef _GLIBCPP_USE_WCHAR_T + extern wistream wcin; + extern wostream wcout; + extern wostream wcerr; + extern wostream wclog; #endif + // For construction of filebuffers for cout, cin, cerr, clog et. al. + static ios_base::Init __ioinit; +} // namespace std +#endif diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index c383506..7b51852 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Input streams -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2001 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 @@ -27,11 +27,273 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file istream - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.6.1 Input streams +// + +/** @file std_istream.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_ISTREAM -#include <bits/std_istream.h> +#define _CPP_ISTREAM 1 + +#pragma GCC system_header + +#include <ios> +#include <limits> // For numeric_limits + +namespace std +{ + // 27.6.1.1 Template class basic_istream + template<typename _CharT, typename _Traits> + class basic_istream : virtual public basic_ios<_CharT, _Traits> + { + public: + // Types (inherited from basic_ios (27.4.4)): + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + // Non-standard Types: + typedef basic_streambuf<_CharT, _Traits> __streambuf_type; + typedef basic_ios<_CharT, _Traits> __ios_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter; + typedef num_get<_CharT, __istreambuf_iter> __numget_type; + typedef ctype<_CharT> __ctype_type; + + protected: + // Data Members: + streamsize _M_gcount; + + public: + // 27.6.1.1.1 Constructor/destructor: + explicit + basic_istream(__streambuf_type* __sb) + { + this->init(__sb); + _M_gcount = streamsize(0); + } + + virtual + ~basic_istream() + { _M_gcount = streamsize(0); } + + // 27.6.1.1.2 Prefix/suffix: + class sentry; + friend class sentry; + + // 27.6.1.2 Formatted input: + // 27.6.1.2.3 basic_istream::operator>> + __istream_type& + operator>>(__istream_type& (*__pf)(__istream_type&)); + + __istream_type& + operator>>(__ios_type& (*__pf)(__ios_type&)); + + __istream_type& + operator>>(ios_base& (*__pf)(ios_base&)); + + // 27.6.1.2.2 Arithmetic Extractors + __istream_type& + operator>>(bool& __n); + + __istream_type& + operator>>(short& __n); + + __istream_type& + operator>>(unsigned short& __n); + + __istream_type& + operator>>(int& __n); + + __istream_type& + operator>>(unsigned int& __n); + + __istream_type& + operator>>(long& __n); + + __istream_type& + operator>>(unsigned long& __n); + +#ifdef _GLIBCPP_USE_LONG_LONG + __istream_type& + operator>>(long long& __n); + + __istream_type& + operator>>(unsigned long long& __n); #endif + + __istream_type& + operator>>(float& __f); + + __istream_type& + operator>>(double& __f); + + __istream_type& + operator>>(long double& __f); + + __istream_type& + operator>>(void*& __p); + + __istream_type& + operator>>(__streambuf_type* __sb); + + // 27.6.1.3 Unformatted input: + inline streamsize + gcount(void) const + { return _M_gcount; } + + int_type + get(void); + + __istream_type& + get(char_type& __c); + + __istream_type& + get(char_type* __s, streamsize __n, char_type __delim); + + inline __istream_type& + get(char_type* __s, streamsize __n) + { return this->get(__s, __n, this->widen('\n')); } + + __istream_type& + get(__streambuf_type& __sb, char_type __delim); + + inline __istream_type& + get(__streambuf_type& __sb) + { return this->get(__sb, this->widen('\n')); } + + __istream_type& + getline(char_type* __s, streamsize __n, char_type __delim); + + inline __istream_type& + getline(char_type* __s, streamsize __n) + { return this->getline(__s, __n, this->widen('\n')); } + + __istream_type& + ignore(streamsize __n = 1, int_type __delim = traits_type::eof()); + + int_type + peek(void); + + __istream_type& + read(char_type* __s, streamsize __n); + + streamsize + readsome(char_type* __s, streamsize __n); + + __istream_type& + putback(char_type __c); + + __istream_type& + unget(void); + + int + sync(void); + + pos_type + tellg(void); + + __istream_type& + seekg(pos_type); + + __istream_type& + seekg(off_type, ios_base::seekdir); + + private: +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS + // Not defined. (Side effect of DR 50.) + __istream_type& + operator=(const __istream_type&); + + basic_istream(const __istream_type&); +#endif + }; + + template<typename _CharT, typename _Traits> + class basic_istream<_CharT, _Traits>::sentry + { + public: + typedef _Traits traits_type; + typedef basic_streambuf<_CharT, _Traits> __streambuf_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + typedef typename __istream_type::__ctype_type __ctype_type; + typedef typename _Traits::int_type __int_type; + + explicit + sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false); + + operator bool() { return _M_ok; } + + private: + bool _M_ok; + }; + + // 27.6.1.2.3 Character extraction templates + template<typename _CharT, typename _Traits> + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); + + template<class _Traits> + basic_istream<char, _Traits>& + operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) + { return (__in >> reinterpret_cast<char&>(__c)); } + + template<class _Traits> + basic_istream<char, _Traits>& + operator>>(basic_istream<char, _Traits>& __in, signed char& __c) + { return (__in >> reinterpret_cast<char&>(__c)); } + + template<typename _CharT, typename _Traits> + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); + + template<class _Traits> + basic_istream<char,_Traits>& + operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s) + { return (__in >> reinterpret_cast<char*>(__s)); } + + template<class _Traits> + basic_istream<char,_Traits>& + operator>>(basic_istream<char,_Traits>& __in, signed char* __s) + { return (__in >> reinterpret_cast<char*>(__s)); } + + // 27.6.1.5 Template class basic_iostream + template<typename _CharT, typename _Traits> + class basic_iostream + : public basic_istream<_CharT, _Traits>, + public basic_ostream<_CharT, _Traits> + { + public: + // Non-standard Types: + typedef basic_istream<_CharT, _Traits> __istream_type; + typedef basic_ostream<_CharT, _Traits> __ostream_type; + + explicit + basic_iostream(basic_streambuf<_CharT, _Traits>* __sb) + : __istream_type(__sb), __ostream_type(__sb) + { } + + virtual + ~basic_iostream() { } + }; + + // 27.6.1.4 Standard basic_istream manipulators + template<typename _CharT, typename _Traits> + basic_istream<_CharT, _Traits>& + ws(basic_istream<_CharT, _Traits>& __is); +} // namespace std + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# define export +#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS +# include <bits/istream.tcc> +#endif +#endif + +#endif /* _CPP_ISTREAM */ diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator index 6e42f56..f0eee11 100644 --- a/libstdc++-v3/include/std/iterator +++ b/libstdc++-v3/include/std/iterator @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <iterator> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,53 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file iterator - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_iterator.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_ITERATOR -#include <bits/std_iterator.h> -#endif +#define _CPP_ITERATOR 1 + +#pragma GCC system_header +#include <bits/c++config.h> +#include <cstddef> +#include <bits/stl_iterator_base_types.h> +#include <bits/stl_iterator_base_funcs.h> +#include <bits/stl_iterator.h> +#include <ostream> +#include <istream> +#include <bits/stream_iterator.h> +#include <bits/streambuf_iterator.h> + +#endif /* _CPP_ITERATOR */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index ea55c7f..7a64636 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// The template and inlines for the -*- C++ -*- numeric_limits classes. -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1999-2001 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 @@ -27,11 +27,1991 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file limits - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// Note: this is not a conforming implementation. +// Written by Gabriel Dos Reis <gdr@codesourcery.com> + +// +// ISO 14882:1998 +// 18.2.1 +// + +/** @file std_limits.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ -#ifndef _CPP_LIMITS -#include <bits/std_limits.h> +#ifndef _CPP_NUMERIC_LIMITS +#define _CPP_NUMERIC_LIMITS 1 + +#pragma GCC system_header + +#include <bits/cpu_limits.h> +#include <bits/c++config.h> + +// +// The numeric_limits<> traits document implementation-defined aspects +// of fundamental arithmetic data types (integers and floating points). +// From Standard C++ point of view, there are 13 such types: +// * integers +// bool (1) +// char, signed char, unsigned char (3) +// short, unsigned short (2) +// int, unsigned (2) +// long, unsigned long (2) +// +// * floating points +// float (1) +// double (1) +// long double (1) +// +// GNU C++ undertstands (where supported by the host C-library) +// * integer +// long long, unsigned long long (2) +// +// which brings us to 15 fundamental arithmetic data types in GNU C++. +// +// +// Since a numeric_limits<> is a bit tricky to get right, we rely on +// an interface composed of macros which should be defined in config/os +// or config/cpu when they differ from the generic (read arbitrary) +// definitions given here. +// + +// These values can be overridden in the target configuration file. +// The default values are appropriate for many 32-bit targets. + +#ifndef __glibcpp_char_bits +#define __glibcpp_char_bits 8 +#endif +#ifdef __CHAR_UNSIGNED__ +#define __glibcpp_plain_char_is_signed false +#else +#define __glibcpp_plain_char_is_signed true +#endif +#ifndef __glibcpp_short_bits +#define __glibcpp_short_bits 16 +#endif +#ifndef __glibcpp_int_bits +#define __glibcpp_int_bits 32 +#endif +#ifndef __glibcpp_long_bits +#define __glibcpp_long_bits 32 +#endif +#ifndef __glibcpp_wchar_t_bits +#define __glibcpp_wchar_t_bits 32 +#endif +#ifndef __glibcpp_wchar_t_is_signed +#define __glibcpp_wchar_t_is_signed true +#endif +#ifndef __glibcpp_long_long_bits +#define __glibcpp_long_long_bits 64 +#endif +#ifndef __glibcpp_float_bits +#define __glibcpp_float_bits 32 +#endif +#ifndef __glibcpp_double_bits +#define __glibcpp_double_bits 64 +#endif +#ifndef __glibcpp_long_double_bits +#define __glibcpp_long_double_bits 128 +#endif + +#ifndef __glibcpp_char_traps +#define __glibcpp_char_traps true +#endif +#ifndef __glibcpp_short_traps +#define __glibcpp_short_traps true +#endif +#ifndef __glibcpp_int_traps +#define __glibcpp_int_traps true +#endif +#ifndef __glibcpp_long_traps +#define __glibcpp_long_traps true +#endif +#ifndef __glibcpp_wchar_t_traps +#define __glibcpp_wchar_t_traps true +#endif +#ifndef __glibcpp_long_long_traps +#define __glibcpp_long_long_traps true +#endif + +// You should not need to define any macros below this point, unless +// you have a machine with non-standard bit-widths. + +// These values are the minimums and maximums for standard data types +// of common widths. + +#define __glibcpp_s8_max 127 +#define __glibcpp_s8_min (-__glibcpp_s8_max - 1) +#define __glibcpp_s8_digits 7 +#define __glibcpp_s8_digits10 2 +#define __glibcpp_u8_min 0U +#define __glibcpp_u8_max (__glibcpp_s8_max * 2 + 1) +#define __glibcpp_u8_digits 8 +#define __glibcpp_u8_digits10 2 +#define __glibcpp_s16_max 32767 +#define __glibcpp_s16_min (-__glibcpp_s16_max - 1) +#define __glibcpp_s16_digits 15 +#define __glibcpp_s16_digits10 4 +#define __glibcpp_u16_min 0U +#define __glibcpp_u16_max (__glibcpp_s16_max * 2 + 1) +#define __glibcpp_u16_digits 16 +#define __glibcpp_u16_digits10 4 +#define __glibcpp_s32_max 2147483647L +#define __glibcpp_s32_min (-__glibcpp_s32_max - 1) +#define __glibcpp_s32_digits 31 +#define __glibcpp_s32_digits10 9 +#define __glibcpp_u32_min 0UL +#define __glibcpp_u32_max (__glibcpp_s32_max * 2U + 1) +#define __glibcpp_u32_digits 32 +#define __glibcpp_u32_digits10 9 +#define __glibcpp_s64_max 9223372036854775807LL +#define __glibcpp_s64_min (-__glibcpp_s64_max - 1) +#define __glibcpp_s64_digits 63 +#define __glibcpp_s64_digits10 18 +#define __glibcpp_u64_min 0ULL +#define __glibcpp_u64_max (__glibcpp_s64_max * 2ULL + 1) +#define __glibcpp_u64_digits 64 +#define __glibcpp_u64_digits10 19 + +#define __glibcpp_f32_min 1.17549435e-38F +#define __glibcpp_f32_max 3.40282347e+38F +#define __glibcpp_f32_digits 24 +#define __glibcpp_f32_digits10 6 +#define __glibcpp_f32_radix 2 +#define __glibcpp_f32_epsilon 1.19209290e-07F +#define __glibcpp_f32_round_error 1.0F +#define __glibcpp_f32_min_exponent -125 +#define __glibcpp_f32_min_exponent10 -37 +#define __glibcpp_f32_max_exponent 128 +#define __glibcpp_f32_max_exponent10 38 +#define __glibcpp_f64_min 2.2250738585072014e-308 +#define __glibcpp_f64_max 1.7976931348623157e+308 +#define __glibcpp_f64_digits 53 +#define __glibcpp_f64_digits10 15 +#define __glibcpp_f64_radix 2 +#define __glibcpp_f64_epsilon 2.2204460492503131e-16 +#define __glibcpp_f64_round_error 1.0 +#define __glibcpp_f64_min_exponent -1021 +#define __glibcpp_f64_min_exponent10 -307 +#define __glibcpp_f64_max_exponent 1024 +#define __glibcpp_f64_max_exponent10 308 +#define __glibcpp_f80_min 3.36210314311209350626e-4932L +#define __glibcpp_f80_max 1.18973149535723176502e+4932L +#define __glibcpp_f80_digits 64 +#define __glibcpp_f80_digits10 18 +#define __glibcpp_f80_radix 2 +#define __glibcpp_f80_epsilon 1.08420217248550443401e-19L +#define __glibcpp_f80_round_error 1.0L +#define __glibcpp_f80_min_exponent -16381 +#define __glibcpp_f80_min_exponent10 -4931 +#define __glibcpp_f80_max_exponent 16384 +#define __glibcpp_f80_max_exponent10 4932 +#define __glibcpp_f96_min 1.68105157155604675313e-4932L +#define __glibcpp_f96_max 1.18973149535723176502e+4932L +#define __glibcpp_f96_digits 64 +#define __glibcpp_f96_digits10 18 +#define __glibcpp_f96_radix 2 +#define __glibcpp_f96_epsilon 1.08420217248550443401e-19L +#define __glibcpp_f96_round_error 1.0L +#define __glibcpp_f96_min_exponent -16382 +#define __glibcpp_f96_min_exponent10 -4931 +#define __glibcpp_f96_max_exponent 16384 +#define __glibcpp_f96_max_exponent10 4932 +#define __glibcpp_f128_min 3.362103143112093506262677817321752603E-4932L +#define __glibcpp_f128_max 1.189731495357231765085759326628007016E+4932L +#define __glibcpp_f128_digits 113 +#define __glibcpp_f128_digits10 33 +#define __glibcpp_f128_radix 2 +#define __glibcpp_f128_epsilon 1.925929944387235853055977942584927319E-34L +#define __glibcpp_f128_round_error 1.0L +#define __glibcpp_f128_min_exponent -16381 +#define __glibcpp_f128_min_exponent10 -4931 +#define __glibcpp_f128_max_exponent 16384 +#define __glibcpp_f128_max_exponent10 4932 + +// bool-specific hooks: +// __glibcpp_bool_digits __glibcpp_int_traps __glibcpp_long_traps + +// This is actually CHAR_BITS because the new ABI says a bool +// is one (1) byte wide. + +#ifndef __glibcpp_bool_digits +#define __glibcpp_bool_digits __glibcpp_char_bits +#endif + +// char. + +#define __glibcpp_plain_char_traps true +#define __glibcpp_signed_char_traps true +#define __glibcpp_unsigned_char_traps true +#ifndef __glibcpp_char_is_modulo +#define __glibcpp_char_is_modulo true +#endif +#ifndef __glibcpp_signed_char_is_modulo +#define __glibcpp_signed_char_is_modulo true +#endif +#if __glibcpp_char_bits == 8 +#define __glibcpp_signed_char_min __glibcpp_s8_min +#define __glibcpp_signed_char_max __glibcpp_s8_max +#define __glibcpp_signed_char_digits __glibcpp_s8_digits +#define __glibcpp_signed_char_digits10 __glibcpp_s8_digits10 +#define __glibcpp_unsigned_char_min __glibcpp_u8_min +#define __glibcpp_unsigned_char_max __glibcpp_u8_max +#define __glibcpp_unsigned_char_digits __glibcpp_u8_digits +#define __glibcpp_unsigned_char_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_char_bits == 16 +#define __glibcpp_signed_char_min __glibcpp_s16_min +#define __glibcpp_signed_char_max __glibcpp_s16_max +#define __glibcpp_signed_char_digits __glibcpp_s16_digits +#define __glibcpp_signed_char_digits10 __glibcpp_s16_digits10 +#define __glibcpp_unsigned_char_min __glibcpp_u16_min +#define __glibcpp_unsigned_char_max __glibcpp_u16_max +#define __glibcpp_unsigned_char_digits __glibcpp_u16_digits +#define __glibcpp_unsigned_char_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_char_bits == 32 +#define __glibcpp_signed_char_min (signed char)__glibcpp_s32_min +#define __glibcpp_signed_char_max (signed char)__glibcpp_s32_max +#define __glibcpp_signed_char_digits __glibcpp_s32_digits +#define __glibcpp_signed_char_digits10 __glibcpp_s32_digits10 +#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u32_min +#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u32_max +#define __glibcpp_unsigned_char_digits __glibcpp_u32_digits +#define __glibcpp_unsigned_char_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_char_bits == 64 +#define __glibcpp_signed_char_min (signed char)__glibcpp_s64_min +#define __glibcpp_signed_char_max (signed char)__glibcpp_s64_max +#define __glibcpp_signed_char_digits __glibcpp_s64_digits +#define __glibcpp_signed_char_digits10 __glibcpp_s64_digits10 +#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u64_min +#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u64_max +#define __glibcpp_unsigned_char_digits __glibcpp_u64_digits +#define __glibcpp_unsigned_char_digits10 __glibcpp_u64_digits10 +#else +// You must define these macros in the configuration file. +#endif + +#if __glibcpp_plain_char_is_signed +#define __glibcpp_char_min (char)__glibcpp_signed_char_min +#define __glibcpp_char_max (char)__glibcpp_signed_char_max +#define __glibcpp_char_digits __glibcpp_signed_char_digits +#define __glibcpp_char_digits10 __glibcpp_signed_char_digits +#else +#define __glibcpp_char_min (char)__glibcpp_unsigned_char_min +#define __glibcpp_char_max (char)__glibcpp_unsigned_char_max +#define __glibcpp_char_digits __glibcpp_unsigned_char_digits +#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits +#endif + +// short + +#define __glibcpp_signed_short_traps true +#define __glibcpp_unsigned_short_traps true +#ifndef __glibcpp_signed_short_is_modulo +#define __glibcpp_signed_short_is_modulo true +#endif +#if __glibcpp_short_bits == 8 +#define __glibcpp_signed_short_min __glibcpp_s8_min +#define __glibcpp_signed_short_max __glibcpp_s8_max +#define __glibcpp_signed_short_digits __glibcpp_s8_digits +#define __glibcpp_signed_short_digits10 __glibcpp_s8_digits10 +#define __glibcpp_unsigned_short_min __glibcpp_u8_min +#define __glibcpp_unsigned_short_max __glibcpp_u8_max +#define __glibcpp_unsigned_short_digits __glibcpp_u8_digits +#define __glibcpp_unsigned_short_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_short_bits == 16 +#define __glibcpp_signed_short_min __glibcpp_s16_min +#define __glibcpp_signed_short_max __glibcpp_s16_max +#define __glibcpp_signed_short_digits __glibcpp_s16_digits +#define __glibcpp_signed_short_digits10 __glibcpp_s16_digits10 +#define __glibcpp_unsigned_short_min __glibcpp_u16_min +#define __glibcpp_unsigned_short_max __glibcpp_u16_max +#define __glibcpp_unsigned_short_digits __glibcpp_u16_digits +#define __glibcpp_unsigned_short_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_short_bits == 32 +#define __glibcpp_signed_short_min (short)__glibcpp_s32_min +#define __glibcpp_signed_short_max (short)__glibcpp_s32_max +#define __glibcpp_signed_short_digits __glibcpp_s32_digits +#define __glibcpp_signed_short_digits10 __glibcpp_s32_digits10 +#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u32_min +#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u32_max +#define __glibcpp_unsigned_short_digits __glibcpp_u32_digits +#define __glibcpp_unsigned_short_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_short_bits == 64 +#define __glibcpp_signed_short_min (short)__glibcpp_s64_min +#define __glibcpp_signed_short_max (short)__glibcpp_s64_max +#define __glibcpp_signed_short_digits __glibcpp_s64_digits +#define __glibcpp_signed_short_digits10 __glibcpp_s64_digits10 +#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u64_min +#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u64_max +#define __glibcpp_unsigned_short_digits __glibcpp_u64_digits +#define __glibcpp_unsigned_short_digits10 __glibcpp_u64_digits10 +#else +// You must define these macros in the configuration file. +#endif + +// int + +#define __glibcpp_signed_int_traps true +#define __glibcpp_unsigned_int_traps true +#ifndef __glibcpp_signed_int_is_modulo +#define __glibcpp_signed_int_is_modulo true +#endif +#if __glibcpp_int_bits == 8 +#define __glibcpp_signed_int_min __glibcpp_s8_min +#define __glibcpp_signed_int_max __glibcpp_s8_max +#define __glibcpp_signed_int_digits __glibcpp_s8_digits +#define __glibcpp_signed_int_digits10 __glibcpp_s8_digits10 +#define __glibcpp_unsigned_int_min __glibcpp_u8_min +#define __glibcpp_unsigned_int_max __glibcpp_u8_max +#define __glibcpp_unsigned_int_digits __glibcpp_u8_digits +#define __glibcpp_unsigned_int_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_int_bits == 16 +#define __glibcpp_signed_int_min __glibcpp_s16_min +#define __glibcpp_signed_int_max __glibcpp_s16_max +#define __glibcpp_signed_int_digits __glibcpp_s16_digits +#define __glibcpp_signed_int_digits10 __glibcpp_s16_digits10 +#define __glibcpp_unsigned_int_min __glibcpp_u16_min +#define __glibcpp_unsigned_int_max __glibcpp_u16_max +#define __glibcpp_unsigned_int_digits __glibcpp_u16_digits +#define __glibcpp_unsigned_int_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_int_bits == 32 +#define __glibcpp_signed_int_min (int)__glibcpp_s32_min +#define __glibcpp_signed_int_max (int)__glibcpp_s32_max +#define __glibcpp_signed_int_digits __glibcpp_s32_digits +#define __glibcpp_signed_int_digits10 __glibcpp_s32_digits10 +#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u32_min +#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u32_max +#define __glibcpp_unsigned_int_digits __glibcpp_u32_digits +#define __glibcpp_unsigned_int_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_int_bits == 64 +#define __glibcpp_signed_int_min (int)__glibcpp_s64_min +#define __glibcpp_signed_int_max (int)__glibcpp_s64_max +#define __glibcpp_signed_int_digits __glibcpp_s64_digits +#define __glibcpp_signed_int_digits10 __glibcpp_s64_digits10 +#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u64_min +#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u64_max +#define __glibcpp_unsigned_int_digits __glibcpp_u64_digits +#define __glibcpp_unsigned_int_digits10 __glibcpp_u64_digits10 +#else +// You must define these macros in the configuration file. +#endif + +// long + +#define __glibcpp_signed_long_traps true +#define __glibcpp_unsigned_long_traps true +#ifndef __glibcpp_signed_long_is_modulo +#define __glibcpp_signed_long_is_modulo true +#endif +#if __glibcpp_long_bits == 8 +#define __glibcpp_signed_long_min __glibcpp_s8_min +#define __glibcpp_signed_long_max __glibcpp_s8_max +#define __glibcpp_signed_long_digits __glibcpp_s8_digits +#define __glibcpp_signed_long_digits10 __glibcpp_s8_digits10 +#define __glibcpp_unsigned_long_min __glibcpp_u8_min +#define __glibcpp_unsigned_long_max __glibcpp_u8_max +#define __glibcpp_unsigned_long_digits __glibcpp_u8_digits +#define __glibcpp_unsigned_long_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_long_bits == 16 +#define __glibcpp_signed_long_min __glibcpp_s16_min +#define __glibcpp_signed_long_max __glibcpp_s16_max +#define __glibcpp_signed_long_digits __glibcpp_s16_digits +#define __glibcpp_signed_long_digits10 __glibcpp_s16_digits10 +#define __glibcpp_unsigned_long_min __glibcpp_u16_min +#define __glibcpp_unsigned_long_max __glibcpp_u16_max +#define __glibcpp_unsigned_long_digits __glibcpp_u16_digits +#define __glibcpp_unsigned_long_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_long_bits == 32 +#define __glibcpp_signed_long_min __glibcpp_s32_min +#define __glibcpp_signed_long_max __glibcpp_s32_max +#define __glibcpp_signed_long_digits __glibcpp_s32_digits +#define __glibcpp_signed_long_digits10 __glibcpp_s32_digits10 +#define __glibcpp_unsigned_long_min __glibcpp_u32_min +#define __glibcpp_unsigned_long_max __glibcpp_u32_max +#define __glibcpp_unsigned_long_digits __glibcpp_u32_digits +#define __glibcpp_unsigned_long_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_long_bits == 64 +#define __glibcpp_signed_long_min (long)__glibcpp_s64_min +#define __glibcpp_signed_long_max (long)__glibcpp_s64_max +#define __glibcpp_signed_long_digits __glibcpp_s64_digits +#define __glibcpp_signed_long_digits10 __glibcpp_s64_digits10 +#define __glibcpp_unsigned_long_min (unsigned long)__glibcpp_u64_min +#define __glibcpp_unsigned_long_max (unsigned long)__glibcpp_u64_max +#define __glibcpp_unsigned_long_digits __glibcpp_u64_digits +#define __glibcpp_unsigned_long_digits10 __glibcpp_u64_digits10 +#else +// You must define these macros in the configuration file. +#endif + +// long long + +#define __glibcpp_signed_long_long_traps true +#define __glibcpp_signed_long_long_traps true +#ifndef __glibcpp_signed_long_long_is_modulo +#define __glibcpp_signed_long_long_is_modulo true +#endif +#if __glibcpp_long_long_bits == 8 +#define __glibcpp_signed_long_long_min __glibcpp_s8_min +#define __glibcpp_signed_long_long_max __glibcpp_s8_max +#define __glibcpp_signed_long_long_digits __glibcpp_s8_digits +#define __glibcpp_signed_long_long_digits10 __glibcpp_s8_digits10 +#define __glibcpp_unsigned_long_long_min __glibcpp_u8_min +#define __glibcpp_unsigned_long_long_max __glibcpp_u8_max +#define __glibcpp_unsigned_long_long_digits __glibcpp_u8_digits +#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_long_long_bits == 16 +#define __glibcpp_signed_long_long_min __glibcpp_s16_min +#define __glibcpp_signed_long_long_max __glibcpp_s16_max +#define __glibcpp_signed_long_long_digits __glibcpp_s16_digits +#define __glibcpp_signed_long_long_digits10 __glibcpp_s16_digits10 +#define __glibcpp_unsigned_long_long_min __glibcpp_u16_min +#define __glibcpp_unsigned_long_long_max __glibcpp_u16_max +#define __glibcpp_unsigned_long_long_digits __glibcpp_u16_digits +#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_long_long_bits == 32 +#define __glibcpp_signed_long_long_min __glibcpp_s32_min +#define __glibcpp_signed_long_long_max __glibcpp_s32_max +#define __glibcpp_signed_long_long_digits __glibcpp_s32_digits +#define __glibcpp_signed_long_long_digits10 __glibcpp_s32_digits10 +#define __glibcpp_unsigned_long_long_min __glibcpp_u32_min +#define __glibcpp_unsigned_long_long_max __glibcpp_u32_max +#define __glibcpp_unsigned_long_long_digits __glibcpp_u32_digits +#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_long_long_bits == 64 +#define __glibcpp_signed_long_long_min __glibcpp_s64_min +#define __glibcpp_signed_long_long_max __glibcpp_s64_max +#define __glibcpp_signed_long_long_digits __glibcpp_s64_digits +#define __glibcpp_signed_long_long_digits10 __glibcpp_s64_digits10 +#define __glibcpp_signed_long_long_traps true +#define __glibcpp_unsigned_long_long_min __glibcpp_u64_min +#define __glibcpp_unsigned_long_long_max __glibcpp_u64_max +#define __glibcpp_unsigned_long_long_digits __glibcpp_u64_digits +#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u64_digits10 +#define __glibcpp_unsigned_long_long_traps true +#else +// You must define these macros in the configuration file. +#endif + +// wchar_t + +#define __glibcpp_wchar_t_traps true +#ifndef __glibcpp_wchar_t_is_modulo +#define __glibcpp_wchar_t_is_modulo true +#endif +#if __glibcpp_wchar_t_is_signed +#if __glibcpp_wchar_t_bits == 8 +#define __glibcpp_wchar_t_min __glibcpp_s8_min +#define __glibcpp_wchar_t_max __glibcpp_s8_max +#define __glibcpp_wchar_t_digits __glibcpp_s8_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_s8_digits10 +#elif __glibcpp_wchar_t_bits == 16 +#define __glibcpp_wchar_t_min __glibcpp_s16_min +#define __glibcpp_wchar_t_max __glibcpp_s16_max +#define __glibcpp_wchar_t_digits __glibcpp_s16_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_s16_digits10 +#elif __glibcpp_wchar_t_bits == 32 +#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s32_min +#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s32_max +#define __glibcpp_wchar_t_digits __glibcpp_s32_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_s32_digits10 +#elif __glibcpp_wchar_t_bits == 64 +#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s64_min +#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s64_max +#define __glibcpp_wchar_t_digits __glibcpp_s64_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_s64_digits10 +#else +// You must define these macros in the configuration file. +#endif +#else +#if __glibcpp_wchar_t_bits == 8 +#define __glibcpp_wchar_t_min __glibcpp_u8_min +#define __glibcpp_wchar_t_max __glibcpp_u8_max +#define __glibcpp_wchar_t_digits __glibcpp_u8_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_u8_digits10 +#elif __glibcpp_wchar_t_bits == 16 +#define __glibcpp_wchar_t_min __glibcpp_u16_min +#define __glibcpp_wchar_t_max __glibcpp_u16_max +#define __glibcpp_wchar_t_digits __glibcpp_u16_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_u16_digits10 +#elif __glibcpp_wchar_t_bits == 32 +#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u32_min +#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u32_max +#define __glibcpp_wchar_t_digits __glibcpp_u32_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_u32_digits10 +#elif __glibcpp_wchar_t_bits == 64 +#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u64_min +#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u64_max +#define __glibcpp_wchar_t_digits __glibcpp_u64_digits +#define __glibcpp_wchar_t_digits10 __glibcpp_u64_digits10 +#else +// You must define these macros in the configuration file. +#endif +#endif + +// float +// + +#if __glibcpp_float_bits == 32 +#define __glibcpp_float_min __glibcpp_f32_min +#define __glibcpp_float_max __glibcpp_f32_max +#define __glibcpp_float_digits __glibcpp_f32_digits +#define __glibcpp_float_digits10 __glibcpp_f32_digits10 +#define __glibcpp_float_radix __glibcpp_f32_radix +#define __glibcpp_float_epsilon __glibcpp_f32_epsilon +#define __glibcpp_float_round_error __glibcpp_f32_round_error +#define __glibcpp_float_min_exponent __glibcpp_f32_min_exponent +#define __glibcpp_float_min_exponent10 __glibcpp_f32_min_exponent10 +#define __glibcpp_float_max_exponent __glibcpp_f32_max_exponent +#define __glibcpp_float_max_exponent10 __glibcpp_f32_max_exponent10 +#elif __glibcpp_float_bits == 64 +#define __glibcpp_float_min __glibcpp_f64_min +#define __glibcpp_float_max __glibcpp_f64_max +#define __glibcpp_float_digits __glibcpp_f64_digits +#define __glibcpp_float_digits10 __glibcpp_f64_digits10 +#define __glibcpp_float_radix __glibcpp_f64_radix +#define __glibcpp_float_epsilon __glibcpp_f64_epsilon +#define __glibcpp_float_round_error __glibcpp_f64_round_error +#define __glibcpp_float_min_exponent __glibcpp_f64_min_exponent +#define __glibcpp_float_min_exponent10 __glibcpp_f64_min_exponent10 +#define __glibcpp_float_max_exponent __glibcpp_f64_max_exponent +#define __glibcpp_float_max_exponent10 __glibcpp_f64_max_exponent10 +#elif __glibcpp_float_bits == 80 +#define __glibcpp_float_min __glibcpp_f80_min +#define __glibcpp_float_max __glibcpp_f80_max +#define __glibcpp_float_digits __glibcpp_f80_digits +#define __glibcpp_float_digits10 __glibcpp_f80_digits10 +#define __glibcpp_float_radix __glibcpp_f80_radix +#define __glibcpp_float_epsilon __glibcpp_f80_epsilon +#define __glibcpp_float_round_error __glibcpp_f80_round_error +#define __glibcpp_float_min_exponent __glibcpp_f80_min_exponent +#define __glibcpp_float_min_exponent10 __glibcpp_f80_min_exponent10 +#define __glibcpp_float_max_exponent __glibcpp_f80_max_exponent +#define __glibcpp_float_max_exponent10 __glibcpp_f80_max_exponent10 +#else +// You must define these macros in the configuration file. +#endif + +// FIXME: These are just stubs and inkorrect + +#ifndef __glibcpp_float_has_infinity +#define __glibcpp_float_has_infinity false +#endif + +#ifndef __glibcpp_float_has_quiet_NaM +#define __glibcpp_float_has_quiet_NaN false +#endif + +#ifndef __glibcpp_float_has_signaling_NaN +#define __glibcpp_float_has_signaling_NaN false +#endif + +#ifndef __glibcpp_float_has_denorm +#define __glibcpp_float_has_denorm denorm_absent +#endif + +#ifndef __glibcpp_float_has_denorm_loss +#define __glibcpp_float_has_denorm_loss false +#endif + +#ifndef __glibcpp_float_infinity +#define __glibcpp_float_infinity 0.0F +#endif + +#ifndef __glibcpp_float_quiet_NaN +#define __glibcpp_float_quiet_NaN 0.0F +#endif + +#ifndef __glibcpp_float_signaling_NaN +#define __glibcpp_float_signaling_NaN 0.0F +#endif + +#ifndef __glibcpp_float_denorm_min +#define __glibcpp_float_denorm_min 0.0F +#endif + +#ifndef __glibcpp_float_is_iec559 +#define __glibcpp_float_is_iec559 false +#endif + +#ifndef __glibcpp_float_is_bounded +#define __glibcpp_float_is_bounded true +#endif + +#ifndef __glibcpp_float_is_modulo +#define __glibcpp_float_is_modulo false +#endif + +#ifndef __glibcpp_float_traps +#define __glibcpp_float_traps false +#endif + +#ifndef __glibcpp_float_tinyness_before +#define __glibcpp_float_tinyness_before false +#endif + +#ifndef __glibcpp_float_round_style +#define __glibcpp_float_round_style round_toward_zero +#endif + +// double + +#if __glibcpp_double_bits == 32 +#define __glibcpp_double_min __glibcpp_f32_min +#define __glibcpp_double_max __glibcpp_f32_max +#define __glibcpp_double_digits __glibcpp_f32_digits +#define __glibcpp_double_digits10 __glibcpp_f32_digits10 +#define __glibcpp_double_radix __glibcpp_f32_radix +#define __glibcpp_double_epsilon __glibcpp_f32_epsilon +#define __glibcpp_double_round_error __glibcpp_f32_round_error +#define __glibcpp_double_min_exponent __glibcpp_f32_min_exponent +#define __glibcpp_double_min_exponent10 __glibcpp_f32_min_exponent10 +#define __glibcpp_double_max_exponent __glibcpp_f32_max_exponent +#define __glibcpp_double_max_exponent10 __glibcpp_f32_max_exponent10 +#elif __glibcpp_double_bits == 64 +#define __glibcpp_double_min __glibcpp_f64_min +#define __glibcpp_double_max __glibcpp_f64_max +#define __glibcpp_double_digits __glibcpp_f64_digits +#define __glibcpp_double_digits10 __glibcpp_f64_digits10 +#define __glibcpp_double_radix __glibcpp_f64_radix +#define __glibcpp_double_epsilon __glibcpp_f64_epsilon +#define __glibcpp_double_round_error __glibcpp_f64_round_error +#define __glibcpp_double_min_exponent __glibcpp_f64_min_exponent +#define __glibcpp_double_min_exponent10 __glibcpp_f64_min_exponent10 +#define __glibcpp_double_max_exponent __glibcpp_f64_max_exponent +#define __glibcpp_double_max_exponent10 __glibcpp_f64_max_exponent10 +#elif __glibcpp_double_bits == 80 +#define __glibcpp_double_min __glibcpp_f80_min +#define __glibcpp_double_max __glibcpp_f80_max +#define __glibcpp_double_digits __glibcpp_f80_digits +#define __glibcpp_double_digits10 __glibcpp_f80_digits10 +#define __glibcpp_double_radix __glibcpp_f80_radix +#define __glibcpp_double_epsilon __glibcpp_f80_epsilon +#define __glibcpp_double_round_error __glibcpp_f80_round_error +#define __glibcpp_double_min_exponent __glibcpp_f80_min_exponent +#define __glibcpp_double_min_exponent10 __glibcpp_f80_min_exponent10 +#define __glibcpp_double_max_exponent __glibcpp_f80_max_exponent +#define __glibcpp_double_max_exponent10 __glibcpp_f80_max_exponent10 +#else +// You must define these macros in the configuration file. +#endif + +// FIXME: These are just stubs and inkorrect + +#ifndef __glibcpp_double_has_infinity +#define __glibcpp_double_has_infinity false +#endif + +#ifndef __glibcpp_double_has_quiet_NaM +#define __glibcpp_double_has_quiet_NaN false +#endif + +#ifndef __glibcpp_double_has_signaling_NaN +#define __glibcpp_double_has_signaling_NaN false +#endif + +#ifndef __glibcpp_double_has_denorm +#define __glibcpp_double_has_denorm denorm_absent +#endif + +#ifndef __glibcpp_double_has_denorm_loss +#define __glibcpp_double_has_denorm_loss false +#endif + +#ifndef __glibcpp_double_infinity +#define __glibcpp_double_infinity 0.0 +#endif + +#ifndef __glibcpp_double_quiet_NaN +#define __glibcpp_double_quiet_NaN 0.0 +#endif + +#ifndef __glibcpp_double_signaling_NaN +#define __glibcpp_double_signaling_NaN 0.0 +#endif + +#ifndef __glibcpp_double_denorm_min +#define __glibcpp_double_denorm_min 0.0 +#endif + +#ifndef __glibcpp_double_is_iec559 +#define __glibcpp_double_is_iec559 false +#endif + +#ifndef __glibcpp_double_is_bounded +#define __glibcpp_double_is_bounded true +#endif + +#ifndef __glibcpp_double_is_modulo +#define __glibcpp_double_is_modulo false +#endif + +#ifndef __glibcpp_double_traps +#define __glibcpp_double_traps false +#endif + +#ifndef __glibcpp_double_tinyness_before +#define __glibcpp_double_tinyness_before false +#endif + +#ifndef __glibcpp_double_round_style +#define __glibcpp_double_round_style round_toward_zero +#endif + +// long double + +#if __glibcpp_long_double_bits == 32 +#define __glibcpp_long_double_min __glibcpp_f32_min +#define __glibcpp_long_double_max __glibcpp_f32_max +#define __glibcpp_long_double_digits __glibcpp_f32_digits +#define __glibcpp_long_double_digits10 __glibcpp_f32_digits10 +#define __glibcpp_long_double_radix __glibcpp_f32_radix +#define __glibcpp_long_double_epsilon __glibcpp_f32_epsilon +#define __glibcpp_long_double_round_error __glibcpp_f32_round_error +#define __glibcpp_long_double_min_exponent __glibcpp_f32_min_exponent +#define __glibcpp_long_double_min_exponent10 __glibcpp_f32_min_exponent10 +#define __glibcpp_long_double_max_exponent __glibcpp_f32_max_exponent +#define __glibcpp_long_double_max_exponent10 __glibcpp_f32_max_exponent10 +#elif __glibcpp_long_double_bits == 64 +#define __glibcpp_long_double_min __glibcpp_f64_min +#define __glibcpp_long_double_max __glibcpp_f64_max +#define __glibcpp_long_double_digits __glibcpp_f64_digits +#define __glibcpp_long_double_digits10 __glibcpp_f64_digits10 +#define __glibcpp_long_double_radix __glibcpp_f64_radix +#define __glibcpp_long_double_epsilon __glibcpp_f64_epsilon +#define __glibcpp_long_double_round_error __glibcpp_f64_round_error +#define __glibcpp_long_double_min_exponent __glibcpp_f64_min_exponent +#define __glibcpp_long_double_min_exponent10 __glibcpp_f64_min_exponent10 +#define __glibcpp_long_double_max_exponent __glibcpp_f64_max_exponent +#define __glibcpp_long_double_max_exponent10 __glibcpp_f64_max_exponent10 +#elif __glibcpp_long_double_bits == 80 +#define __glibcpp_long_double_min __glibcpp_f80_min +#define __glibcpp_long_double_max __glibcpp_f80_max +#define __glibcpp_long_double_digits __glibcpp_f80_digits +#define __glibcpp_long_double_digits10 __glibcpp_f80_digits10 +#define __glibcpp_long_double_radix __glibcpp_f80_radix +#define __glibcpp_long_double_epsilon __glibcpp_f80_epsilon +#define __glibcpp_long_double_round_error __glibcpp_f80_round_error +#define __glibcpp_long_double_min_exponent __glibcpp_f80_min_exponent +#define __glibcpp_long_double_min_exponent10 __glibcpp_f80_min_exponent10 +#define __glibcpp_long_double_max_exponent __glibcpp_f80_max_exponent +#define __glibcpp_long_double_max_exponent10 __glibcpp_f80_max_exponent10 +#elif __glibcpp_long_double_bits == 96 +#define __glibcpp_long_double_min __glibcpp_f96_min +#define __glibcpp_long_double_max __glibcpp_f96_max +#define __glibcpp_long_double_digits __glibcpp_f96_digits +#define __glibcpp_long_double_digits10 __glibcpp_f96_digits10 +#define __glibcpp_long_double_radix __glibcpp_f96_radix +#define __glibcpp_long_double_epsilon __glibcpp_f96_epsilon +#define __glibcpp_long_double_round_error __glibcpp_f96_round_error +#define __glibcpp_long_double_min_exponent __glibcpp_f96_min_exponent +#define __glibcpp_long_double_min_exponent10 __glibcpp_f96_min_exponent10 +#define __glibcpp_long_double_max_exponent __glibcpp_f96_max_exponent +#define __glibcpp_long_double_max_exponent10 __glibcpp_f96_max_exponent10 +#elif __glibcpp_long_double_bits == 128 +#define __glibcpp_long_double_min __glibcpp_f128_min +#define __glibcpp_long_double_max __glibcpp_f128_max +#define __glibcpp_long_double_digits __glibcpp_f128_digits +#define __glibcpp_long_double_digits10 __glibcpp_f128_digits10 +#define __glibcpp_long_double_radix __glibcpp_f128_radix +#define __glibcpp_long_double_epsilon __glibcpp_f128_epsilon +#define __glibcpp_long_double_round_error __glibcpp_f128_round_error +#define __glibcpp_long_double_min_exponent __glibcpp_f128_min_exponent +#define __glibcpp_long_double_min_exponent10 __glibcpp_f128_min_exponent10 +#define __glibcpp_long_double_max_exponent __glibcpp_f128_max_exponent +#define __glibcpp_long_double_max_exponent10 __glibcpp_f128_max_exponent10 +#else +// You must define these macros in the configuration file. +#endif + +// FIXME: These are just stubs and inkorrect + +#ifndef __glibcpp_long_double_has_infinity +#define __glibcpp_long_double_has_infinity false +#endif + +#ifndef __glibcpp_long_double_has_quiet_NaN +#define __glibcpp_long_double_has_quiet_NaN false +#endif + +#ifndef __glibcpp_long_double_has_signaling_NaN +#define __glibcpp_long_double_has_signaling_NaN false +#endif + +#ifndef __glibcpp_long_double_has_denorm +#define __glibcpp_long_double_has_denorm denorm_absent +#endif + +#ifndef __glibcpp_long_double_has_denorm_loss +#define __glibcpp_long_double_has_denorm_loss false +#endif + +#ifndef __glibcpp_long_double_infinity +#define __glibcpp_long_double_infinity 0.0L +#endif + +#ifndef __glibcpp_long_double_quiet_NaN +#define __glibcpp_long_double_quiet_NaN 0.0L +#endif + +#ifndef __glibcpp_long_double_signaling_NaN +#define __glibcpp_long_double_signaling_NaN 0.0L +#endif + +#ifndef __glibcpp_long_double_denorm_min +#define __glibcpp_long_double_denorm_min 0.0L +#endif + +#ifndef __glibcpp_long_double_is_iec559 +#define __glibcpp_long_double_is_iec559 false +#endif + +#ifndef __glibcpp_long_double_is_bounded +#define __glibcpp_long_double_is_bounded true +#endif + +#ifndef __glibcpp_long_double_is_modulo +#define __glibcpp_long_double_is_modulo false +#endif + +#ifndef __glibcpp_long_double_traps +#define __glibcpp_long_double_traps false +#endif + +#ifndef __glibcpp_long_double_tinyness_before +#define __glibcpp_long_double_tinyness_before false #endif + +#ifndef __glibcpp_long_double_round_style +#define __glibcpp_long_double_round_style round_toward_zero +#endif + + +namespace std +{ + enum float_round_style + { + round_indeterminate = -1, + round_toward_zero = 0, + round_to_nearest = 1, + round_toward_infinity = 2, + round_toward_neg_infinity = 3 + }; + + enum float_denorm_style + { + denorm_indeterminate = -1, + denorm_absent = 0, + denorm_present = 1 + }; + + // + // The primary class traits + // + template<typename _Tp> + struct numeric_limits + { + static const bool is_specialized = false; + + static _Tp min() throw() { return static_cast<_Tp>(0); } + static _Tp max() throw() { return static_cast<_Tp>(0); } + + static const int digits = 0; + static const int digits10 = 0; + static const bool is_signed = false; + static const bool is_integer = false; + static const bool is_exact = false; + static const int radix = 0; + + static _Tp epsilon() throw() { return static_cast<_Tp>(0); } + static _Tp round_error() throw() { return static_cast<_Tp>(0); } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static _Tp infinity() throw() { return static_cast<_Tp>(0); } + static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); } + static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); } + static _Tp denorm_min() throw() { return static_cast<_Tp>(0); } + + static const bool is_iec559 = false; + static const bool is_bounded = false; + static const bool is_modulo = false; + + static const bool traps = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_specialized; + + template<typename _Tp> + const int + numeric_limits<_Tp>::digits; + + template<typename _Tp> + const int + numeric_limits<_Tp>::digits10; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_signed; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_integer; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_exact; + + template<typename _Tp> + const int + numeric_limits<_Tp>::radix; + + template<typename _Tp> + const int + numeric_limits<_Tp>::min_exponent; + + template<typename _Tp> + const int + numeric_limits<_Tp>::min_exponent10; + + template<typename _Tp> + const int + numeric_limits<_Tp>::max_exponent; + + template<typename _Tp> + const int + numeric_limits<_Tp>::max_exponent10; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::has_infinity; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::has_quiet_NaN; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::has_signaling_NaN; + + template<typename _Tp> + const float_denorm_style + numeric_limits<_Tp>::has_denorm; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::has_denorm_loss; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_iec559; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_bounded; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::is_modulo; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::traps; + + template<typename _Tp> + const bool + numeric_limits<_Tp>::tinyness_before; + + template<typename _Tp> + const float_round_style + numeric_limits<_Tp>::round_style; + + // Now there follow 15 explicit specializations. Yes, 15. Make sure + // you get the count right. + + template<> + struct numeric_limits<bool> + { + static const bool is_specialized = true; + + static bool min() throw() + { return false; } + + static bool max() throw() + { return true; } + + static const int digits = __glibcpp_bool_digits; + static const int digits10 = 0; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static bool epsilon() throw() + { return false; } + static bool round_error() throw() + { return false; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static bool infinity() throw() + { return false; } + static bool quiet_NaN() throw() + { return false; } + static bool signaling_NaN() throw() + { return false; } + static bool denorm_min() throw() + { return false; } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = true; + + // It is not clear what it means for a boolean type to trap. + // This is a DR on the LWG issue list. Here, I use integer + // promotion semantics. + static const bool traps = __glibcpp_signed_int_traps + || __glibcpp_signed_long_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_bool_digits + + template<> + struct numeric_limits<char> + { + static const bool is_specialized = true; + + static char min() throw() + { return __glibcpp_char_min; } + static char max() throw() + { return __glibcpp_char_max; } + + static const int digits = __glibcpp_char_digits; + static const int digits10 = __glibcpp_char_digits10; + static const bool is_signed = __glibcpp_plain_char_is_signed; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static char epsilon() throw() + { return char(); } + static char round_error() throw() + { return char(); } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static char infinity() throw() + { return char(); } + static char quiet_NaN() throw() + { return char(); } + static char signaling_NaN() throw() + { return char(); } + static char denorm_min() throw() + { return static_cast<char>(0); } + + static const bool is_iec559 = false; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_char_is_modulo; + + static const bool traps = __glibcpp_char_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_char_min +#undef __glibcpp_char_max +#undef __glibcpp_char_digits +#undef __glibcpp_char_digits10 +#undef __glibcpp_char_is_signed +#undef __glibcpp_char_is_modulo +#undef __glibcpp_char_traps + + + + template<> + struct numeric_limits<signed char> + { + static const bool is_specialized = true; + + static signed char min() throw() + { return __glibcpp_signed_char_min; } + static signed char max() throw() + { return __glibcpp_signed_char_max; } + + static const int digits = __glibcpp_signed_char_digits; + static const int digits10 = __glibcpp_signed_char_digits10; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static signed char epsilon() throw() + { return 0; } + static signed char round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static signed char infinity() throw() + { return static_cast<signed char>(0); } + static signed char quiet_NaN() throw() + { return static_cast<signed char>(0); } + static signed char signaling_NaN() throw() + { return static_cast<signed char>(0); } + static signed char denorm_min() throw() + { return static_cast<signed char>(0); } + + static const bool is_iec559 = false; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_signed_char_is_modulo; + + static const bool traps = __glibcpp_signed_char_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_signed_char_min +#undef __glibcpp_signed_char_max +#undef __glibcpp_signed_char_digits +#undef __glibcpp_signed_char_digits10 +#undef __glibcpp_signed_char_is_modulo +#undef __glibcpp_signed_char_traps + + template<> + struct numeric_limits<unsigned char> + { + static const bool is_specialized = true; + + static unsigned char min() throw() + { return 0; } + static unsigned char max() throw() + { return __glibcpp_unsigned_char_max; } + + static const int digits = __glibcpp_unsigned_char_digits; + static const int digits10 = __glibcpp_unsigned_char_digits10; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static unsigned char epsilon() throw() + { return 0; } + static unsigned char round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static unsigned char infinity() throw() + { return static_cast<unsigned char>(0); } + static unsigned char quiet_NaN() throw() + { return static_cast<unsigned char>(0); } + static unsigned char signaling_NaN() throw() + { return static_cast<unsigned char>(0); } + static unsigned char denorm_min() throw() + { return static_cast<unsigned char>(0); } + + static const bool is_iec559 = false; + static const bool is_bounded = true; + static const bool is_modulo = true; + + static const bool traps = __glibcpp_unsigned_char_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_unsigned_char_max +#undef __glibcpp_unsigned_char_digits +#undef __glibcpp_unsigned_char_digits10 +#undef __glibcpp_unsigned_char_traps + + template<> + struct numeric_limits<wchar_t> + { + static const bool is_specialized = true; + + static wchar_t min() throw() + { return __glibcpp_wchar_t_min; } + static wchar_t max() throw() + { return __glibcpp_wchar_t_max; } + + static const int digits = __glibcpp_wchar_t_digits; + static const int digits10 = __glibcpp_wchar_t_digits10; + static const bool is_signed = __glibcpp_wchar_t_is_signed; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static wchar_t epsilon() throw() + { return 0; } + static wchar_t round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static wchar_t infinity() throw() + { return wchar_t(); } + static wchar_t quiet_NaN() throw() + { return wchar_t(); } + static wchar_t signaling_NaN() throw() + { return wchar_t(); } + static wchar_t denorm_min() throw() + { return wchar_t(); } + + static const bool is_iec559 = false; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_wchar_t_is_modulo; + + static const bool traps = __glibcpp_wchar_t_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_wchar_t_min +#undef __glibcpp_wchar_t_max +#undef __glibcpp_wchar_t_digits +#undef __glibcpp_wchar_t_digits10 +#undef __glibcpp_wchar_t_is_signed +#undef __glibcpp_wchar_t_is_modulo +#undef __glibcpp_wchar_t_traps + + template<> + struct numeric_limits<short> + { + static const bool is_specialized = true; + + static short min() throw() + { return __glibcpp_signed_short_min; } + static short max() throw() + { return __glibcpp_signed_short_max; } + + static const int digits = __glibcpp_signed_short_digits; + static const int digits10 = __glibcpp_signed_short_digits10; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static short epsilon() throw() + { return 0; } + static short round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static short infinity() throw() + { return short(); } + static short quiet_NaN() throw() + { return short(); } + static short signaling_NaN() throw() + { return short(); } + static short denorm_min() throw() + { return short(); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_signed_short_is_modulo; + + static const bool traps = __glibcpp_signed_short_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_signed_short_min +#undef __glibcpp_signed_short_max +#undef __glibcpp_signed_short_digits +#undef __glibcpp_signed_short_digits10 +#undef __glibcpp_signed_short_is_modulo +#undef __glibcpp_signed_short_traps + + template<> + struct numeric_limits<unsigned short> + { + static const bool is_specialized = true; + + static unsigned short min() throw() + { return 0; } + static unsigned short max() throw() + { return __glibcpp_unsigned_short_max; } + + static const int digits = __glibcpp_unsigned_short_digits; + static const int digits10 = __glibcpp_unsigned_short_digits10; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static unsigned short epsilon() throw() + { return 0; } + static unsigned short round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static unsigned short infinity() throw() + { return static_cast<unsigned short>(0); } + static unsigned short quiet_NaN() throw() + { return static_cast<unsigned short>(0); } + static unsigned short signaling_NaN() throw() + { return static_cast<unsigned short>(0); } + static unsigned short denorm_min() throw() + { return static_cast<unsigned short>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = true; + + static const bool traps = __glibcpp_unsigned_short_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_unsigned_short_max +#undef __glibcpp_unsigned_short_digits +#undef __glibcpp_unsigned_short_digits10 +#undef __glibcpp_unsigned_short_traps + + template<> + struct numeric_limits<int> + { + static const bool is_specialized = true; + + static int min() throw() + { return __glibcpp_signed_int_min; } + static int max() throw() + { return __glibcpp_signed_int_max; } + + static const int digits = __glibcpp_signed_int_digits; + static const int digits10 = __glibcpp_signed_int_digits10; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static int epsilon() throw() + { return 0; } + static int round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static int infinity() throw() + { return static_cast<int>(0); } + static int quiet_NaN() throw() + { return static_cast<int>(0); } + static int signaling_NaN() throw() + { return static_cast<int>(0); } + static int denorm_min() throw() + { return static_cast<int>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_signed_int_is_modulo; + + static const bool traps = __glibcpp_signed_int_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_signed_int_min +#undef __glibcpp_signed_int_max +#undef __glibcpp_signed_int_digits +#undef __glibcpp_signed_int_digits10 +#undef __glibcpp_signed_int_is_modulo +#undef __glibcpp_signed_int_traps + + template<> + struct numeric_limits<unsigned int> + { + static const bool is_specialized = true; + + static unsigned int min() throw() + { return 0; } + static unsigned int max() throw() + { return __glibcpp_unsigned_int_max; } + + static const int digits = __glibcpp_unsigned_int_digits; + static const int digits10 = __glibcpp_unsigned_int_digits10; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static unsigned int epsilon() throw() + { return 0; } + static unsigned int round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static unsigned int infinity() throw() + { return static_cast<unsigned int>(0); } + static unsigned int quiet_NaN() throw() + { return static_cast<unsigned int>(0); } + static unsigned int signaling_NaN() throw() + { return static_cast<unsigned int>(0); } + static unsigned int denorm_min() throw() + { return static_cast<unsigned int>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = true; + + static const bool traps = __glibcpp_unsigned_int_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_unsigned_int_max +#undef __glibcpp_unsigned_int_digits +#undef __glibcpp_unsigned_int_digits10 +#undef __glibcpp_unsigned_int_traps + + template<> + struct numeric_limits<long> + { + static const bool is_specialized = true; + + static long min() throw() + { return __glibcpp_signed_long_min; } + static long max() throw() + { return __glibcpp_signed_long_max; } + + static const int digits = __glibcpp_signed_long_digits; + static const int digits10 = __glibcpp_signed_long_digits10; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static long epsilon() throw() + { return 0; } + static long round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static long infinity() throw() + { return static_cast<long>(0); } + static long quiet_NaN() throw() + { return static_cast<long>(0); } + static long signaling_NaN() throw() + { return static_cast<long>(0); } + static long denorm_min() throw() + { return static_cast<long>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_signed_long_is_modulo; + + static const bool traps = __glibcpp_signed_long_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_signed_long_min +#undef __glibcpp_signed_long_max +#undef __glibcpp_signed_long_digits +#undef __glibcpp_signed_long_digits10 +#undef __glibcpp_signed_long_is_modulo +#undef __glibcpp_signed_long_traps + + template<> + struct numeric_limits<unsigned long> + { + static const bool is_specialized = true; + + static unsigned long min() throw() + { return 0; } + static unsigned long max() throw() + { return __glibcpp_unsigned_long_max; } + + static const int digits = __glibcpp_unsigned_long_digits; + static const int digits10 = __glibcpp_unsigned_long_digits10; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static unsigned long epsilon() throw() + { return 0; } + static unsigned long round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static unsigned long infinity() throw() + { return static_cast<unsigned long>(0); } + static unsigned long quiet_NaN() throw() + { return static_cast<unsigned long>(0); } + static unsigned long signaling_NaN() throw() + { return static_cast<unsigned long>(0); } + static unsigned long denorm_min() throw() + { return static_cast<unsigned long>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = true; + + static const bool traps = __glibcpp_unsigned_long_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_unsigned_long_max +#undef __glibcpp_unsigned_long_digits +#undef __glibcpp_unsigned_long_digits10 +#undef __glibcpp_unsigned_long_traps + + template<> + struct numeric_limits<long long> + { + static const bool is_specialized = true; + + static long long min() throw() + { return __glibcpp_signed_long_long_min; } + static long long max() throw() + { return __glibcpp_signed_long_long_max; } + + static const int digits = __glibcpp_signed_long_long_digits; + static const int digits10 = __glibcpp_signed_long_long_digits10; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static long long epsilon() throw() + { return 0; } + static long long round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static long long infinity() throw() + { return static_cast<long long>(0); } + static long long quiet_NaN() throw() + { return static_cast<long long>(0); } + static long long signaling_NaN() throw() + { return static_cast<long long>(0); } + static long long denorm_min() throw() + { return static_cast<long long>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = __glibcpp_signed_long_long_is_modulo; + + static const bool traps = __glibcpp_signed_long_long_traps; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_signed_long_long_min +#undef __glibcpp_signed_long_long_max +#undef __glibcpp_signed_long_long_digits +#undef __glibcpp_signed_long_long_digits10 +#undef __glibcpp_signed_long_long_is_modulo +#undef __glibcpp_signed_long_long_traps + + template<> + struct numeric_limits<unsigned long long> + { + static const bool is_specialized = true; + + static unsigned long long min() throw() + { return 0; } + static unsigned long long max() throw() + { return __glibcpp_unsigned_long_long_max; } + + static const int digits = __glibcpp_unsigned_long_long_digits; + static const int digits10 = __glibcpp_unsigned_long_long_digits10; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const int radix = 2; + static unsigned long long epsilon() throw() + { return 0; } + static unsigned long long round_error() throw() + { return 0; } + + static const int min_exponent = 0; + static const int min_exponent10 = 0; + static const int max_exponent = 0; + static const int max_exponent10 = 0; + + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const float_denorm_style has_denorm = denorm_absent; + static const bool has_denorm_loss = false; + + static unsigned long long infinity() throw() + { return static_cast<unsigned long long>(0); } + static unsigned long long quiet_NaN() throw() + { return static_cast<unsigned long long>(0); } + static unsigned long long signaling_NaN() throw() + { return static_cast<unsigned long long>(0); } + static unsigned long long denorm_min() throw() + { return static_cast<unsigned long long>(0); } + + static const bool is_iec559 = true; + static const bool is_bounded = true; + static const bool is_modulo = true; + + static const bool traps = true; + static const bool tinyness_before = false; + static const float_round_style round_style = round_toward_zero; + }; + +#undef __glibcpp_unsigned_long_long_max +#undef __glibcpp_unsigned_long_long_digits +#undef __glibcpp_unsigned_long_long_digits10 +#undef __glibcpp_unsigned_long_long_traps + + template<> + struct numeric_limits<float> + { + static const bool is_specialized = true; + + static float min() throw() + { return __glibcpp_float_min; } + static float max() throw() + { return __glibcpp_float_max; } + + static const int digits = __glibcpp_float_digits; + static const int digits10 = __glibcpp_float_digits10; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const int radix = __glibcpp_float_radix; + static float epsilon() throw() + { return __glibcpp_float_epsilon; } + static float round_error() throw() + { return __glibcpp_float_round_error; } + + static const int min_exponent = __glibcpp_float_min_exponent; + static const int min_exponent10 = __glibcpp_float_min_exponent10; + static const int max_exponent = __glibcpp_float_max_exponent; + static const int max_exponent10 = __glibcpp_float_max_exponent10; + + static const bool has_infinity = __glibcpp_float_has_infinity; + static const bool has_quiet_NaN = __glibcpp_float_has_quiet_NaN; + static const bool has_signaling_NaN = __glibcpp_float_has_signaling_NaN; + static const float_denorm_style has_denorm = __glibcpp_float_has_denorm; + static const bool has_denorm_loss = __glibcpp_float_has_denorm_loss; + + static float infinity() throw() + { return __glibcpp_float_infinity; } + static float quiet_NaN() throw() + { return __glibcpp_float_quiet_NaN; } + static float signaling_NaN() throw() + { return __glibcpp_float_signaling_NaN; } + static float denorm_min() throw() + { return __glibcpp_float_denorm_min; } + + static const bool is_iec559 = __glibcpp_float_is_iec559; + static const bool is_bounded = __glibcpp_float_is_bounded; + static const bool is_modulo = __glibcpp_float_is_modulo; + + static const bool traps = __glibcpp_float_traps; + static const bool tinyness_before = __glibcpp_float_tinyness_before; + static const float_round_style round_style = __glibcpp_float_round_style; + }; + +#undef __glibcpp_float_min +#undef __glibcpp_float_max +#undef __glibcpp_float_digits +#undef __glibcpp_float_digits10 +#undef __glibcpp_float_radix +#undef __glibcpp_float_round_error +#undef __glibcpp_float_min_exponent +#undef __glibcpp_float_min_exponent10 +#undef __glibcpp_float_max_exponent +#undef __glibcpp_float_max_exponent10 +#undef __glibcpp_float_has_infinity +#undef __glibcpp_float_has_quiet_NaN +#undef __glibcpp_float_has_signaling_NaN +#undef __glibcpp_float_has_denorm +#undef __glibcpp_float_has_denorm_loss +#undef __glibcpp_float_infinity +#undef __glibcpp_float_quiet_NaN +#undef __glibcpp_float_signaling_NaN +#undef __glibcpp_float_denorm_min +#undef __glibcpp_float_is_iec559 +#undef __glibcpp_float_is_bounded +#undef __glibcpp_float_is_modulo +#undef __glibcpp_float_traps +#undef __glibcpp_float_tinyness_before +#undef __glibcpp_float_round_style + + template<> + struct numeric_limits<double> + { + static const bool is_specialized = true; + + static double min() throw() + { return __glibcpp_double_min; } + static double max() throw() + { return __glibcpp_double_max; } + + static const int digits = __glibcpp_double_digits; + static const int digits10 = __glibcpp_double_digits10; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const int radix = __glibcpp_double_radix; + static double epsilon() throw() + { return __glibcpp_double_epsilon; } + static double round_error() throw() + { return __glibcpp_double_round_error; } + + static const int min_exponent = __glibcpp_double_min_exponent; + static const int min_exponent10 = __glibcpp_double_min_exponent10; + static const int max_exponent = __glibcpp_double_max_exponent; + static const int max_exponent10 = __glibcpp_double_max_exponent10; + + static const bool has_infinity = __glibcpp_double_has_infinity; + static const bool has_quiet_NaN = __glibcpp_double_has_quiet_NaN; + static const bool has_signaling_NaN = __glibcpp_double_has_signaling_NaN; + static const float_denorm_style has_denorm = + __glibcpp_double_has_denorm; + static const bool has_denorm_loss = __glibcpp_double_has_denorm_loss; + + static double infinity() throw() + { return __glibcpp_double_infinity; } + static double quiet_NaN() throw() + { return __glibcpp_double_quiet_NaN; } + static double signaling_NaN() throw() + { return __glibcpp_double_signaling_NaN; } + static double denorm_min() throw() + { return __glibcpp_double_denorm_min; } + + static const bool is_iec559 = __glibcpp_double_is_iec559; + static const bool is_bounded = __glibcpp_double_is_bounded; + static const bool is_modulo = __glibcpp_double_is_modulo; + + static const bool traps = __glibcpp_double_traps; + static const bool tinyness_before = __glibcpp_double_tinyness_before; + static const float_round_style round_style = + __glibcpp_double_round_style; + }; + +#undef __glibcpp_double_min +#undef __glibcpp_double_max +#undef __glibcpp_double_digits +#undef __glibcpp_double_digits10 +#undef __glibcpp_double_radix +#undef __glibcpp_double_round_error +#undef __glibcpp_double_min_exponent +#undef __glibcpp_double_min_exponent10 +#undef __glibcpp_double_max_exponent +#undef __glibcpp_double_max_exponent10 +#undef __glibcpp_double_has_infinity +#undef __glibcpp_double_has_quiet_NaN +#undef __glibcpp_double_has_signaling_NaN +#undef __glibcpp_double_has_denorm +#undef __glibcpp_double_has_denorm_loss +#undef __glibcpp_double_infinity +#undef __glibcpp_double_quiet_NaN +#undef __glibcpp_double_signaling_NaN +#undef __glibcpp_double_denorm_min +#undef __glibcpp_double_is_iec559 +#undef __glibcpp_double_is_bounded +#undef __glibcpp_double_is_modulo +#undef __glibcpp_double_traps +#undef __glibcpp_double_tinyness_before +#undef __glibcpp_double_round_style + + + template<> + struct numeric_limits<long double> + { + static const bool is_specialized = true; + + static long double min() throw() + { return __glibcpp_long_double_min; } + static long double max() throw() + { return __glibcpp_long_double_max; } + + static const int digits = __glibcpp_long_double_digits; + static const int digits10 = __glibcpp_long_double_digits10; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const int radix = __glibcpp_long_double_radix; + static long double epsilon() throw() + { return __glibcpp_long_double_epsilon; } + static long double round_error() throw() + { return __glibcpp_long_double_round_error; } + + static const int min_exponent = __glibcpp_long_double_min_exponent; + static const int min_exponent10 = __glibcpp_long_double_min_exponent10; + static const int max_exponent = __glibcpp_long_double_max_exponent; + static const int max_exponent10 = __glibcpp_long_double_max_exponent10; + + static const bool has_infinity = __glibcpp_long_double_has_infinity; + static const bool has_quiet_NaN = __glibcpp_long_double_has_quiet_NaN; + static const bool has_signaling_NaN = + __glibcpp_long_double_has_signaling_NaN; + static const float_denorm_style has_denorm = + __glibcpp_long_double_has_denorm; + static const bool has_denorm_loss = + __glibcpp_long_double_has_denorm_loss; + + static long double infinity() throw() + { return __glibcpp_long_double_infinity; } + static long double quiet_NaN() throw() + { return __glibcpp_long_double_quiet_NaN; } + static long double signaling_NaN() throw() + { return __glibcpp_long_double_signaling_NaN; } + static long double denorm_min() throw() + { return __glibcpp_long_double_denorm_min; } + + static const bool is_iec559 = __glibcpp_long_double_is_iec559; + static const bool is_bounded = __glibcpp_long_double_is_bounded; + static const bool is_modulo = __glibcpp_long_double_is_modulo; + + static const bool traps = __glibcpp_long_double_traps; + static const bool tinyness_before = __glibcpp_long_double_tinyness_before; + static const float_round_style round_style = + __glibcpp_long_double_round_style; + }; + +#undef __glibcpp_long_double_min +#undef __glibcpp_long_double_max +#undef __glibcpp_long_double_digits +#undef __glibcpp_long_double_digits10 +#undef __glibcpp_long_double_radix +#undef __glibcpp_long_double_round_error +#undef __glibcpp_long_double_min_exponent +#undef __glibcpp_long_double_min_exponent10 +#undef __glibcpp_long_double_max_exponent +#undef __glibcpp_long_double_max_exponent10 +#undef __glibcpp_long_double_has_infinity +#undef __glibcpp_long_double_has_quiet_NaN +#undef __glibcpp_long_double_has_signaling_NaN +#undef __glibcpp_long_double_has_denorm +#undef __glibcpp_long_double_has_denorm_loss +#undef __glibcpp_long_double_infinity +#undef __glibcpp_long_double_quiet_NaN +#undef __glibcpp_long_double_signaling_NaN +#undef __glibcpp_long_double_denorm_min +#undef __glibcpp_long_double_is_iec559 +#undef __glibcpp_long_double_is_bounded +#undef __glibcpp_long_double_is_modulo +#undef __glibcpp_long_double_traps +#undef __glibcpp_long_double_tinyness_before +#undef __glibcpp_long_double_round_style + +} // namespace std + +#endif // _CPP_NUMERIC_LIMITS diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list index 51490ee..683e0a7 100644 --- a/libstdc++-v3/include/std/list +++ b/libstdc++-v3/include/std/list @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <list> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,51 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file list - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_list.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_LIST -#include <bits/std_list.h> -#endif +#define _CPP_LIST 1 + +#pragma GCC system_header + +#include <bits/functexcept.h> +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_list.h> + +#endif /* _CPP_LIST */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/locale b/libstdc++-v3/include/std/locale index 5a1d622..82089d0 100644 --- a/libstdc++-v3/include/std/locale +++ b/libstdc++-v3/include/std/locale @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Locale support -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997-1999 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 @@ -27,11 +27,26 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file locale - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 22.1 Locales +// + +/** @file std_locale.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_LOCALE -#include <bits/std_locale.h> +#define _CPP_LOCALE 1 + +#pragma GCC system_header + +#include <bits/localefwd.h> +#include <bits/locale_facets.h> +#include <bits/locale_facets.tcc> + #endif + +// Local Variables: +// mode:c++ +// End: diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map index 3d10673..0dd38bf 100644 --- a/libstdc++-v3/include/std/map +++ b/libstdc++-v3/include/std/map @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <map> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,48 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file map - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_map.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_MAP -#include <bits/std_map.h> -#endif +#define _CPP_MAP 1 + +#pragma GCC system_header + +#include <bits/stl_tree.h> +#include <bits/stl_map.h> +#include <bits/stl_multimap.h> + +#endif /* _CPP_MAP */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory index a52f492..c9a2e59 100644 --- a/libstdc++-v3/include/std/memory +++ b/libstdc++-v3/include/std/memory @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <memory> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,123 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file memory - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * Copyright (c) 1997-1999 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +/** @file std_memory.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_MEMORY -#include <bits/std_memory.h> -#endif +#define _CPP_MEMORY 1 + +#pragma GCC system_header + +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_iterator_base_types.h> //for iterator_traits +#include <bits/stl_tempbuf.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_raw_storage_iter.h> + +namespace std +{ + + template<class _Tp1> struct auto_ptr_ref { + _Tp1* _M_ptr; + auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {} +}; + +/** + * A simple smart pointer providing strict ownership semantics. (More later.) +*/ +template <class _Tp> class auto_ptr { +private: + _Tp* _M_ptr; + +public: + typedef _Tp element_type; + + explicit auto_ptr(_Tp* __p = 0) throw() : _M_ptr(__p) {} + auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) {} + + template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) throw() + : _M_ptr(__a.release()) {} + + auto_ptr& operator=(auto_ptr& __a) throw() { + reset(__a.release()); + return *this; + } + + template <class _Tp1> + auto_ptr& operator=(auto_ptr<_Tp1>& __a) throw() { + reset(__a.release()); + return *this; + } + + // Note: The C++ standard says there is supposed to be an empty throw + // specification here, but omitting it is standard conforming. Its + // presence can be detected only if _Tp::~_Tp() throws, but (17.4.3.6/2) + // this is prohibited. + ~auto_ptr() { delete _M_ptr; } + + _Tp& operator*() const throw() { + return *_M_ptr; + } + _Tp* operator->() const throw() { + return _M_ptr; + } + _Tp* get() const throw() { + return _M_ptr; + } + _Tp* release() throw() { + _Tp* __tmp = _M_ptr; + _M_ptr = 0; + return __tmp; + } + void reset(_Tp* __p = 0) throw() { + if (__p != _M_ptr) { + delete _M_ptr; + _M_ptr = __p; + } + } + +public: + auto_ptr(auto_ptr_ref<_Tp> __ref) throw() + : _M_ptr(__ref._M_ptr) {} + + auto_ptr& operator=(auto_ptr_ref<_Tp> __ref) throw() { + if (__ref._M_ptr != this->get()) { + delete _M_ptr; + _M_ptr = __ref._M_ptr; + } + return *this; + } + + template <class _Tp1> operator auto_ptr_ref<_Tp1>() throw() + { return auto_ptr_ref<_Tp>(this->release()); } + template <class _Tp1> operator auto_ptr<_Tp1>() throw() + { return auto_ptr<_Tp1>(this->release()); } +}; + +} // namespace std + +#endif /* _CPP_MEMORY */ + + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric index 0d2aea0..e7a6adc 100644 --- a/libstdc++-v3/include/std/numeric +++ b/libstdc++-v3/include/std/numeric @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <numeric> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,49 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file numeric - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_numeric.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_NUMERIC -#include <bits/std_numeric.h> -#endif +#define _CPP_NUMERIC 1 + +#pragma GCC system_header +#include <bits/c++config.h> +#include <cstddef> +#include <iterator> +#include <bits/stl_function.h> +#include <bits/stl_numeric.h> + +#endif /* _CPP_NUMERIC */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index eb4fd68..e3ec326 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Output streams -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -27,11 +27,262 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file ostream - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.6.2 Output streams +// + +/** @file std_ostream.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_OSTREAM -#include <bits/std_ostream.h> +#define _CPP_OSTREAM 1 + +#pragma GCC system_header + +#include <ios> + +namespace std +{ + // 27.6.2.1 Template class basic_ostream + template<typename _CharT, typename _Traits> + class basic_ostream : virtual public basic_ios<_CharT, _Traits> + { + public: + + // Types (inherited from basic_ios (27.4.4)): + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + // Non-standard Types: + typedef basic_streambuf<_CharT, _Traits> __streambuf_type; + typedef basic_ios<_CharT, _Traits> __ios_type; + typedef basic_ostream<_CharT, _Traits> __ostream_type; + typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter; + typedef num_put<_CharT, __ostreambuf_iter> __numput_type; + typedef ctype<_CharT> __ctype_type; + + // 27.6.2.2 Constructor/destructor: + explicit + basic_ostream(__streambuf_type* __sb) + { this->init(__sb); } + + virtual + ~basic_ostream() { } + + // 27.6.2.3 Prefix/suffix: + class sentry; + friend class sentry; + + // 27.6.2.5 Formatted output: + // 27.6.2.5.3 basic_ostream::operator<< + __ostream_type& + operator<<(__ostream_type& (*__pf)(__ostream_type&)); + + __ostream_type& + operator<<(__ios_type& (*__pf)(__ios_type&)); + + __ostream_type& + operator<<(ios_base& (*__pf) (ios_base&)); + + // 27.6.2.5.2 Arithmetic Inserters + __ostream_type& + operator<<(long __n); + + __ostream_type& + operator<<(unsigned long __n); + + __ostream_type& + operator<<(bool __n); + + __ostream_type& + operator<<(short __n) + { + ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; + if (__fmt & ios_base::oct || __fmt & ios_base::hex) + return this->operator<<(static_cast<unsigned long> + (static_cast<unsigned short>(__n))); + else + return this->operator<<(static_cast<long>(__n)); + } + + __ostream_type& + operator<<(unsigned short __n) + { return this->operator<<(static_cast<unsigned long>(__n)); } + + __ostream_type& + operator<<(int __n) + { + ios_base::fmtflags __fmt = this->flags() & ios_base::basefield; + if (__fmt & ios_base::oct || __fmt & ios_base::hex) + return this->operator<<(static_cast<unsigned long> + (static_cast<unsigned int>(__n))); + else + return this->operator<<(static_cast<long>(__n)); + } + + __ostream_type& + operator<<(unsigned int __n) + { return this->operator<<(static_cast<unsigned long>(__n)); } + +#ifdef _GLIBCPP_USE_LONG_LONG + __ostream_type& + operator<<(long long __n); + + __ostream_type& + operator<<(unsigned long long __n); +#endif + + __ostream_type& + operator<<(double __f); + + __ostream_type& + operator<<(float __f) + { return this->operator<<(static_cast<double>(__f)); } + + __ostream_type& + operator<<(long double __f); + + __ostream_type& + operator<<(const void* __p); + + __ostream_type& + operator<<(__streambuf_type* __sb); + + // Unformatted output: + __ostream_type& + put(char_type __c); + + __ostream_type& + write(const char_type* __s, streamsize __n); + + __ostream_type& + flush(); + + // Seeks: + pos_type + tellp(); + + __ostream_type& + seekp(pos_type); + + __ostream_type& + seekp(off_type, ios_base::seekdir); + + private: +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS + // Not defined. (Side effect of DR 50.) + __ostream_type& + operator=(const __ostream_type&); + + basic_ostream(const __ostream_type&); #endif + }; + + // 27.6.2.3 Class basic_ostream::sentry + template <typename _CharT, typename _Traits> + class basic_ostream<_CharT, _Traits>::sentry + { + // Data Members: + bool _M_ok; + basic_ostream<_CharT,_Traits>& _M_os; + + public: + explicit + sentry(basic_ostream<_CharT,_Traits>& __os); + + ~sentry() + { + // XXX MT + if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception()) + { + // Can't call flush directly or else will get into recursive lock. + if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1) + _M_os.setstate(ios_base::badbit); + } + } + + operator bool() + { return _M_ok; } + }; + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c); + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) + { return (__out << __out.widen(__c)); } + + // Specialization + template <class _Traits> + basic_ostream<char, _Traits>& + operator<<(basic_ostream<char, _Traits>& __out, char __c); + + // Signed and unsigned + template<class _Traits> + basic_ostream<char, _Traits>& + operator<<(basic_ostream<char, _Traits>& __out, signed char __c) + { return (__out << static_cast<char>(__c)); } + + template<class _Traits> + basic_ostream<char, _Traits>& + operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) + { return (__out << static_cast<char>(__c)); } + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s); + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits> & + operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); + + // Partial specializationss + template<class _Traits> + basic_ostream<char, _Traits>& + operator<<(basic_ostream<char, _Traits>& __out, const char* __s); + + // Signed and unsigned + template<class _Traits> + basic_ostream<char, _Traits>& + operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) + { return (__out << reinterpret_cast<const char*>(__s)); } + + template<class _Traits> + basic_ostream<char, _Traits> & + operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) + { return (__out << reinterpret_cast<const char*>(__s)); } + + // 27.6.2.7 Standard basic_ostream manipulators + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + endl(basic_ostream<_CharT, _Traits>& __os) + { return flush(__os.put(__os.widen('\n'))); } + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + ends(basic_ostream<_CharT, _Traits>& __os) + { return __os.put(_CharT()); } + + template<typename _CharT, typename _Traits> + basic_ostream<_CharT, _Traits>& + flush(basic_ostream<_CharT, _Traits>& __os) + { return __os.flush(); } + +} // namespace std + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# define export +#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS +# include <bits/ostream.tcc> +#endif +#endif + +#endif /* _CPP_OSTREAM */ + diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue index b3d9cdb..ecf7f4c 100644 --- a/libstdc++-v3/include/std/queue +++ b/libstdc++-v3/include/std/queue @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <queue> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,55 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file queue - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_queue.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_QUEUE -#include <bits/std_queue.h> -#endif +#define _CPP_QUEUE 1 + +#pragma GCC system_header +#include <bits/c++config.h> +#include <bits/functexcept.h> +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_vector.h> +#include <bits/stl_heap.h> +#include <bits/stl_deque.h> +#include <bits/stl_function.h> +#include <bits/stl_queue.h> + +#endif /* _CPP_QUEUE */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set index 414b04c..dab8e71 100644 --- a/libstdc++-v3/include/std/set +++ b/libstdc++-v3/include/std/set @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <set> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,48 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file set - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_set.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_SET -#include <bits/std_set.h> -#endif +#define _CPP_SET 1 + +#pragma GCC system_header + +#include <bits/stl_tree.h> +#include <bits/stl_set.h> +#include <bits/stl_multiset.h> + +#endif /* _CPP_SET */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream index 2a53e36..fb90986 100644 --- a/libstdc++-v3/include/std/sstream +++ b/libstdc++-v3/include/std/sstream @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// String based streams -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997-1999 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 @@ -27,11 +27,346 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file sstream - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.7 String-based streams +// + +/** @file std_sstream.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_SSTREAM -#include <bits/std_sstream.h> +#define _CPP_SSTREAM 1 + +#pragma GCC system_header + +#include <istream> +#include <ostream> + +namespace std +{ + template<typename _CharT, typename _Traits, typename _Alloc> + class basic_stringbuf : public basic_streambuf<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; +#endif + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard Types: + typedef basic_streambuf<char_type, traits_type> __streambuf_type; + typedef basic_string<char_type, _Traits, _Alloc> __string_type; + typedef typename __string_type::size_type __size_type; + + private: + // Data Members: + __string_type _M_string; + + public: + // Constructors: + explicit + basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out) + : __streambuf_type(), _M_string() + { _M_stringbuf_init(__mode); } + + explicit + basic_stringbuf(const __string_type& __str, + ios_base::openmode __mode = ios_base::in | ios_base::out) + : __streambuf_type(), _M_string(__str.data(), __str.size()) + { _M_stringbuf_init(__mode); } + + // Get and set: + __string_type + str() const + { + if (_M_mode & ios_base::out) + { + // This is the deal: _M_string.size() is a value that + // represents the size of the initial string that makes + // _M_string, and may not be the correct size of the + // current stringbuf internal buffer. + __size_type __len = _M_string.size(); + if (_M_out_cur > _M_out_beg) + __len = max(__size_type(_M_out_end - _M_out_beg), __len); + return __string_type(_M_out_beg, _M_out_beg + __len); + } + else + return _M_string; + } + + void + str(const __string_type& __s) + { + _M_string = __s; + _M_stringbuf_init(_M_mode); + } + + protected: + // Common initialization code for both ctors goes here. + void + _M_stringbuf_init(ios_base::openmode __mode) + { + // _M_buf_size is a convenient alias for "what the streambuf + // thinks the allocated size of the string really is." This is + // necessary as ostringstreams are implemented with the + // streambufs having control of the allocation and + // re-allocation of the internal string object, _M_string. + _M_buf_size = _M_string.size(); + + // NB: Start ostringstream buffers at 512 bytes. This is an + // experimental value (pronounced "arbitrary" in some of the + // hipper english-speaking countries), and can be changed to + // suite particular needs. + _M_buf_size_opt = 512; + _M_mode = __mode; + if (_M_mode & ios_base::ate) + _M_really_sync(0, _M_buf_size); + else + _M_really_sync(0, 0); + } + + // Overridden virtual functions: + virtual int_type + underflow() + { + if (_M_in_cur && _M_in_cur < _M_in_end) + return traits_type::to_int_type(*gptr()); + else + return traits_type::eof(); + } + + virtual int_type + pbackfail(int_type __c = traits_type::eof()); + + virtual int_type + overflow(int_type __c = traits_type::eof()); + + virtual __streambuf_type* + setbuf(char_type* __s, streamsize __n) + { + if (__s && __n) + { + _M_string = __string_type(__s, __n); + _M_really_sync(0, 0); + } + return this; + } + + virtual pos_type + seekoff(off_type __off, ios_base::seekdir __way, + ios_base::openmode __mode = ios_base::in | ios_base::out); + + virtual pos_type + seekpos(pos_type __sp, + ios_base::openmode __mode = ios_base::in | ios_base::out); + + // Internal function for correctly updating the internal buffer + // for a particular _M_string, due to initialization or + // re-sizing of an existing _M_string. + // Assumes: contents of _M_string and internal buffer match exactly. + // __i == _M_in_cur - _M_in_beg + // __o == _M_out_cur - _M_out_beg + virtual int + _M_really_sync(__size_type __i, __size_type __o) + { + char_type* __base = const_cast<char_type*>(_M_string.data()); + bool __testin = _M_mode & ios_base::in; + bool __testout = _M_mode & ios_base::out; + __size_type __len = _M_string.size(); + + _M_buf = __base; + if (__testin) + this->setg(__base, __base + __i, __base + __len); + if (__testout) + { + this->setp(__base, __base + __len); + _M_out_cur += __o; + } + return 0; + } + }; + + + // 27.7.2 Template class basic_istringstream + template<typename _CharT, typename _Traits, typename _Alloc> + class basic_istringstream : public basic_istream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; +#endif + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard types: + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; + typedef basic_istream<char_type, traits_type> __istream_type; + + private: + __stringbuf_type _M_stringbuf; + + public: + // Constructors: + explicit + basic_istringstream(ios_base::openmode __mode = ios_base::in) + : __istream_type(NULL), _M_stringbuf(__mode | ios_base::in) + { this->init(&_M_stringbuf); } + + explicit + basic_istringstream(const __string_type& __str, + ios_base::openmode __mode = ios_base::in) + : __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in) + { this->init(&_M_stringbuf); } + + ~basic_istringstream() + { } + + // Members: + __stringbuf_type* + rdbuf() const + { return const_cast<__stringbuf_type*>(&_M_stringbuf); } + + __string_type + str() const + { return _M_stringbuf.str(); } + + void + str(const __string_type& __s) + { _M_stringbuf.str(__s); } + }; + + + // 27.7.3 Template class basic_ostringstream + template <typename _CharT, typename _Traits, typename _Alloc> + class basic_ostringstream : public basic_ostream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; +#endif + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard types: + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; + typedef basic_ostream<char_type, traits_type> __ostream_type; + + private: + __stringbuf_type _M_stringbuf; + + public: + // Constructors/destructor: + explicit + basic_ostringstream(ios_base::openmode __mode = ios_base::out) + : __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out) + { this->init(&_M_stringbuf); } + + explicit + basic_ostringstream(const __string_type& __str, + ios_base::openmode __mode = ios_base::out) + : __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out) + { this->init(&_M_stringbuf); } + + ~basic_ostringstream() + { } + + // Members: + __stringbuf_type* + rdbuf() const + { return const_cast<__stringbuf_type*>(&_M_stringbuf); } + + __string_type + str() const + { return _M_stringbuf.str(); } + + void + str(const __string_type& __s) + { _M_stringbuf.str(__s); } + }; + + + // 27.7.4 Template class basic_stringstream + template <typename _CharT, typename _Traits, typename _Alloc> + class basic_stringstream : public basic_iostream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; #endif + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard Types: + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type; + typedef basic_iostream<char_type, traits_type> __iostream_type; + + private: + __stringbuf_type _M_stringbuf; + + public: + // Constructors/destructors + explicit + basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in) + : __iostream_type(NULL), _M_stringbuf(__m) + { this->init(&_M_stringbuf); } + + explicit + basic_stringstream(const __string_type& __str, + ios_base::openmode __m = ios_base::out | ios_base::in) + : __iostream_type(NULL), _M_stringbuf(__str, __m) + { this->init(&_M_stringbuf); } + + ~basic_stringstream() + { } + + // Members: + __stringbuf_type* + rdbuf() const + { return const_cast<__stringbuf_type*>(&_M_stringbuf); } + + __string_type + str() const + { return _M_stringbuf.str(); } + + void + str(const __string_type& __s) + { _M_stringbuf.str(__s); } + }; +} // namespace std + + + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# define export +#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS +# include <bits/sstream.tcc> +#endif +#endif + +#endif // _CPP_SSTREAM diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack index e901f84..166f428 100644 --- a/libstdc++-v3/include/std/stack +++ b/libstdc++-v3/include/std/stack @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <stack> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,51 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file stack - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_stack.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_STACK -#include <bits/std_stack.h> -#endif +#define _CPP_STACK 1 + +#pragma GCC system_header + +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_deque.h> +#include <bits/stl_stack.h> + +#endif /* _CPP_STACK */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept index 03e89e8..66bac50 100644 --- a/libstdc++-v3/include/std/stdexcept +++ b/libstdc++-v3/include/std/stdexcept @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// Standard exception classes -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,124 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file stdexcept - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 19.1 Exception classes +// + +/** @file std_stdexcept.h + * The Standard C++ library provides classes to be used to report certain + * errors (17.4.4.8) in C++ programs. In the error model reflected in these + * classes, errors are divided into two broad categories: logic errors and + * runtime errors. */ #ifndef _CPP_STDEXCEPT -#include <bits/std_stdexcept.h> -#endif +#define _CPP_STDEXCEPT 1 + +#pragma GCC system_header + +#include <exception> +#include <string> + +namespace std +{ + /** Logic errors represent problems in the internal logic of a program; + * in theory, these are preventable, and even detectable before the + * program runs (e.g., violations of class invariants). + * @brief One of two subclasses of exception. + */ + class logic_error : public exception + { + string _M_msg; + + public: + /** Takes a character string describing the error. */ + explicit + logic_error(const string& __arg); + + virtual + ~logic_error() throw(); + + /** Returns a C-style character string describing the general cause of + * the current error (the same string passed to the ctor). */ + virtual const char* + what() const throw(); + }; + + /** Thrown by the library, or by you, to report domain errors (domain in + * the mathmatical sense). */ + class domain_error : public logic_error + { + public: + explicit domain_error(const string& __arg); + }; + + /** Thrown to report invalid arguments to functions. */ + class invalid_argument : public logic_error + { + public: + explicit invalid_argument(const string& __arg); + }; + + /** Thrown when an object is constructed that would exceed its maximum + * permitted size (e.g., a basic_string instance). */ + class length_error : public logic_error + { + public: + explicit length_error(const string& __arg); + }; + + /** This represents an argument whose value is not within the expected + * range (e.g., boundary checks in basic_string). */ + class out_of_range : public logic_error + { + public: + explicit out_of_range(const string& __arg); + }; + + /** Runtime errors represent problems outside the scope of a program; + * they cannot be easily predicted and can generally only be caught as + * the program executes. + * @brief One of two subclasses of exception. + */ + class runtime_error : public exception + { + string _M_msg; + + public: + /** Takes a character string describing the error. */ + explicit + runtime_error(const string& __arg); + + virtual + ~runtime_error() throw(); + + /** Returns a C-style character string describing the general cause of + * the current error (the same string passed to the ctor). */ + virtual const char* + what() const throw(); + }; + + /** Thrown to indicate range errors in internal computations. */ + class range_error : public runtime_error + { + public: + explicit range_error(const string& __arg); + }; + + /** Thrown to indicate arithmetic overflow. */ + class overflow_error : public runtime_error + { + public: + explicit overflow_error(const string& __arg); + }; + + /** Thrown to indicate arithmetic underflow. */ + class underflow_error : public runtime_error + { + public: + explicit underflow_error(const string& __arg); + }; +} // namespace std + +#endif // _CPP_STDEXCEPT diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf index c0f4dd7..59f7070 100644 --- a/libstdc++-v3/include/std/streambuf +++ b/libstdc++-v3/include/std/streambuf @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Stream buffer classes -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -27,11 +27,514 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file streambuf - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 27.5 Stream buffers +// + +/** @file std_streambuf.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_STREAMBUF -#include <bits/std_streambuf.h> +#define _CPP_STREAMBUF 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <iosfwd> +#include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END +#include <bits/localefwd.h> +#include <bits/ios_base.h> + +namespace std +{ + template<typename _CharT, typename _Traits> + streamsize + __copy_streambufs(basic_ios<_CharT, _Traits>& _ios, + basic_streambuf<_CharT, _Traits>* __sbin, + basic_streambuf<_CharT, _Traits>* __sbout); + + // 27.5.2 Template class basic_streambuf<_CharT, _Traits> + template<typename _CharT, typename _Traits> + class basic_streambuf + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + // Non-standard Types: + typedef ctype<char_type> __ctype_type; + typedef basic_streambuf<char_type, traits_type> __streambuf_type; + + friend class basic_ios<char_type, traits_type>; + friend class basic_istream<char_type, traits_type>; + friend class basic_ostream<char_type, traits_type>; + friend class istreambuf_iterator<char_type, traits_type>; + friend class ostreambuf_iterator<char_type, traits_type>; + + friend streamsize + __copy_streambufs<>(basic_ios<char_type, traits_type>& __ios, + __streambuf_type* __sbin,__streambuf_type* __sbout); + + protected: + + // Pointer to the beginning of internally-allocated + // space. Filebuf manually allocates/deallocates this, whereas + // stringstreams attempt to use the built-in intelligence of the + // string class. If you are managing memory, set this. If not, + // leave it NULL. + char_type* _M_buf; + + // Actual size of allocated internal buffer, in bytes. + int_type _M_buf_size; + + // Optimal or preferred size of internal buffer, in bytes. + int_type _M_buf_size_opt; + + // True iff _M_in_* and _M_out_* buffers should always point to + // the same place. True for fstreams, false for sstreams. + bool _M_buf_unified; + + // This is based on _IO_FILE, just reordered to be more + // consistent, and is intended to be the most minimal abstraction + // for an internal buffer. + // get == input == read + // put == output == write + char_type* _M_in_beg; // Start of get area. + char_type* _M_in_cur; // Current read area. + char_type* _M_in_end; // End of get area. + char_type* _M_out_beg; // Start of put area. + char_type* _M_out_cur; // Current put area. + char_type* _M_out_end; // End of put area. + + // Place to stash in || out || in | out settings for current streambuf. + ios_base::openmode _M_mode; + + // Current locale setting. + locale _M_buf_locale; + + // True iff locale is initialized. + bool _M_buf_locale_init; + + // Necessary bits for putback buffer management. Only used in + // the basic_filebuf class, as necessary for the standard + // requirements. The only basic_streambuf member function that + // needs access to these data members is in_avail... + // NB: pbacks of over one character are not currently supported. + int_type _M_pback_size; + char_type* _M_pback; + char_type* _M_pback_cur_save; + char_type* _M_pback_end_save; + bool _M_pback_init; + + // Initializes pback buffers, and moves normal buffers to safety. + // Assumptions: + // _M_in_cur has already been moved back + void + _M_pback_create() + { + if (!_M_pback_init) + { + int_type __dist = _M_in_end - _M_in_cur; + int_type __len = min(_M_pback_size, __dist); + traits_type::copy(_M_pback, _M_in_cur, __len); + _M_pback_cur_save = _M_in_cur; + _M_pback_end_save = _M_in_end; + this->setg(_M_pback, _M_pback, _M_pback + __len); + _M_pback_init = true; + } + } + + // Deactivates pback buffer contents, and restores normal buffer. + // Assumptions: + // The pback buffer has only moved forward. + void + _M_pback_destroy() + { + if (_M_pback_init) + { + // Length _M_in_cur moved in the pback buffer. + int_type __off_cur = _M_in_cur - _M_pback; + + // For in | out buffers, the end can be pushed back... + int_type __off_end = 0; + int_type __pback_len = _M_in_end - _M_pback; + int_type __save_len = _M_pback_end_save - _M_buf; + if (__pback_len > __save_len) + __off_end = __pback_len - __save_len; + + this->setg(_M_buf, _M_pback_cur_save + __off_cur, + _M_pback_end_save + __off_end); + _M_pback_cur_save = NULL; + _M_pback_end_save = NULL; + _M_pback_init = false; + } + } + + // Correctly sets the _M_in_cur pointer, and bumps the + // _M_out_cur pointer as well if necessary. + void + _M_in_cur_move(off_type __n) // argument needs to be +- + { + bool __testout = _M_out_cur; + _M_in_cur += __n; + if (__testout && _M_buf_unified) + _M_out_cur += __n; + } + + // Correctly sets the _M_out_cur pointer, and bumps the + // appropriate _M_*_end pointers as well. Necessary for the + // un-tied stringbufs, in in|out mode. + // Invariant: + // __n + _M_out_[cur, end] <= _M_buf + _M_buf_size + // Assuming all _M_*_[beg, cur, end] pointers are operating on + // the same range: + // _M_buf <= _M_*_ <= _M_buf + _M_buf_size + void + _M_out_cur_move(off_type __n) // argument needs to be +- + { + bool __testin = _M_in_cur; + + _M_out_cur += __n; + if (__testin && _M_buf_unified) + _M_in_cur += __n; + if (_M_out_cur > _M_out_end) + { + _M_out_end = _M_out_cur; + // NB: in | out buffers drag the _M_in_end pointer along... + if (__testin) + _M_in_end += __n; + } + } + + // Return the size of the output buffer. This depends on the + // buffer in use: allocated buffers have a stored size in + // _M_buf_size and setbuf() buffers don't. + off_type + _M_out_buf_size() + { + off_type __ret = 0; + if (_M_out_cur) + { + // Using allocated buffer. + if (_M_out_beg == _M_buf) + __ret = _M_out_beg + _M_buf_size - _M_out_cur; + // Using non-allocated buffer. + else + __ret = _M_out_end - _M_out_cur; + } + return __ret; + } + + // These three functions are used to clarify internal buffer + // maintenance. After an overflow, or after a seekoff call that + // started at beg or end, or possibly when the stream becomes + // unbuffered, and a myrid other obscure corner cases, the + // internal buffer does not truly reflect the contents of the + // external buffer. At this point, for whatever reason, it is in + // an indeterminate state. + void + _M_set_indeterminate(void) + { + if (_M_mode & ios_base::in) + this->setg(_M_buf, _M_buf, _M_buf); + if (_M_mode & ios_base::out) + this->setp(_M_buf, _M_buf); + } + + void + _M_set_determinate(off_type __off) + { + bool __testin = _M_mode & ios_base::in; + bool __testout = _M_mode & ios_base::out; + if (__testin) + this->setg(_M_buf, _M_buf, _M_buf + __off); + if (__testout) + this->setp(_M_buf, _M_buf + __off); + } + + bool + _M_is_indeterminate(void) + { + bool __ret = false; + // Don't return true if unbuffered. + if (_M_buf) + { + if (_M_mode & ios_base::in) + __ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end; + if (_M_mode & ios_base::out) + __ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end; + } + return __ret; + } + + public: + virtual + ~basic_streambuf() + { + _M_buf_unified = false; + _M_buf_size = 0; + _M_buf_size_opt = 0; + _M_mode = ios_base::openmode(0); + _M_buf_locale_init = false; + } + + // Locales: + locale + pubimbue(const locale &__loc) + { + locale __tmp(this->getloc()); + this->imbue(__loc); + return __tmp; + } + + locale + getloc() const + { + if (_M_buf_locale_init) + return _M_buf_locale; + else + return locale(); + } + + // Buffer and positioning: + __streambuf_type* + pubsetbuf(char_type* __s, streamsize __n) + { return this->setbuf(__s, __n); } + + pos_type + pubseekoff(off_type __off, ios_base::seekdir __way, + ios_base::openmode __mode = ios_base::in | ios_base::out) + { return this->seekoff(__off, __way, __mode); } + + pos_type + pubseekpos(pos_type __sp, + ios_base::openmode __mode = ios_base::in | ios_base::out) + { return this->seekpos(__sp, __mode); } + + int + pubsync() { return this->sync(); } + + // Get and put areas: + // Get area: + streamsize + in_avail() + { + streamsize __ret; + if (_M_in_cur && _M_in_cur < _M_in_end) + { + if (_M_pback_init) + { + int_type __save_len = _M_pback_end_save - _M_pback_cur_save; + int_type __pback_len = _M_in_cur - _M_pback; + __ret = __save_len - __pback_len; + } + else + __ret = this->egptr() - this->gptr(); + } + else + __ret = this->showmanyc(); + return __ret; + } + + int_type + snextc() + { + int_type __eof = traits_type::eof(); + return (this->sbumpc() == __eof ? __eof : this->sgetc()); + } + + int_type + sbumpc(); + + int_type + sgetc() + { + int_type __ret; + if (_M_in_cur && _M_in_cur < _M_in_end) + __ret = traits_type::to_int_type(*(this->gptr())); + else + __ret = this->underflow(); + return __ret; + } + + streamsize + sgetn(char_type* __s, streamsize __n) + { return this->xsgetn(__s, __n); } + + // Putback: + int_type + sputbackc(char_type __c); + + int_type + sungetc(); + + // Put area: + int_type + sputc(char_type __c); + + streamsize + sputn(const char_type* __s, streamsize __n) + { return this->xsputn(__s, __n); } + + protected: + basic_streambuf() + : _M_buf(NULL), _M_buf_size(0), + _M_buf_size_opt(static_cast<int_type>(BUFSIZ)), _M_buf_unified(false), + _M_in_beg(0), _M_in_cur(0), _M_in_end(0), _M_out_beg(0), _M_out_cur(0), + _M_out_end(0), _M_mode(ios_base::openmode(0)), _M_buf_locale(locale()), + _M_buf_locale_init(false), _M_pback_size(1), _M_pback(NULL), + _M_pback_cur_save(NULL), _M_pback_end_save(NULL), _M_pback_init(false) + { } + + // Get area: + char_type* + eback() const { return _M_in_beg; } + + char_type* + gptr() const { return _M_in_cur; } + + char_type* + egptr() const { return _M_in_end; } + + void + gbump(int __n) { _M_in_cur += __n; } + + void + setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) + { + _M_in_beg = __gbeg; + _M_in_cur = __gnext; + _M_in_end = __gend; + if (!(_M_mode & ios_base::in) && __gbeg && __gnext && __gend) + _M_mode = _M_mode | ios_base::in; + } + + // Put area: + char_type* + pbase() const { return _M_out_beg; } + + char_type* + pptr() const { return _M_out_cur; } + + char_type* + epptr() const { return _M_out_end; } + + void + pbump(int __n) { _M_out_cur += __n; } + + void + setp(char_type* __pbeg, char_type* __pend) + { + _M_out_beg = _M_out_cur = __pbeg; + _M_out_end = __pend; + if (!(_M_mode & ios_base::out) && __pbeg && __pend) + _M_mode = _M_mode | ios_base::out; + } + + // Virtual functions: + // Locales: + virtual void + imbue(const locale& __loc) + { + _M_buf_locale_init = true; + if (_M_buf_locale != __loc) + _M_buf_locale = __loc; + } + + // Buffer management and positioning: + virtual basic_streambuf<char_type,_Traits>* + setbuf(char_type*, streamsize) + { return this; } + + virtual pos_type + seekoff(off_type, ios_base::seekdir, + ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) + { return pos_type(off_type(-1)); } + + virtual pos_type + seekpos(pos_type, + ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out) + { return pos_type(off_type(-1)); } + + virtual int + sync() { return 0; } + + // Get area: + virtual streamsize + showmanyc() { return 0; } + + virtual streamsize + xsgetn(char_type* __s, streamsize __n); + + virtual int_type + underflow() + { return traits_type::eof(); } + + virtual int_type + uflow() + { + int_type __ret = traits_type::eof(); + bool __testeof = this->underflow() == __ret; + bool __testpending = _M_in_cur && _M_in_cur < _M_in_end; + if (!__testeof && __testpending) + { + __ret = traits_type::to_int_type(*_M_in_cur); + ++_M_in_cur; + if (_M_buf_unified && _M_mode & ios_base::out) + ++_M_out_cur; + } + return __ret; + } + + // Putback: + virtual int_type + pbackfail(int_type /* __c */ = traits_type::eof()) + { return traits_type::eof(); } + + // Put area: + virtual streamsize + xsputn(const char_type* __s, streamsize __n); + + virtual int_type + overflow(int_type /* __c */ = traits_type::eof()) + { return traits_type::eof(); } + +#ifdef _GLIBCPP_DEPRECATED + public: + void + stossc() + { + if (_M_in_cur < _M_in_end) + ++_M_in_cur; + else + this->uflow(); + } #endif + +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS + // Side effect of DR 50. + private: + basic_streambuf(const __streambuf_type&); + + __streambuf_type& + operator=(const __streambuf_type&); +#endif + }; + +} // namespace std + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# define export +#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS +#include <bits/streambuf.tcc> +#endif +#endif + +#endif /* _CPP_STREAMBUF */ + diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string index 0229afd..9cdc533 100644 --- a/libstdc++-v3/include/std/string +++ b/libstdc++-v3/include/std/string @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// Components for manipulating sequences of characters -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -27,11 +27,34 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file string - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// +// ISO C++ 14882: 21 Strings library +// + +/** @file std_string.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_STRING -#include <bits/std_string.h> +#define _CPP_STRING 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <bits/stringfwd.h> +#include <bits/char_traits.h> +#include <memory> // For allocator. +#include <bits/type_traits.h> +#include <iosfwd> // For operators >>, <<, and getline decls. +#include <bits/stl_iterator.h> +#include <bits/stl_function.h> // For less +#include <bits/basic_string.h> + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# include <algorithm> // for find_if +# include <bits/basic_string.tcc> #endif + +#endif /* _CPP_STRING */ + diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 28822fa..5917c83 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <utility> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,47 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file utility - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_utility.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_UTILITY -#include <bits/std_utility.h> -#endif +#define _CPP_UTILITY 1 + +#pragma GCC system_header +#include <bits/c++config.h> +#include <bits/stl_relops.h> +#include <bits/stl_pair.h> + +#endif /* _CPP_UTILITY */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray index e20b7b8..a354708 100644 --- a/libstdc++-v3/include/std/valarray +++ b/libstdc++-v3/include/std/valarray @@ -1,6 +1,6 @@ -// -*- C++ -*- std header. +// The template and inlines for the -*- C++ -*- valarray class. -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2000, 2001 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 @@ -27,11 +27,716 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file valarray - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> + +/** @file std_valarray.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_VALARRAY -#include <bits/std_valarray.h> -#endif +#define _CPP_VALARRAY 1 + +#pragma GCC system_header + +#include <bits/c++config.h> +#include <cstddef> +#include <cmath> +#include <cstdlib> +#include <numeric> +#include <functional> +#include <algorithm> + +namespace std +{ + template<class _Clos, typename _Tp> class _Expr; + + template<typename _Tp1, typename _Tp2> class _ValArray; + + template<template<class> class _Oper, + template<class, class> class _Meta, class _Dom> struct _UnClos; + + template<template<class> class _Oper, + template<class, class> class _Meta1, + template<class, class> class _Meta2, + class _Dom1, class _Dom2> class _BinClos; + + template<template<class, class> class _Meta, class _Dom> class _SClos; + + template<template<class, class> class _Meta, class _Dom> class _GClos; + + template<template<class, class> class _Meta, class _Dom> class _IClos; + + template<template<class, class> class _Meta, class _Dom> class _ValFunClos; + + template<template<class, class> class _Meta, class _Dom> class _RefFunClos; + + template<class _Tp> struct _Unary_plus; + template<class _Tp> struct _Bitwise_and; + template<class _Tp> struct _Bitwise_or; + template<class _Tp> struct _Bitwise_xor; + template<class _Tp> struct _Bitwise_not; + template<class _Tp> struct _Shift_left; + template<class _Tp> struct _Shift_right; + + template<class _Tp> class valarray; // An array of type _Tp + class slice; // BLAS-like slice out of an array + template<class _Tp> class slice_array; + class gslice; // generalized slice out of an array + template<class _Tp> class gslice_array; + template<class _Tp> class mask_array; // masked array + template<class _Tp> class indirect_array; // indirected array + +} // namespace std + +#include <bits/valarray_array.h> +#include <bits/valarray_meta.h> + +namespace std +{ + template<class _Tp> class valarray + { + public: + typedef _Tp value_type; + + // _lib.valarray.cons_ construct/destroy: + valarray(); + explicit valarray(size_t); + valarray(const _Tp&, size_t); + valarray(const _Tp* __restrict__, size_t); + valarray(const valarray&); + valarray(const slice_array<_Tp>&); + valarray(const gslice_array<_Tp>&); + valarray(const mask_array<_Tp>&); + valarray(const indirect_array<_Tp>&); + template<class _Dom> + valarray(const _Expr<_Dom,_Tp>& __e); + ~valarray(); + + // _lib.valarray.assign_ assignment: + valarray<_Tp>& operator=(const valarray<_Tp>&); + valarray<_Tp>& operator=(const _Tp&); + valarray<_Tp>& operator=(const slice_array<_Tp>&); + valarray<_Tp>& operator=(const gslice_array<_Tp>&); + valarray<_Tp>& operator=(const mask_array<_Tp>&); + valarray<_Tp>& operator=(const indirect_array<_Tp>&); + + template<class _Dom> valarray<_Tp>& + operator= (const _Expr<_Dom,_Tp>&); + + // _lib.valarray.access_ element access: + // XXX: LWG to be resolved. + const _Tp& operator[](size_t) const; + _Tp& operator[](size_t); + // _lib.valarray.sub_ subset operations: + _Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const; + slice_array<_Tp> operator[](slice); + _Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const; + gslice_array<_Tp> operator[](const gslice&); + valarray<_Tp> operator[](const valarray<bool>&) const; + mask_array<_Tp> operator[](const valarray<bool>&); + _Expr<_IClos<_ValArray, _Tp>, _Tp> + operator[](const valarray<size_t>&) const; + indirect_array<_Tp> operator[](const valarray<size_t>&); + + // _lib.valarray.unary_ unary operators: + _Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const; + _Expr<_UnClos<negate,_ValArray,_Tp>,_Tp> operator- () const; + _Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const; + _Expr<_UnClos<logical_not,_ValArray,_Tp>,bool> operator! () const; + + // _lib.valarray.cassign_ computed assignment: + valarray<_Tp>& operator*= (const _Tp&); + valarray<_Tp>& operator/= (const _Tp&); + valarray<_Tp>& operator%= (const _Tp&); + valarray<_Tp>& operator+= (const _Tp&); + valarray<_Tp>& operator-= (const _Tp&); + valarray<_Tp>& operator^= (const _Tp&); + valarray<_Tp>& operator&= (const _Tp&); + valarray<_Tp>& operator|= (const _Tp&); + valarray<_Tp>& operator<<=(const _Tp&); + valarray<_Tp>& operator>>=(const _Tp&); + valarray<_Tp>& operator*= (const valarray<_Tp>&); + valarray<_Tp>& operator/= (const valarray<_Tp>&); + valarray<_Tp>& operator%= (const valarray<_Tp>&); + valarray<_Tp>& operator+= (const valarray<_Tp>&); + valarray<_Tp>& operator-= (const valarray<_Tp>&); + valarray<_Tp>& operator^= (const valarray<_Tp>&); + valarray<_Tp>& operator|= (const valarray<_Tp>&); + valarray<_Tp>& operator&= (const valarray<_Tp>&); + valarray<_Tp>& operator<<=(const valarray<_Tp>&); + valarray<_Tp>& operator>>=(const valarray<_Tp>&); + + template<class _Dom> + valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&); + template<class _Dom> + valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&); + + + // _lib.valarray.members_ member functions: + size_t size() const; + _Tp sum() const; + _Tp min() const; + _Tp max() const; + +// // FIXME: Extension +// _Tp product () const; + + valarray<_Tp> shift (int) const; + valarray<_Tp> cshift(int) const; + _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const; + _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const; + void resize(size_t __size, _Tp __c = _Tp()); + + private: + size_t _M_size; + _Tp* __restrict__ _M_data; + + friend class _Array<_Tp>; + }; + + + template<typename _Tp> struct _Unary_plus : unary_function<_Tp,_Tp> { + _Tp operator() (const _Tp& __t) const { return __t; } + }; + + template<typename _Tp> struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; } + }; + + template<typename _Tp> struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; } + }; + + template<typename _Tp> struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; } + }; + + template<typename _Tp> struct _Bitwise_not : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __t) const { return ~__t; } + }; + + template<typename _Tp> struct _Shift_left : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; } + }; + + template<typename _Tp> struct _Shift_right : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; } + }; + + + template<typename _Tp> + inline const _Tp& + valarray<_Tp>::operator[] (size_t __i) const + { return _M_data[__i]; } + + template<typename _Tp> + inline _Tp& + valarray<_Tp>::operator[] (size_t __i) + { return _M_data[__i]; } + +} // std:: + +#include <bits/slice.h> +#include <bits/slice_array.h> +#include <bits/gslice.h> +#include <bits/gslice_array.h> +#include <bits/mask_array.h> +#include <bits/indirect_array.h> + +namespace std +{ + template<typename _Tp> + inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {} + + template<typename _Tp> + inline valarray<_Tp>::valarray (size_t __n) + : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) + { __valarray_default_construct(_M_data, _M_data + __n); } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const _Tp& __t, size_t __n) + : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) + { __valarray_fill_construct (_M_data, _M_data + __n, __t); } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const _Tp* __restrict__ __p, size_t __n) + : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) + { __valarray_copy_construct (__p, __p + __n, _M_data); } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const valarray<_Tp>& __v) + : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size)) + { __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const slice_array<_Tp>& __sa) + : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz)) + { + __valarray_copy + (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data)); + } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const gslice_array<_Tp>& __ga) + : _M_size(__ga._M_index.size()), + _M_data(__valarray_get_storage<_Tp>(_M_size)) + { + __valarray_copy + (__ga._M_array, _Array<size_t>(__ga._M_index), + _Array<_Tp>(_M_data), _M_size); + } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const mask_array<_Tp>& __ma) + : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz)) + { + __valarray_copy + (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size); + } + + template<typename _Tp> + inline valarray<_Tp>::valarray (const indirect_array<_Tp>& __ia) + : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz)) + { + __valarray_copy + (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size); + } + + template<typename _Tp> template<class _Dom> + inline valarray<_Tp>::valarray (const _Expr<_Dom, _Tp>& __e) + : _M_size(__e.size ()), _M_data(__valarray_get_storage<_Tp>(_M_size)) + { __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); } + + template<typename _Tp> + inline valarray<_Tp>::~valarray () + { + __valarray_destroy_elements(_M_data, _M_data + _M_size); + __valarray_release_memory(_M_data); + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const valarray<_Tp>& __v) + { + __valarray_copy(__v._M_data, _M_size, _M_data); + return *this; + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const _Tp& __t) + { + __valarray_fill (_M_data, _M_size, __t); + return *this; + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const slice_array<_Tp>& __sa) + { + __valarray_copy (__sa._M_array, __sa._M_sz, + __sa._M_stride, _Array<_Tp>(_M_data)); + return *this; + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga) + { + __valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index), + _Array<_Tp>(_M_data), _M_size); + return *this; + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const mask_array<_Tp>& __ma) + { + __valarray_copy (__ma._M_array, __ma._M_mask, + _Array<_Tp>(_M_data), _M_size); + return *this; + } + + template<typename _Tp> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const indirect_array<_Tp>& __ia) + { + __valarray_copy (__ia._M_array, __ia._M_index, + _Array<_Tp>(_M_data), _M_size); + return *this; + } + + template<typename _Tp> template<class _Dom> + inline valarray<_Tp>& + valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e) + { + __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); + return *this; + } + + template<typename _Tp> + inline _Expr<_SClos<_ValArray,_Tp>, _Tp> + valarray<_Tp>::operator[] (slice __s) const + { + typedef _SClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure, _Tp> (_Closure (_Array<_Tp>(_M_data), __s)); + } + + template<typename _Tp> + inline slice_array<_Tp> + valarray<_Tp>::operator[] (slice __s) + { + return slice_array<_Tp> (_Array<_Tp>(_M_data), __s); + } + + template<typename _Tp> + inline _Expr<_GClos<_ValArray,_Tp>, _Tp> + valarray<_Tp>::operator[] (const gslice& __gs) const + { + typedef _GClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure, _Tp> + (_Closure (_Array<_Tp>(_M_data), __gs._M_index->_M_index)); + } + + template<typename _Tp> + inline gslice_array<_Tp> + valarray<_Tp>::operator[] (const gslice& __gs) + { + return gslice_array<_Tp> + (_Array<_Tp>(_M_data), __gs._M_index->_M_index); + } + + template<typename _Tp> + inline valarray<_Tp> + valarray<_Tp>::operator[] (const valarray<bool>& __m) const + { + size_t __s (0); + size_t __e (__m.size ()); + for (size_t __i=0; __i<__e; ++__i) + if (__m[__i]) ++__s; + return valarray<_Tp> (mask_array<_Tp> (_Array<_Tp>(_M_data), __s, + _Array<bool> (__m))); + } + + template<typename _Tp> + inline mask_array<_Tp> + valarray<_Tp>::operator[] (const valarray<bool>& __m) + { + size_t __s (0); + size_t __e (__m.size ()); + for (size_t __i=0; __i<__e; ++__i) + if (__m[__i]) ++__s; + return mask_array<_Tp> (_Array<_Tp>(_M_data), __s, _Array<bool> (__m)); + } + + template<typename _Tp> + inline _Expr<_IClos<_ValArray,_Tp>, _Tp> + valarray<_Tp>::operator[] (const valarray<size_t>& __i) const + { + typedef _IClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure, _Tp> (_Closure (*this, __i)); + } + + template<typename _Tp> + inline indirect_array<_Tp> + valarray<_Tp>::operator[] (const valarray<size_t>& __i) + { + return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(), + _Array<size_t> (__i)); + } + + template<class _Tp> + inline size_t valarray<_Tp>::size () const { return _M_size; } + + template<class _Tp> + inline _Tp + valarray<_Tp>::sum () const + { + return __valarray_sum(_M_data, _M_data + _M_size); + } + +// template<typename _Tp> +// inline _Tp +// valarray<_Tp>::product () const +// { +// return __valarray_product(_M_data, _M_data + _M_size); +// } + + template <class _Tp> + inline valarray<_Tp> + valarray<_Tp>::shift(int __n) const + { + _Tp* const __a = static_cast<_Tp*> + (__builtin_alloca(sizeof(_Tp) * _M_size)); + if (__n == 0) // no shift + __valarray_copy_construct(_M_data, _M_data + _M_size, __a); + else if (__n > 0) // __n > 0: shift left + { + if (size_t(__n) > _M_size) + __valarray_default_construct(__a, __a + __n); + else + { + __valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); + __valarray_default_construct(__a+_M_size-__n, __a + _M_size); + } + } + else // __n < 0: shift right + { + __valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n); + __valarray_default_construct(__a, __a - __n); + } + return valarray<_Tp> (__a, _M_size); + } + + template <class _Tp> + inline valarray<_Tp> + valarray<_Tp>::cshift (int __n) const + { + _Tp* const __a = static_cast<_Tp*> + (__builtin_alloca (sizeof(_Tp) * _M_size)); + if (__n == 0) // no cshift + __valarray_copy_construct(_M_data, _M_data + _M_size, __a); + else if (__n > 0) // cshift left + { + __valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n); + __valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); + } + else // cshift right + { + __valarray_copy_construct + (_M_data + _M_size+__n, _M_data + _M_size, __a); + __valarray_copy_construct + (_M_data, _M_data + _M_size+__n, __a - __n); + } + return valarray<_Tp>(__a, _M_size); + } + + template <class _Tp> + inline void + valarray<_Tp>::resize (size_t __n, _Tp __c) + { + // This complication is so to make valarray<valarray<T> > work + // even though it is not required by the standard. Nobody should + // be saying valarray<valarray<T> > anyway. See the specs. + __valarray_destroy_elements(_M_data, _M_data + _M_size); + if (_M_size != __n) + { + __valarray_release_memory(_M_data); + _M_size = __n; + _M_data = __valarray_get_storage<_Tp>(__n); + } + __valarray_fill_construct(_M_data, _M_data + __n, __c); + } + + template<typename _Tp> + inline _Tp + valarray<_Tp>::min() const + { + return *min_element (_M_data, _M_data+_M_size); + } + + template<typename _Tp> + inline _Tp + valarray<_Tp>::max() const + { + return *max_element (_M_data, _M_data+_M_size); + } + + template<class _Tp> + inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp> + valarray<_Tp>::apply (_Tp func (_Tp)) const + { + typedef _ValFunClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure,_Tp> (_Closure (*this, func)); + } + + template<class _Tp> + inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp> + valarray<_Tp>::apply (_Tp func (const _Tp &)) const + { + typedef _RefFunClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure,_Tp> (_Closure (*this, func)); + } + +#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \ + template<typename _Tp> \ + inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \ + valarray<_Tp>::operator _Op() const \ + { \ + typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \ + return _Expr<_Closure, _Tp> (_Closure (*this)); \ + } + + _DEFINE_VALARRAY_UNARY_OPERATOR(+, _Unary_plus) + _DEFINE_VALARRAY_UNARY_OPERATOR(-, negate) + _DEFINE_VALARRAY_UNARY_OPERATOR(~, _Bitwise_not) + +#undef _DEFINE_VALARRAY_UNARY_OPERATOR + + template<typename _Tp> + inline _Expr<_UnClos<logical_not,_ValArray,_Tp>, bool> + valarray<_Tp>::operator!() const + { + typedef _UnClos<logical_not,_ValArray,_Tp> _Closure; + return _Expr<_Closure, bool> (_Closure (*this)); + } + +#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \ + template<class _Tp> \ + inline valarray<_Tp> & \ + valarray<_Tp>::operator _Op##= (const _Tp &__t) \ + { \ + _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \ + return *this; \ + } \ + \ + template<class _Tp> \ + inline valarray<_Tp> & \ + valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v) \ + { \ + _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \ + _Array<_Tp>(__v._M_data)); \ + return *this; \ + } + +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, plus) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, minus) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, multiplies) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, divides) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, modulus) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, xor) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, and) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, or) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, shift_left) +_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right) + +#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT + + +} // std:: + + +namespace std +{ + +#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \ + template<class _Tp> template<class _Dom> \ + inline valarray<_Tp> & \ + valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e) \ + { \ + _Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \ + return *this; \ + } + +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, plus) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, minus) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, multiplies) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, divides) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, modulus) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, xor) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, and) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, or) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, shift_left) +_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right) + +#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT + + +#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \ + template<typename _Tp> \ + inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \ + operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \ + { \ + typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \ + } \ + \ + template<typename _Tp> \ + inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \ + operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \ + { \ + typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \ + } \ + \ + template<typename _Tp> \ + inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \ + operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \ + { \ + typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \ + } + +_DEFINE_BINARY_OPERATOR(+, plus) +_DEFINE_BINARY_OPERATOR(-, minus) +_DEFINE_BINARY_OPERATOR(*, multiplies) +_DEFINE_BINARY_OPERATOR(/, divides) +_DEFINE_BINARY_OPERATOR(%, modulus) +_DEFINE_BINARY_OPERATOR(^, _Bitwise_xor) +_DEFINE_BINARY_OPERATOR(&, _Bitwise_and) +_DEFINE_BINARY_OPERATOR(|, _Bitwise_or) +_DEFINE_BINARY_OPERATOR(<<, _Shift_left) +_DEFINE_BINARY_OPERATOR(>>, _Shift_right) + +#undef _DEFINE_BINARY_OPERATOR + +#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \ + template<typename _Tp> \ + inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \ + operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \ + { \ + typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, bool> (_Closure (__v, __w)); \ + } \ + \ + template<class _Tp> \ + inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \ + operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \ + { \ + typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, bool> (_Closure (__v, __t)); \ + } \ + \ + template<class _Tp> \ + inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \ + operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \ + { \ + typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \ + return _Expr<_Closure, bool> (_Closure (__t, __v)); \ + } + +_DEFINE_LOGICAL_OPERATOR(&&, logical_and) +_DEFINE_LOGICAL_OPERATOR(||, logical_or) +_DEFINE_LOGICAL_OPERATOR(==, equal_to) +_DEFINE_LOGICAL_OPERATOR(!=, not_equal_to) +_DEFINE_LOGICAL_OPERATOR(<, less) +_DEFINE_LOGICAL_OPERATOR(>, greater) +_DEFINE_LOGICAL_OPERATOR(<=, less_equal) +_DEFINE_LOGICAL_OPERATOR(>=, greater_equal) + +#undef _DEFINE_LOGICAL_OPERATOR + +} // namespace std + +#endif // _CPP_VALARRAY + +// Local Variables: +// mode:c++ +// End: diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector index 8fa361d..995daec 100644 --- a/libstdc++-v3/include/std/vector +++ b/libstdc++-v3/include/std/vector @@ -1,4 +1,4 @@ -// -*- C++ -*- std header. +// <vector> -*- C++ -*- // Copyright (C) 2001 Free Software Foundation, Inc. // @@ -27,11 +27,52 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file vector - * This is a Standard C++ Library file. You should @c #include this file - * in your programs, rather than any of the "st[dl]_*.h" implementation files. +/* + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Hewlett-Packard Company makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * + * Copyright (c) 1996 + * Silicon Graphics Computer Systems, Inc. + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Silicon Graphics makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + */ + +/** @file std_vector.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. */ #ifndef _CPP_VECTOR -#include <bits/std_vector.h> -#endif +#define _CPP_VECTOR 1 + +#pragma GCC system_header + +#include <bits/functexcept.h> +#include <bits/stl_algobase.h> +#include <bits/stl_alloc.h> +#include <bits/stl_construct.h> +#include <bits/stl_uninitialized.h> +#include <bits/stl_vector.h> +#include <bits/stl_bvector.h> + +#endif /* _CPP_VECTOR */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/src/bitset.cc b/libstdc++-v3/src/bitset.cc index 0c3fc5f..c0bec5d 100644 --- a/libstdc++-v3/src/bitset.cc +++ b/libstdc++-v3/src/bitset.cc @@ -41,7 +41,7 @@ * purpose. It is provided "as is" without express or implied warranty. */ -#include <bits/std_bitset.h> +#include <bitset> // // Definitions of non-inline functions from the single-word version of diff --git a/libstdc++-v3/src/cmath.cc b/libstdc++-v3/src/cmath.cc index 6442e0c..7a7433a 100644 --- a/libstdc++-v3/src/cmath.cc +++ b/libstdc++-v3/src/cmath.cc @@ -32,7 +32,7 @@ // helper functions used in the math routines of libstdc++. -#include <bits/std_cmath.h> +#include <cmath> namespace std { @@ -45,4 +45,3 @@ namespace std __cmath_power<long double>(long double, unsigned int); } // namespace std - diff --git a/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc index 5e7cdb6..c5474c6 100644 --- a/libstdc++-v3/src/codecvt.cc +++ b/libstdc++-v3/src/codecvt.cc @@ -27,7 +27,7 @@ // Written by Benjamin Kosnik <bkoz@cygnus.com> -#include <bits/std_locale.h> +#include <locale> namespace std { diff --git a/libstdc++-v3/src/complex_io.cc b/libstdc++-v3/src/complex_io.cc index c4b8a95..a6d502f 100644 --- a/libstdc++-v3/src/complex_io.cc +++ b/libstdc++-v3/src/complex_io.cc @@ -27,7 +27,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include <bits/std_complex.h> +#include <complex> namespace std { @@ -91,6 +91,3 @@ namespace std const complex<long double>&); #endif //_GLIBCPP_USE_WCHAR_T } // namespace std - - - diff --git a/libstdc++-v3/src/concept-inst.cc b/libstdc++-v3/src/concept-inst.cc index 28cf104..11e4a89 100644 --- a/libstdc++-v3/src/concept-inst.cc +++ b/libstdc++-v3/src/concept-inst.cc @@ -39,15 +39,14 @@ #ifdef _GLIBCPP_CONCEPT_CHECKS -#include <bits/stl_alloc.h> -#include <bits/std_vector.h> -#include <bits/std_ostream.h> +#include <memory> +#include <vector> +#include <ostream> #define _Instantiate(...) template void __function_requires< __VA_ARGS__ > () namespace __gnu_cxx { - template void __aux_require_boolean_expr<bool>(bool const&); _Instantiate(_BidirectionalIteratorConcept< @@ -160,5 +159,3 @@ namespace __gnu_cxx #undef _Instantiate #endif - - diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 90379fb..6ca5957 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -31,10 +31,10 @@ // ISO C++ 14882: 27.4 Iostreams base classes // -#include <bits/std_ios.h> -#include <bits/std_ostream.h> -#include <bits/std_istream.h> -#include <bits/std_fstream.h> +#include <ios> +#include <ostream> +#include <istream> +#include <fstream> namespace std { diff --git a/libstdc++-v3/src/limits.cc b/libstdc++-v3/src/limits.cc index cf3ddae..3fc3dcb 100644 --- a/libstdc++-v3/src/limits.cc +++ b/libstdc++-v3/src/limits.cc @@ -34,7 +34,7 @@ // 18.2.1 // -#include <bits/std_limits.h> +#include <limits> namespace std { diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 2cbd506..e2f6d77 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -31,17 +31,16 @@ // ISO C++ 14882: 22.1 Locales // -#include <bits/std_cstdlib.h> -#include <bits/std_clocale.h> -#include <bits/std_cstring.h> -#include <bits/std_cassert.h> -#include <bits/std_limits.h> +#include <cstdlib> +#include <clocale> +#include <cstring> +#include <cassert> +#include <limits> #include <exception> -#include <bits/std_stdexcept.h> -#include <bits/std_locale.h> -#include <bits/locale_facets.tcc> -#include <bits/std_istream.h> -#include <bits/std_ostream.h> +#include <stdexcept> +#include <locale> +#include <istream> +#include <ostream> namespace std { diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 13c85ab..630805e 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -25,20 +25,20 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include <bits/std_clocale.h> -#include <bits/std_cstring.h> -#include <bits/std_cassert.h> -#include <bits/std_cctype.h> -#include <bits/std_limits.h> +#include <clocale> +#include <cstring> +#include <cassert> +#include <cctype> +#include <limits> #include <exception> -#include <bits/std_stdexcept.h> -#include <bits/std_locale.h> -#include <bits/std_istream.h> -#include <bits/std_ostream.h> -#include <bits/std_vector.h> -#include <bits/std_memory.h> // for auto_ptr +#include <stdexcept> +#include <locale> +#include <istream> +#include <ostream> +#include <vector> +#include <memory> // for auto_ptr #ifdef _GLIBCPP_USE_WCHAR_T -# include <bits/std_cwctype.h> // for towupper, etc. +# include <cwctype> // for towupper, etc. #endif namespace std diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc index 8c2db9d..45c4732 100644 --- a/libstdc++-v3/src/localename.cc +++ b/libstdc++-v3/src/localename.cc @@ -25,11 +25,11 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include <bits/std_clocale.h> -#include <bits/std_locale.h> -#include <bits/std_cstring.h> -#include <bits/std_vector.h> -#include <bits/std_stdexcept.h> +#include <clocale> +#include <cstring> +#include <locale> +#include <vector> +#include <stdexcept> namespace std { diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc index ab2f2aa..bb0bd78 100644 --- a/libstdc++-v3/src/misc-inst.cc +++ b/libstdc++-v3/src/misc-inst.cc @@ -31,20 +31,18 @@ // ISO C++ 14882: // -#include <bits/std_string.h> -#include <bits/std_algorithm.h> -#include <bits/std_locale.h> -#include <bits/std_vector.h> -#include <bits/std_iterator.h> -#include <bits/std_streambuf.h> -#include <bits/std_sstream.h> -#include <bits/std_fstream.h> -#include <bits/std_ios.h> -#include <bits/basic_ios.tcc> -#include <bits/std_istream.h> -#include <bits/std_ostream.h> -#include <bits/std_string.h> -#include <bits/std_iomanip.h> +#include <string> +#include <algorithm> +#include <locale> +#include <vector> +#include <iterator> +#include <streambuf> +#include <sstream> +#include <fstream> +#include <ios> +#include <istream> +#include <ostream> +#include <iomanip> // NB: unnecessary if the .h headers include these #ifndef _GLIBCPP_FULLY_COMPLIANT_HEADERS diff --git a/libstdc++-v3/src/stdexcept.cc b/libstdc++-v3/src/stdexcept.cc index 32ebd26..d39d41f 100644 --- a/libstdc++-v3/src/stdexcept.cc +++ b/libstdc++-v3/src/stdexcept.cc @@ -31,8 +31,8 @@ // ISO C++ 14882: 19.1 Exception classes // -#include <bits/std_string.h> -#include <bits/std_stdexcept.h> +#include <string> +#include <stdexcept> namespace std { diff --git a/libstdc++-v3/src/stl-inst.cc b/libstdc++-v3/src/stl-inst.cc index bc12464..52661df 100644 --- a/libstdc++-v3/src/stl-inst.cc +++ b/libstdc++-v3/src/stl-inst.cc @@ -32,13 +32,12 @@ // #include <bits/c++config.h> -#include <bits/stl_alloc.h> -#include <bits/std_vector.h> -#include <bits/std_ostream.h> +#include <memory> +#include <vector> +#include <ostream> namespace std { - template class __malloc_alloc_template<0>; #ifndef __USE_MALLOC @@ -51,4 +50,3 @@ namespace std _M_insert_aux(vector<unsigned int>::iterator, unsigned int const &); } // namespace std - diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc index 324ca86..4da060f 100644 --- a/libstdc++-v3/src/string-inst.cc +++ b/libstdc++-v3/src/string-inst.cc @@ -33,7 +33,7 @@ // Written by Jason Merrill based upon the specification by Takanori Adachi // in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers. -#include <bits/std_string.h> +#include <string> // Instantiation configuration. #ifndef C diff --git a/libstdc++-v3/src/valarray-inst.cc b/libstdc++-v3/src/valarray-inst.cc index c5f5616..b56a911 100644 --- a/libstdc++-v3/src/valarray-inst.cc +++ b/libstdc++-v3/src/valarray-inst.cc @@ -31,7 +31,7 @@ // ISO C++ 14882: // -#include <bits/std_valarray.h> +#include <valarray> namespace std { |