From: Phil Edwards Date: Sat, 12 Jan 2002 00:50:04 +0000 (+0000) Subject: Makefile.am (std_headers): Update list with new names. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=066930bbe1ceaf67eefa8842b37d684914afa1ad;p=gcc.git Makefile.am (std_headers): Update list with new names. 2002-01-11 Phil Edwards * include/Makefile.am (std_headers): Update list with new names. (stamp-std): Link to standardized name. * include/Makefile.in: Regenerate. * include/std/algorithm, include/std/bitset, include/std/complex, include/std/deque, include/std/fstream, include/std/functional, include/std/iomanip, include/std/ios, include/std/iosfwd, include/std/iostream, include/std/istream, include/std/iterator, include/std/limits, include/std/list, include/std/locale, include/std/map, include/std/memory, include/std/numeric, include/std/ostream, include/std/queue, include/std/set, include/std/sstream, include/std/stack, include/std/stdexcept, include/std/streambuf, include/std/string, include/std/utility, include/std/valarray, include/std/vector: Rename to... * include/std/std_algorithm.h, include/std/std_bitset.h, include/std/std_complex.h, include/std/std_deque.h, include/std/std_fstream.h, include/std/std_functional.h, include/std/std_iomanip.h, include/std/std_ios.h, include/std/std_iosfwd.h, include/std/std_iostream.h, include/std/std_istream.h, include/std/std_iterator.h, include/std/std_limits.h, include/std/std_list.h, include/std/std_locale.h, include/std/std_map.h, include/std/std_memory.h, include/std/std_numeric.h, include/std/std_ostream.h, include/std/std_queue.h, include/std/std_set.h, include/std/std_sstream.h, include/std/std_stack.h, include/std/std_stdexcept.h, include/std/std_streambuf.h, include/std/std_string.h, include/std/std_utility.h, include/std/std_valarray.h, include/std/std_vector.h: ...this. From-SVN: r48788 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce6e4414454..d2d31e64fd6 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,36 @@ +2002-01-11 Phil Edwards + + * include/Makefile.am (std_headers): Update list with new names. + (stamp-std): Link to standardized name. + * include/Makefile.in: Regenerate. + + * include/std/algorithm, include/std/bitset, include/std/complex, + include/std/deque, include/std/fstream, include/std/functional, + include/std/iomanip, include/std/ios, include/std/iosfwd, + include/std/iostream, include/std/istream, include/std/iterator, + include/std/limits, include/std/list, include/std/locale, + include/std/map, include/std/memory, include/std/numeric, + include/std/ostream, include/std/queue, include/std/set, + include/std/sstream, include/std/stack, include/std/stdexcept, + include/std/streambuf, include/std/string, include/std/utility, + include/std/valarray, include/std/vector: Rename to... + + * include/std/std_algorithm.h, include/std/std_bitset.h, + include/std/std_complex.h, include/std/std_deque.h, + include/std/std_fstream.h, include/std/std_functional.h, + include/std/std_iomanip.h, include/std/std_ios.h, + include/std/std_iosfwd.h, include/std/std_iostream.h, + include/std/std_istream.h, include/std/std_iterator.h, + include/std/std_limits.h, include/std/std_list.h, + include/std/std_locale.h, include/std/std_map.h, + include/std/std_memory.h, include/std/std_numeric.h, + include/std/std_ostream.h, include/std/std_queue.h, + include/std/std_set.h, include/std/std_sstream.h, + include/std/std_stack.h, include/std/std_stdexcept.h, + include/std/std_streambuf.h, include/std/std_string.h, + include/std/std_utility.h, include/std/std_valarray.h, + include/std/std_vector.h: ...this. + 2002-01-11 Loren Rittle * include/Makefile.am (extra_target_headers): New list of all diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 1ff45bd8f32..b6472ac5a42 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -185,35 +185,35 @@ c_base_headers = \ std_srcdir = ${glibcpp_srcdir}/include/std std_builddir = ./ std_headers = \ - ${std_srcdir}/algorithm \ - ${std_srcdir}/bitset \ - ${std_srcdir}/complex \ - ${std_srcdir}/deque \ - ${std_srcdir}/fstream \ - ${std_srcdir}/functional \ - ${std_srcdir}/iomanip \ - ${std_srcdir}/ios \ - ${std_srcdir}/iosfwd \ - ${std_srcdir}/iostream \ - ${std_srcdir}/istream \ - ${std_srcdir}/iterator \ - ${std_srcdir}/limits \ - ${std_srcdir}/list \ - ${std_srcdir}/locale \ - ${std_srcdir}/map \ - ${std_srcdir}/memory \ - ${std_srcdir}/numeric \ - ${std_srcdir}/ostream \ - ${std_srcdir}/queue \ - ${std_srcdir}/set \ - ${std_srcdir}/sstream \ - ${std_srcdir}/stack \ - ${std_srcdir}/stdexcept \ - ${std_srcdir}/streambuf \ - ${std_srcdir}/string \ - ${std_srcdir}/utility \ - ${std_srcdir}/valarray \ - ${std_srcdir}/vector + ${std_srcdir}/std_algorithm.h \ + ${std_srcdir}/std_bitset.h \ + ${std_srcdir}/std_complex.h \ + ${std_srcdir}/std_deque.h \ + ${std_srcdir}/std_fstream.h \ + ${std_srcdir}/std_functional.h \ + ${std_srcdir}/std_iomanip.h \ + ${std_srcdir}/std_ios.h \ + ${std_srcdir}/std_iosfwd.h \ + ${std_srcdir}/std_iostream.h \ + ${std_srcdir}/std_istream.h \ + ${std_srcdir}/std_iterator.h \ + ${std_srcdir}/std_limits.h \ + ${std_srcdir}/std_list.h \ + ${std_srcdir}/std_locale.h \ + ${std_srcdir}/std_map.h \ + ${std_srcdir}/std_memory.h \ + ${std_srcdir}/std_numeric.h \ + ${std_srcdir}/std_ostream.h \ + ${std_srcdir}/std_queue.h \ + ${std_srcdir}/std_set.h \ + ${std_srcdir}/std_sstream.h \ + ${std_srcdir}/std_stack.h \ + ${std_srcdir}/std_stdexcept.h \ + ${std_srcdir}/std_streambuf.h \ + ${std_srcdir}/std_string.h \ + ${std_srcdir}/std_utility.h \ + ${std_srcdir}/std_valarray.h \ + ${std_srcdir}/std_vector.h target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_builddir = ./${target_alias}/bits @@ -248,11 +248,16 @@ allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \ # Here are the rules for building the headers all-local: ${target_builddir}/c++config.h ${allstamps} +# This rule is slightly different, in that we must change the name of the +# local file from std_foo.h to foo. stamp-std: ${std_headers} @if [ ! -d "${std_builddir}" ]; then \ mkdir -p ${std_builddir} ;\ fi ;\ - (cd ${std_builddir} && @LN_S@ $? . || true) ;\ + (cd ${std_builddir} && for h in $?; do \ + official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\ + @LN_S@ $$h ./$${official_name || true} ;\ + done) ;\ echo `date` > stamp-std stamp-bits: ${bits_headers} diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 70fee33be73..52580447234 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999 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. @@ -158,45 +158,224 @@ glibcpp_builddir = @glibcpp_builddir@ bits_srcdir = ${glibcpp_srcdir}/include/bits bits_builddir = ./bits -bits_headers = ${bits_srcdir}/basic_file.h ${bits_srcdir}/basic_ios.h ${bits_srcdir}/basic_ios.tcc ${bits_srcdir}/basic_string.h ${bits_srcdir}/basic_string.tcc ${bits_srcdir}/boost_concept_check.h ${bits_srcdir}/char_traits.h ${bits_srcdir}/codecvt.h ${bits_srcdir}/concept_check.h ${bits_srcdir}/cpp_type_traits.h ${bits_srcdir}/fpos.h ${bits_srcdir}/fstream.tcc ${bits_srcdir}/functexcept.h ${bits_srcdir}/generic_shadow.h ${bits_srcdir}/gslice.h ${bits_srcdir}/gslice_array.h ${bits_srcdir}/indirect_array.h ${bits_srcdir}/ios_base.h ${bits_srcdir}/istream.tcc ${bits_srcdir}/locale_facets.h ${bits_srcdir}/locale_facets.tcc ${bits_srcdir}/localefwd.h ${bits_srcdir}/mask_array.h ${bits_srcdir}/ostream.tcc ${bits_srcdir}/pthread_allocimpl.h ${bits_srcdir}/stream_iterator.h ${bits_srcdir}/streambuf_iterator.h ${bits_srcdir}/slice.h ${bits_srcdir}/slice_array.h ${bits_srcdir}/sstream.tcc ${bits_srcdir}/stl_algo.h ${bits_srcdir}/stl_algobase.h ${bits_srcdir}/stl_alloc.h ${bits_srcdir}/stl_bvector.h ${bits_srcdir}/stl_construct.h ${bits_srcdir}/stl_deque.h ${bits_srcdir}/stl_function.h ${bits_srcdir}/stl_heap.h ${bits_srcdir}/stl_iterator.h ${bits_srcdir}/stl_iterator_base_funcs.h ${bits_srcdir}/stl_iterator_base_types.h ${bits_srcdir}/stl_list.h ${bits_srcdir}/stl_map.h ${bits_srcdir}/stl_multimap.h ${bits_srcdir}/stl_multiset.h ${bits_srcdir}/stl_numeric.h ${bits_srcdir}/stl_pair.h ${bits_srcdir}/stl_pthread_alloc.h ${bits_srcdir}/stl_queue.h ${bits_srcdir}/stl_raw_storage_iter.h ${bits_srcdir}/stl_relops.h ${bits_srcdir}/stl_set.h ${bits_srcdir}/stl_stack.h ${bits_srcdir}/stl_tempbuf.h ${bits_srcdir}/stl_threads.h ${bits_srcdir}/stl_tree.h ${bits_srcdir}/stl_uninitialized.h ${bits_srcdir}/stl_vector.h ${bits_srcdir}/streambuf.tcc ${bits_srcdir}/stringfwd.h ${bits_srcdir}/type_traits.h ${bits_srcdir}/valarray_array.h ${bits_srcdir}/valarray_array.tcc ${bits_srcdir}/valarray_meta.h +bits_headers = \ + ${bits_srcdir}/basic_file.h \ + ${bits_srcdir}/basic_ios.h \ + ${bits_srcdir}/basic_ios.tcc \ + ${bits_srcdir}/basic_string.h \ + ${bits_srcdir}/basic_string.tcc \ + ${bits_srcdir}/boost_concept_check.h \ + ${bits_srcdir}/char_traits.h \ + ${bits_srcdir}/codecvt.h \ + ${bits_srcdir}/concept_check.h \ + ${bits_srcdir}/cpp_type_traits.h \ + ${bits_srcdir}/fpos.h \ + ${bits_srcdir}/fstream.tcc \ + ${bits_srcdir}/functexcept.h \ + ${bits_srcdir}/generic_shadow.h \ + ${bits_srcdir}/gslice.h \ + ${bits_srcdir}/gslice_array.h \ + ${bits_srcdir}/indirect_array.h \ + ${bits_srcdir}/ios_base.h \ + ${bits_srcdir}/istream.tcc \ + ${bits_srcdir}/locale_facets.h \ + ${bits_srcdir}/locale_facets.tcc \ + ${bits_srcdir}/localefwd.h \ + ${bits_srcdir}/mask_array.h \ + ${bits_srcdir}/ostream.tcc \ + ${bits_srcdir}/pthread_allocimpl.h \ + ${bits_srcdir}/stream_iterator.h \ + ${bits_srcdir}/streambuf_iterator.h \ + ${bits_srcdir}/slice.h \ + ${bits_srcdir}/slice_array.h \ + ${bits_srcdir}/sstream.tcc \ + ${bits_srcdir}/stl_algo.h \ + ${bits_srcdir}/stl_algobase.h \ + ${bits_srcdir}/stl_alloc.h \ + ${bits_srcdir}/stl_bvector.h \ + ${bits_srcdir}/stl_construct.h \ + ${bits_srcdir}/stl_deque.h \ + ${bits_srcdir}/stl_function.h \ + ${bits_srcdir}/stl_heap.h \ + ${bits_srcdir}/stl_iterator.h \ + ${bits_srcdir}/stl_iterator_base_funcs.h \ + ${bits_srcdir}/stl_iterator_base_types.h \ + ${bits_srcdir}/stl_list.h \ + ${bits_srcdir}/stl_map.h \ + ${bits_srcdir}/stl_multimap.h \ + ${bits_srcdir}/stl_multiset.h \ + ${bits_srcdir}/stl_numeric.h \ + ${bits_srcdir}/stl_pair.h \ + ${bits_srcdir}/stl_pthread_alloc.h \ + ${bits_srcdir}/stl_queue.h \ + ${bits_srcdir}/stl_raw_storage_iter.h \ + ${bits_srcdir}/stl_relops.h \ + ${bits_srcdir}/stl_set.h \ + ${bits_srcdir}/stl_stack.h \ + ${bits_srcdir}/stl_tempbuf.h \ + ${bits_srcdir}/stl_threads.h \ + ${bits_srcdir}/stl_tree.h \ + ${bits_srcdir}/stl_uninitialized.h \ + ${bits_srcdir}/stl_vector.h \ + ${bits_srcdir}/streambuf.tcc \ + ${bits_srcdir}/stringfwd.h \ + ${bits_srcdir}/type_traits.h \ + ${bits_srcdir}/valarray_array.h \ + ${bits_srcdir}/valarray_array.tcc \ + ${bits_srcdir}/valarray_meta.h backward_srcdir = ${glibcpp_srcdir}/include/backward backward_builddir = ./backward -backward_headers = ${backward_srcdir}/complex.h ${backward_srcdir}/iomanip.h ${backward_srcdir}/istream.h ${backward_srcdir}/ostream.h ${backward_srcdir}/stream.h ${backward_srcdir}/streambuf.h ${backward_srcdir}/algo.h ${backward_srcdir}/algobase.h ${backward_srcdir}/alloc.h ${backward_srcdir}/bvector.h ${backward_srcdir}/defalloc.h ${backward_srcdir}/deque.h ${backward_srcdir}/function.h ${backward_srcdir}/hash_map.h ${backward_srcdir}/hash_set.h ${backward_srcdir}/hashtable.h ${backward_srcdir}/heap.h ${backward_srcdir}/iostream.h ${backward_srcdir}/iterator.h ${backward_srcdir}/list.h ${backward_srcdir}/map.h ${backward_srcdir}/multimap.h ${backward_srcdir}/new.h ${backward_srcdir}/multiset.h ${backward_srcdir}/pair.h ${backward_srcdir}/queue.h ${backward_srcdir}/rope.h ${backward_srcdir}/set.h ${backward_srcdir}/slist.h ${backward_srcdir}/stack.h ${backward_srcdir}/tempbuf.h ${backward_srcdir}/tree.h ${backward_srcdir}/vector.h ${backward_srcdir}/fstream.h ${backward_srcdir}/strstream.h ${backward_srcdir}/strstream ${backward_srcdir}/backward_warning.h +backward_headers = \ + ${backward_srcdir}/complex.h \ + ${backward_srcdir}/iomanip.h \ + ${backward_srcdir}/istream.h \ + ${backward_srcdir}/ostream.h \ + ${backward_srcdir}/stream.h \ + ${backward_srcdir}/streambuf.h \ + ${backward_srcdir}/algo.h \ + ${backward_srcdir}/algobase.h \ + ${backward_srcdir}/alloc.h \ + ${backward_srcdir}/bvector.h \ + ${backward_srcdir}/defalloc.h \ + ${backward_srcdir}/deque.h \ + ${backward_srcdir}/function.h \ + ${backward_srcdir}/hash_map.h \ + ${backward_srcdir}/hash_set.h \ + ${backward_srcdir}/hashtable.h \ + ${backward_srcdir}/heap.h \ + ${backward_srcdir}/iostream.h \ + ${backward_srcdir}/iterator.h \ + ${backward_srcdir}/list.h \ + ${backward_srcdir}/map.h \ + ${backward_srcdir}/multimap.h \ + ${backward_srcdir}/new.h \ + ${backward_srcdir}/multiset.h \ + ${backward_srcdir}/pair.h \ + ${backward_srcdir}/queue.h \ + ${backward_srcdir}/rope.h \ + ${backward_srcdir}/set.h \ + ${backward_srcdir}/slist.h \ + ${backward_srcdir}/stack.h \ + ${backward_srcdir}/tempbuf.h \ + ${backward_srcdir}/tree.h \ + ${backward_srcdir}/vector.h \ + ${backward_srcdir}/fstream.h \ + ${backward_srcdir}/strstream.h \ + ${backward_srcdir}/strstream \ + ${backward_srcdir}/backward_warning.h ext_srcdir = ${glibcpp_srcdir}/include/ext ext_builddir = ./ext -ext_headers = ${ext_srcdir}/algorithm ${ext_srcdir}/functional ${ext_srcdir}/hash_map ${ext_srcdir}/hash_set ${ext_srcdir}/iterator ${ext_srcdir}/memory ${ext_srcdir}/numeric ${ext_srcdir}/rb_tree ${ext_srcdir}/rope ${ext_srcdir}/ropeimpl.h ${ext_srcdir}/slist ${ext_srcdir}/stl_hash_fun.h ${ext_srcdir}/stl_hashtable.h ${ext_srcdir}/stl_rope.h +ext_headers = \ + ${ext_srcdir}/algorithm \ + ${ext_srcdir}/functional \ + ${ext_srcdir}/hash_map \ + ${ext_srcdir}/hash_set \ + ${ext_srcdir}/iterator \ + ${ext_srcdir}/memory \ + ${ext_srcdir}/numeric \ + ${ext_srcdir}/rb_tree \ + ${ext_srcdir}/rope \ + ${ext_srcdir}/ropeimpl.h \ + ${ext_srcdir}/slist \ + ${ext_srcdir}/stl_hash_fun.h \ + ${ext_srcdir}/stl_hashtable.h \ + ${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@ c_base_builddir = ./ -c_base_headers = ${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 +c_base_headers = \ + ${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 std_builddir = ./ -std_headers = ${std_srcdir}/algorithm ${std_srcdir}/bitset ${std_srcdir}/complex ${std_srcdir}/deque ${std_srcdir}/fstream ${std_srcdir}/functional ${std_srcdir}/iomanip ${std_srcdir}/ios ${std_srcdir}/iosfwd ${std_srcdir}/iostream ${std_srcdir}/istream ${std_srcdir}/iterator ${std_srcdir}/limits ${std_srcdir}/list ${std_srcdir}/locale ${std_srcdir}/map ${std_srcdir}/memory ${std_srcdir}/numeric ${std_srcdir}/ostream ${std_srcdir}/queue ${std_srcdir}/set ${std_srcdir}/sstream ${std_srcdir}/stack ${std_srcdir}/stdexcept ${std_srcdir}/streambuf ${std_srcdir}/string ${std_srcdir}/utility ${std_srcdir}/valarray ${std_srcdir}/vector +std_headers = \ + ${std_srcdir}/std_algorithm.h \ + ${std_srcdir}/std_bitset.h \ + ${std_srcdir}/std_complex.h \ + ${std_srcdir}/std_deque.h \ + ${std_srcdir}/std_fstream.h \ + ${std_srcdir}/std_functional.h \ + ${std_srcdir}/std_iomanip.h \ + ${std_srcdir}/std_ios.h \ + ${std_srcdir}/std_iosfwd.h \ + ${std_srcdir}/std_iostream.h \ + ${std_srcdir}/std_istream.h \ + ${std_srcdir}/std_iterator.h \ + ${std_srcdir}/std_limits.h \ + ${std_srcdir}/std_list.h \ + ${std_srcdir}/std_locale.h \ + ${std_srcdir}/std_map.h \ + ${std_srcdir}/std_memory.h \ + ${std_srcdir}/std_numeric.h \ + ${std_srcdir}/std_ostream.h \ + ${std_srcdir}/std_queue.h \ + ${std_srcdir}/std_set.h \ + ${std_srcdir}/std_sstream.h \ + ${std_srcdir}/std_stack.h \ + ${std_srcdir}/std_stdexcept.h \ + ${std_srcdir}/std_streambuf.h \ + ${std_srcdir}/std_string.h \ + ${std_srcdir}/std_utility.h \ + ${std_srcdir}/std_valarray.h \ + ${std_srcdir}/std_vector.h target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_builddir = ./${target_alias}/bits -target_headers = ${target_srcdir}/ctype_base.h ${target_srcdir}/ctype_inline.h ${target_srcdir}/ctype_noninline.h ${target_srcdir}/os_defines.h ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h ${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h +target_headers = \ + ${target_srcdir}/ctype_base.h \ + ${target_srcdir}/ctype_inline.h \ + ${target_srcdir}/ctype_noninline.h \ + ${target_srcdir}/os_defines.h \ + ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \ + ${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h # These extra_target_headers files are all built with ad hoc naming rules. -extra_target_headers = ${target_builddir}/basic_file_model.h ${target_builddir}/c++config.h ${target_builddir}/c++io.h ${target_builddir}/c++locale.h ${target_builddir}/messages_members.h ${target_builddir}/codecvt_specializations.h +extra_target_headers = \ + ${target_builddir}/basic_file_model.h \ + ${target_builddir}/c++config.h \ + ${target_builddir}/c++io.h \ + ${target_builddir}/c++locale.h \ + ${target_builddir}/messages_members.h \ + ${target_builddir}/codecvt_specializations.h thread_builddir = ./${target_alias}/bits -thread_headers = ${thread_builddir}/gthr.h ${thread_builddir}/gthr-single.h ${thread_builddir}/gthr-default.h +thread_headers = \ + ${thread_builddir}/gthr.h \ + ${thread_builddir}/gthr-single.h \ + ${thread_builddir}/gthr-default.h # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. -allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext stamp-target stamp-thread +allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \ + stamp-target stamp-thread # Target includes for threads @@ -219,14 +398,14 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +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 + cd $(top_srcdir) && $(AUTOMAKE) --gnits include/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -239,8 +418,13 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = include distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits include/Makefile @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ + d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ @@ -253,12 +437,10 @@ info-am: info: info-am dvi-am: dvi: dvi-am -check-am: +check-am: all-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 @@ -306,22 +488,26 @@ maintainer-clean-am: maintainer-clean-generic distclean-am maintainer-clean: maintainer-clean-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 +installcheck-am installcheck 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 all-local: ${target_builddir}/c++config.h ${allstamps} +# This rule is slightly different, in that we must change the name of the +# local file from std_foo.h to foo. stamp-std: ${std_headers} @if [ ! -d "${std_builddir}" ]; then \ mkdir -p ${std_builddir} ;\ fi ;\ - (cd ${std_builddir} && @LN_S@ $? . || true) ;\ + (cd ${std_builddir} && for h in $?; do \ + official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\ + @LN_S@ $$h ./$${official_name || true} ;\ + done) ;\ echo `date` > stamp-std stamp-bits: ${bits_headers} diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm deleted file mode 100644 index 746eb47541b..00000000000 --- a/libstdc++-v3/include/std/algorithm +++ /dev/null @@ -1,76 +0,0 @@ -// -*- 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 -#include -#include -#include -#include - -#endif /* _CPP_ALGORITHM */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset deleted file mode 100644 index d9119e17b36..00000000000 --- a/libstdc++-v3/include/std/bitset +++ /dev/null @@ -1,814 +0,0 @@ -// -*- 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 // for size_t -#include // for memset -#include -#include -#include // for invalid_argument, out_of_range, - // overflow_error -#include // for ostream (operator<<) -#include // 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 -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 -struct _First_one { - static unsigned char _S_first_one[256]; -}; - -// -// Base class: general case. -// - -template -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::_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 -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 -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 -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 _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(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one::_S_first_one[__this_byte]; - - __thisword >>= CHAR_BIT; - } - } - } - // not found, so return an indication of failure. - return __not_found; -} - -template -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(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one::_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(__thisword & (~(unsigned char)0)); - if ( __this_byte ) - return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + - _First_one::_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::_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 struct _Sanitize { - static void _M_do_sanitize(unsigned long& __val) - { __val &= ~((~static_cast(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 -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 - 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 - 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 - 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 - void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, - size_t, - size_t); - - template - 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 -template -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 -template -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 -inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result &= __y; - return __result; -} - - -template -inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result |= __y; - return __result; -} - -template -inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { - bitset<_Nb> __result(__x); - __result ^= __y; - return __result; -} - -template -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(0), _Nb); - } - - return __is; -} - -template -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/complex b/libstdc++-v3/include/std/complex deleted file mode 100644 index 18dd8675823..00000000000 --- a/libstdc++-v3/include/std/complex +++ /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 -// Improved by Gabriel Dos Reis -// - -/** @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 -#include -#include -#include - -namespace std -{ - // Forward declarations - template class complex; - template<> class complex; - template<> class complex; - template<> class complex; - - template _Tp abs(const complex<_Tp>&); - template _Tp arg(const complex<_Tp>&); - template _Tp norm(const complex<_Tp>&); - - template complex<_Tp> conj(const complex<_Tp>&); - template complex<_Tp> polar(const _Tp&, const _Tp& = 0); - - // Transcendentals: - template complex<_Tp> cos(const complex<_Tp>&); - template complex<_Tp> cosh(const complex<_Tp>&); - template complex<_Tp> exp(const complex<_Tp>&); - template complex<_Tp> log(const complex<_Tp>&); - template complex<_Tp> log10(const complex<_Tp>&); - template complex<_Tp> pow(const complex<_Tp>&, int); - template complex<_Tp> pow(const complex<_Tp>&, const _Tp&); - template complex<_Tp> pow(const complex<_Tp>&, - const complex<_Tp>&); - template complex<_Tp> pow(const _Tp&, const complex<_Tp>&); - template complex<_Tp> sin(const complex<_Tp>&); - template complex<_Tp> sinh(const complex<_Tp>&); - template complex<_Tp> sqrt(const complex<_Tp>&); - template complex<_Tp> tan(const complex<_Tp>&); - template complex<_Tp> tanh(const complex<_Tp>&); - - - // 26.2.2 Primary template class complex - template - 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 - 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 - complex<_Tp>& operator=(const complex<_Up>&); - template - complex<_Tp>& operator+=(const complex<_Up>&); - template - complex<_Tp>& operator-=(const complex<_Up>&); - template - complex<_Tp>& operator*=(const complex<_Up>&); - template - complex<_Tp>& operator/=(const complex<_Up>&); - - private: - _Tp _M_real, _M_imag; - }; - - template - inline _Tp - complex<_Tp>::real() const { return _M_real; } - - template - inline _Tp - complex<_Tp>::imag() const { return _M_imag; } - - template - inline - complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) - : _M_real(__r), _M_imag(__i) { } - - template - template - inline - complex<_Tp>::complex(const complex<_Up>& __z) - : _M_real(__z.real()), _M_imag(__z.imag()) { } - - template - complex<_Tp>& - complex<_Tp>::operator=(const _Tp& __t) - { - _M_real = __t; - _M_imag = _Tp(); - return *this; - } - - // 26.2.5/1 - template - inline complex<_Tp>& - complex<_Tp>::operator+=(const _Tp& __t) - { - _M_real += __t; - return *this; - } - - // 26.2.5/3 - template - inline complex<_Tp>& - complex<_Tp>::operator-=(const _Tp& __t) - { - _M_real -= __t; - return *this; - } - - // 26.2.5/5 - template - complex<_Tp>& - complex<_Tp>::operator*=(const _Tp& __t) - { - _M_real *= __t; - _M_imag *= __t; - return *this; - } - - // 26.2.5/7 - template - complex<_Tp>& - complex<_Tp>::operator/=(const _Tp& __t) - { - _M_real /= __t; - _M_imag /= __t; - return *this; - } - - template - template - complex<_Tp>& - complex<_Tp>::operator=(const complex<_Up>& __z) - { - _M_real = __z.real(); - _M_imag = __z.imag(); - return *this; - } - - // 26.2.5/9 - template - template - complex<_Tp>& - complex<_Tp>::operator+=(const complex<_Up>& __z) - { - _M_real += __z.real(); - _M_imag += __z.imag(); - return *this; - } - - // 26.2.5/11 - template - template - 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 - template - 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 - template - 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 - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) += __y; } - - template - inline complex<_Tp> - operator+(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) += __y; } - - template - inline complex<_Tp> - operator+(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__y) += __x; } - - template - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) -= __y; } - - template - inline complex<_Tp> - operator-(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) -= __y; } - - template - inline complex<_Tp> - operator-(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) -= __y; } - - template - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) *= __y; } - - template - inline complex<_Tp> - operator*(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) *= __y; } - - template - inline complex<_Tp> - operator*(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__y) *= __x; } - - template - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) /= __y; } - - template - inline complex<_Tp> - operator/(const complex<_Tp>& __x, const _Tp& __y) - { return complex<_Tp> (__x) /= __y; } - - template - inline complex<_Tp> - operator/(const _Tp& __x, const complex<_Tp>& __y) - { return complex<_Tp> (__x) /= __y; } - - template - inline complex<_Tp> - operator+(const complex<_Tp>& __x) - { return __x; } - - template - inline complex<_Tp> - operator-(const complex<_Tp>& __x) - { return complex<_Tp>(-__x.real(), -__x.imag()); } - - template - inline bool - operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() == __y.real() && __x.imag() == __y.imag(); } - - template - inline bool - operator==(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() == __y && __x.imag() == _Tp(); } - - template - inline bool - operator==(const _Tp& __x, const complex<_Tp>& __y) - { return __x == __y.real() && _Tp() == __y.imag(); } - - template - inline bool - operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) - { return __x.real() != __y.real() || __x.imag() != __y.imag(); } - - template - inline bool - operator!=(const complex<_Tp>& __x, const _Tp& __y) - { return __x.real() != __y || __x.imag() != _Tp(); } - - template - inline bool - operator!=(const _Tp& __x, const complex<_Tp>& __y) - { return __x != __y.real() || _Tp() != __y.imag(); } - - template - 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 - 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 - inline _Tp - real(const complex<_Tp>& __z) - { return __z.real(); } - - template - inline _Tp - imag(const complex<_Tp>& __z) - { return __z.imag(); } - - template - 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 - 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 - struct _Norm_helper - { - template - 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 - { - template - static inline _Tp _S_do_it(const complex<_Tp>& __z) - { - _Tp __res = abs(__z); - return __res * __res; - } - }; - - template - inline _Tp - norm(const complex<_Tp>& __z) - { - return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z); - } - - template - inline complex<_Tp> - polar(const _Tp& __rho, const _Tp& __theta) - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } - - template - inline complex<_Tp> - conj(const complex<_Tp>& __z) - { return complex<_Tp>(__z.real(), -__z.imag()); } - - // Transcendentals - template - 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 - 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 - inline complex<_Tp> - exp(const complex<_Tp>& __z) - { return polar(exp(__z.real()), __z.imag()); } - - template - inline complex<_Tp> - log(const complex<_Tp>& __z) - { return complex<_Tp>(log(abs(__z)), arg(__z)); } - - template - inline complex<_Tp> - log10(const complex<_Tp>& __z) - { return log(__z) / log(_Tp(10.0)); } - - template - 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 - 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 - 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 - inline complex<_Tp> - tan(const complex<_Tp>& __z) - { - return sin(__z) / cos(__z); - } - - template - inline complex<_Tp> - tanh(const complex<_Tp>& __z) - { - return sinh(__z) / cosh(__z); - } - - template - inline complex<_Tp> - pow(const complex<_Tp>& __z, int __n) - { - return __pow_helper(__z, __n); - } - - template - inline complex<_Tp> - pow(const complex<_Tp>& __x, const _Tp& __y) - { - return exp(__y * log(__x)); - } - - template - inline complex<_Tp> - pow(const complex<_Tp>& __x, const complex<_Tp>& __y) - { - return exp(__y * log(__x)); - } - - template - inline complex<_Tp> - pow(const _Tp& __x, const complex<_Tp>& __y) - { - return exp(__y * log(__x)); - } - - // 26.2.3 complex specializations - // complex specialization - template<> class complex - { - 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&); - explicit complex(const complex&); - - float real() const; - float imag() const; - - complex& operator=(float); - complex& operator+=(float); - complex& operator-=(float); - complex& operator*=(float); - complex& operator/=(float); - - // Let's the compiler synthetize the copy and assignment - // operator. It always does a pretty good job. - // complex& operator= (const complex&); - template - complex&operator=(const complex<_Tp>&); - template - complex& operator+=(const complex<_Tp>&); - template - complex& operator-=(const complex<_Tp>&); - template - complex& operator*=(const complex<_Tp>&); - template - complex&operator/=(const complex<_Tp>&); - - private: - typedef __complex__ float _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex; - friend class complex; - }; - - inline float - complex::real() const - { return __real__ _M_value; } - - inline float - complex::imag() const - { return __imag__ _M_value; } - - inline - complex::complex(float r, float i) - { - __real__ _M_value = r; - __imag__ _M_value = i; - } - - inline complex& - complex::operator=(float __f) - { - __real__ _M_value = __f; - __imag__ _M_value = 0.0f; - return *this; - } - - inline complex& - complex::operator+=(float __f) - { - __real__ _M_value += __f; - return *this; - } - - inline complex& - complex::operator-=(float __f) - { - __real__ _M_value -= __f; - return *this; - } - - inline complex& - complex::operator*=(float __f) - { - _M_value *= __f; - return *this; - } - - inline complex& - complex::operator/=(float __f) - { - _M_value /= __f; - return *this; - } - - template - inline complex& - complex::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template - inline complex& - complex::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template - inline complex& - complex::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template - inline complex& - complex::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template - inline complex& - complex::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 specialization - template<> class complex - { - 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&); - explicit complex(const complex&); - - double real() const; - double imag() const; - - complex& operator=(double); - complex& operator+=(double); - complex& operator-=(double); - complex& operator*=(double); - complex& operator/=(double); - - // The compiler will synthetize this, efficiently. - // complex& operator= (const complex&); - template - complex& operator=(const complex<_Tp>&); - template - complex& operator+=(const complex<_Tp>&); - template - complex& operator-=(const complex<_Tp>&); - template - complex& operator*=(const complex<_Tp>&); - template - complex& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex; - friend class complex; - }; - - inline double - complex::real() const - { return __real__ _M_value; } - - inline double - complex::imag() const - { return __imag__ _M_value; } - - inline - complex::complex(double __r, double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline complex& - complex::operator=(double __d) - { - __real__ _M_value = __d; - __imag__ _M_value = 0.0; - return *this; - } - - inline complex& - complex::operator+=(double __d) - { - __real__ _M_value += __d; - return *this; - } - - inline complex& - complex::operator-=(double __d) - { - __real__ _M_value -= __d; - return *this; - } - - inline complex& - complex::operator*=(double __d) - { - _M_value *= __d; - return *this; - } - - inline complex& - complex::operator/=(double __d) - { - _M_value /= __d; - return *this; - } - - template - inline complex& - complex::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template - inline complex& - complex::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template - inline complex& - complex::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template - inline complex& - complex::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template - inline complex& - complex::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 specialization - template<> class complex - { - 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&); - complex(const complex&); - - long double real() const; - long double imag() const; - - complex& operator= (long double); - complex& operator+= (long double); - complex& operator-= (long double); - complex& operator*= (long double); - complex& operator/= (long double); - - // The compiler knows how to do this efficiently - // complex& operator= (const complex&); - template - complex& operator=(const complex<_Tp>&); - template - complex& operator+=(const complex<_Tp>&); - template - complex& operator-=(const complex<_Tp>&); - template - complex& operator*=(const complex<_Tp>&); - template - complex& operator/=(const complex<_Tp>&); - - private: - typedef __complex__ long double _ComplexT; - _ComplexT _M_value; - - complex(_ComplexT __z) : _M_value(__z) { } - - friend class complex; - friend class complex; - }; - - inline - complex::complex(long double __r, long double __i) - { - __real__ _M_value = __r; - __imag__ _M_value = __i; - } - - inline long double - complex::real() const - { return __real__ _M_value; } - - inline long double - complex::imag() const - { return __imag__ _M_value; } - - inline complex& - complex::operator=(long double __r) - { - __real__ _M_value = __r; - __imag__ _M_value = 0.0L; - return *this; - } - - inline complex& - complex::operator+=(long double __r) - { - __real__ _M_value += __r; - return *this; - } - - inline complex& - complex::operator-=(long double __r) - { - __real__ _M_value -= __r; - return *this; - } - - inline complex& - complex::operator*=(long double __r) - { - _M_value *= __r; - return *this; - } - - inline complex& - complex::operator/=(long double __r) - { - _M_value /= __r; - return *this; - } - - template - inline complex& - complex::operator=(const complex<_Tp>& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - return *this; - } - - template - inline complex& - complex::operator+=(const complex<_Tp>& __z) - { - __real__ _M_value += __z.real(); - __imag__ _M_value += __z.imag(); - return *this; - } - - template - inline complex& - complex::operator-=(const complex<_Tp>& __z) - { - __real__ _M_value -= __z.real(); - __imag__ _M_value -= __z.imag(); - return *this; - } - - template - inline complex& - complex::operator*=(const complex<_Tp>& __z) - { - _ComplexT __t; - __real__ __t = __z.real(); - __imag__ __t = __z.imag(); - _M_value *= __t; - return *this; - } - - template - inline complex& - complex::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::complex(const complex& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex::complex(const complex& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex::complex(const complex& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex::complex(const complex& __z) - { - __real__ _M_value = __z.real(); - __imag__ _M_value = __z.imag(); - } - - inline - complex::complex(const complex& __z) - : _M_value(_ComplexT(__z._M_value)) { } - - inline - complex::complex(const complex& __z) - : _M_value(_ComplexT(__z._M_value)) { } -} // namespace std - -#endif /* _CPP_COMPLEX */ diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque deleted file mode 100644 index 394eef3b845..00000000000 --- a/libstdc++-v3/include/std/deque +++ /dev/null @@ -1,77 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include - -#endif /* _CPP_DEQUE */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream deleted file mode 100644 index a04ddf098dd..00000000000 --- a/libstdc++-v3/include/std/fstream +++ /dev/null @@ -1,433 +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 -#include -#include -#include // For codecvt -#include - -namespace std -{ - template - 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 __streambuf_type; - typedef basic_filebuf __filebuf_type; - typedef __basic_file __file_type; - typedef typename traits_type::state_type __state_type; - typedef codecvt __codecvt_type; - typedef typename __codecvt_type::result __res_type; - typedef ctype __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(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; - - // Make sure that the internal buffer resyncs its idea of - // the file position with the external file. - if (__testput && !_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 - 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 __filebuf_type; - typedef basic_istream __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 - 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 __filebuf_type; - typedef basic_ostream __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()) - this->setstate(ios_base::failbit); - } - }; - - - // 27.8.1.11 Template class basic_fstream - template - 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 __filebuf_type; - typedef basic_ios __ios_type; - typedef basic_iostream __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 -#endif -#endif - -#endif - diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional deleted file mode 100644 index 16702caead1..00000000000 --- a/libstdc++-v3/include/std/functional +++ /dev/null @@ -1,62 +0,0 @@ -// -*- 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 -#include -#include - -#endif /* _CPP_FUNCTIONAL */ - -// Local Variables: -// mode:C++ -// End: - diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip deleted file mode 100644 index ab279d20ab6..00000000000 --- a/libstdc++-v3/include/std/iomanip +++ /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 -#include -#include - -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 - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) - { - __is.setf(ios_base::fmtflags(0), __f._M_mask); - return __is; - } - - template - 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 - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) - { - __is.setf(__f._M_mask); - return __is; - } - - template - 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 - 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 - 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 - struct _Setfill { _CharT _M_c; }; - - template - _Setfill<_CharT> - setfill(_CharT __c) - { - _Setfill<_CharT> __x; - __x._M_c = __c; - return __x; - } - - template - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) - { - __is.fill(__f._M_c); - return __is; - } - - template - 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 - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) - { - __is.precision(__f._M_n); - return __is; - } - - template - 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 - basic_istream<_CharT,_Traits>& - operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) - { - __is.width(__f._M_n); - return __is; - } - - template - 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 deleted file mode 100644 index 1e61c366d4e..00000000000 --- a/libstdc++-v3/include/std/ios +++ /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 -#include // For ios_base::failure -#include // For char_traits, streamoff, streamsize, fpos -#include // For SEEK_SET, SEEK_CUR, SEEK_END -#include // For class locale -#include // For ios_base declarations. -#include -#include - -#endif /* _CPP_IOS */ - diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd deleted file mode 100644 index 93c30b3fbf4..00000000000 --- a/libstdc++-v3/include/std/iosfwd +++ /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 -#include // For string forward declarations. -#include -#include - -namespace std -{ - template > - class basic_ios; - - template > - class basic_streambuf; - - template > - class basic_istream; - - template > - class basic_ostream; - - template > - class basic_iostream; - - template, - typename _Alloc = allocator<_CharT> > - class basic_stringbuf; - - template, - typename _Alloc = allocator<_CharT> > - class basic_istringstream; - - template, - typename _Alloc = allocator<_CharT> > - class basic_ostringstream; - - template, - typename _Alloc = allocator<_CharT> > - class basic_stringstream; - - template > - class basic_filebuf; - - template > - class basic_ifstream; - - template > - class basic_ofstream; - - template > - class basic_fstream; - - template > - class istreambuf_iterator; - - template > - class ostreambuf_iterator; - -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not included. (??? Apparently no LWG number?) - class ios_base; -#endif - - typedef basic_ios ios; - typedef basic_streambuf streambuf; - typedef basic_istream istream; - typedef basic_ostream ostream; - typedef basic_iostream iostream; - typedef basic_stringbuf stringbuf; - typedef basic_istringstream istringstream; - typedef basic_ostringstream ostringstream; - typedef basic_stringstream stringstream; - typedef basic_filebuf filebuf; - typedef basic_ifstream ifstream; - typedef basic_ofstream ofstream; - typedef basic_fstream fstream; - -#ifdef _GLIBCPP_USE_WCHAR_T - typedef basic_ios wios; - typedef basic_streambuf wstreambuf; - typedef basic_istream wistream; - typedef basic_ostream wostream; - typedef basic_iostream wiostream; - typedef basic_stringbuf wstringbuf; - typedef basic_istringstream wistringstream; - typedef basic_ostringstream wostringstream; - typedef basic_stringstream wstringstream; - typedef basic_filebuf wfilebuf; - typedef basic_ifstream wifstream; - typedef basic_ofstream wofstream; - typedef basic_fstream wfstream; -#endif -} // namespace std - -#endif diff --git a/libstdc++-v3/include/std/iostream b/libstdc++-v3/include/std/iostream deleted file mode 100644 index 47b83798f5d..00000000000 --- a/libstdc++-v3/include/std/iostream +++ /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 -#include -#include - -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 deleted file mode 100644 index 7b5185289b2..00000000000 --- a/libstdc++-v3/include/std/istream +++ /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 -#include // For numeric_limits - -namespace std -{ - // 27.6.1.1 Template class basic_istream - template - 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 - 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 - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); - - template - basic_istream& - operator>>(basic_istream& __in, unsigned char& __c) - { return (__in >> reinterpret_cast(__c)); } - - template - basic_istream& - operator>>(basic_istream& __in, signed char& __c) - { return (__in >> reinterpret_cast(__c)); } - - template - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); - - template - basic_istream& - operator>>(basic_istream& __in, unsigned char* __s) - { return (__in >> reinterpret_cast(__s)); } - - template - basic_istream& - operator>>(basic_istream& __in, signed char* __s) - { return (__in >> reinterpret_cast(__s)); } - - // 27.6.1.5 Template class basic_iostream - template - 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 - 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 -#endif -#endif - -#endif /* _CPP_ISTREAM */ diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator deleted file mode 100644 index f0eee1164ba..00000000000 --- a/libstdc++-v3/include/std/iterator +++ /dev/null @@ -1,79 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* _CPP_ITERATOR */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits deleted file mode 100644 index 7a6463625ae..00000000000 --- a/libstdc++-v3/include/std/limits +++ /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 - -// -// 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 -#include - -// -// 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 - 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 - const bool - numeric_limits<_Tp>::is_specialized; - - template - const int - numeric_limits<_Tp>::digits; - - template - const int - numeric_limits<_Tp>::digits10; - - template - const bool - numeric_limits<_Tp>::is_signed; - - template - const bool - numeric_limits<_Tp>::is_integer; - - template - const bool - numeric_limits<_Tp>::is_exact; - - template - const int - numeric_limits<_Tp>::radix; - - template - const int - numeric_limits<_Tp>::min_exponent; - - template - const int - numeric_limits<_Tp>::min_exponent10; - - template - const int - numeric_limits<_Tp>::max_exponent; - - template - const int - numeric_limits<_Tp>::max_exponent10; - - template - const bool - numeric_limits<_Tp>::has_infinity; - - template - const bool - numeric_limits<_Tp>::has_quiet_NaN; - - template - const bool - numeric_limits<_Tp>::has_signaling_NaN; - - template - const float_denorm_style - numeric_limits<_Tp>::has_denorm; - - template - const bool - numeric_limits<_Tp>::has_denorm_loss; - - template - const bool - numeric_limits<_Tp>::is_iec559; - - template - const bool - numeric_limits<_Tp>::is_bounded; - - template - const bool - numeric_limits<_Tp>::is_modulo; - - template - const bool - numeric_limits<_Tp>::traps; - - template - const bool - numeric_limits<_Tp>::tinyness_before; - - template - 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 - { - 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 - { - 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(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 - { - 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(0); } - static signed char quiet_NaN() throw() - { return static_cast(0); } - static signed char signaling_NaN() throw() - { return static_cast(0); } - static signed char denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static unsigned char quiet_NaN() throw() - { return static_cast(0); } - static unsigned char signaling_NaN() throw() - { return static_cast(0); } - static unsigned char denorm_min() throw() - { return static_cast(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 - { - 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 - { - 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 - { - 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(0); } - static unsigned short quiet_NaN() throw() - { return static_cast(0); } - static unsigned short signaling_NaN() throw() - { return static_cast(0); } - static unsigned short denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static int quiet_NaN() throw() - { return static_cast(0); } - static int signaling_NaN() throw() - { return static_cast(0); } - static int denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static unsigned int quiet_NaN() throw() - { return static_cast(0); } - static unsigned int signaling_NaN() throw() - { return static_cast(0); } - static unsigned int denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static long quiet_NaN() throw() - { return static_cast(0); } - static long signaling_NaN() throw() - { return static_cast(0); } - static long denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static unsigned long quiet_NaN() throw() - { return static_cast(0); } - static unsigned long signaling_NaN() throw() - { return static_cast(0); } - static unsigned long denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static long long quiet_NaN() throw() - { return static_cast(0); } - static long long signaling_NaN() throw() - { return static_cast(0); } - static long long denorm_min() throw() - { return static_cast(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 - { - 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(0); } - static unsigned long long quiet_NaN() throw() - { return static_cast(0); } - static unsigned long long signaling_NaN() throw() - { return static_cast(0); } - static unsigned long long denorm_min() throw() - { return static_cast(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 - { - 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 - { - 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 - { - 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 deleted file mode 100644 index 683e0a7e66d..00000000000 --- a/libstdc++-v3/include/std/list +++ /dev/null @@ -1,77 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include - -#endif /* _CPP_LIST */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/locale b/libstdc++-v3/include/std/locale deleted file mode 100644 index 82089d01539..00000000000 --- a/libstdc++-v3/include/std/locale +++ /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 -#include -#include - -#endif - -// Local Variables: -// mode:c++ -// End: diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map deleted file mode 100644 index 0dd38bfafd3..00000000000 --- a/libstdc++-v3/include/std/map +++ /dev/null @@ -1,74 +0,0 @@ -// -*- 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 -#include -#include - -#endif /* _CPP_MAP */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory deleted file mode 100644 index c9a2e59e48e..00000000000 --- a/libstdc++-v3/include/std/memory +++ /dev/null @@ -1,149 +0,0 @@ -// -*- 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 -#include -#include -#include //for iterator_traits -#include -#include -#include - -namespace std -{ - - template 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 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 auto_ptr(auto_ptr<_Tp1>& __a) throw() - : _M_ptr(__a.release()) {} - - auto_ptr& operator=(auto_ptr& __a) throw() { - reset(__a.release()); - return *this; - } - - template - 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 operator auto_ptr_ref<_Tp1>() throw() - { return auto_ptr_ref<_Tp>(this->release()); } - template 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 deleted file mode 100644 index e7a6adc3ad4..00000000000 --- a/libstdc++-v3/include/std/numeric +++ /dev/null @@ -1,75 +0,0 @@ -// -*- 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 -#include -#include -#include -#include - -#endif /* _CPP_NUMERIC */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream deleted file mode 100644 index e3ec3260ec0..00000000000 --- a/libstdc++-v3/include/std/ostream +++ /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 - -namespace std -{ - // 27.6.2.1 Template class basic_ostream - template - 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 - (static_cast(__n))); - else - return this->operator<<(static_cast(__n)); - } - - __ostream_type& - operator<<(unsigned short __n) - { return this->operator<<(static_cast(__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 - (static_cast(__n))); - else - return this->operator<<(static_cast(__n)); - } - - __ostream_type& - operator<<(unsigned int __n) - { return this->operator<<(static_cast(__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(__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 - 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 - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c); - - template - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) - { return (__out << __out.widen(__c)); } - - // Specialization - template - basic_ostream& - operator<<(basic_ostream& __out, char __c); - - // Signed and unsigned - template - basic_ostream& - operator<<(basic_ostream& __out, signed char __c) - { return (__out << static_cast(__c)); } - - template - basic_ostream& - operator<<(basic_ostream& __out, unsigned char __c) - { return (__out << static_cast(__c)); } - - template - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s); - - template - basic_ostream<_CharT, _Traits> & - operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); - - // Partial specializationss - template - basic_ostream& - operator<<(basic_ostream& __out, const char* __s); - - // Signed and unsigned - template - basic_ostream& - operator<<(basic_ostream& __out, const signed char* __s) - { return (__out << reinterpret_cast(__s)); } - - template - basic_ostream & - operator<<(basic_ostream& __out, const unsigned char* __s) - { return (__out << reinterpret_cast(__s)); } - - // 27.6.2.7 Standard basic_ostream manipulators - template - basic_ostream<_CharT, _Traits>& - endl(basic_ostream<_CharT, _Traits>& __os) - { return flush(__os.put(__os.widen('\n'))); } - - template - basic_ostream<_CharT, _Traits>& - ends(basic_ostream<_CharT, _Traits>& __os) - { return __os.put(_CharT()); } - - template - 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 -#endif -#endif - -#endif /* _CPP_OSTREAM */ - diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue deleted file mode 100644 index ecf7f4c135d..00000000000 --- a/libstdc++-v3/include/std/queue +++ /dev/null @@ -1,81 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* _CPP_QUEUE */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set deleted file mode 100644 index dab8e71af5b..00000000000 --- a/libstdc++-v3/include/std/set +++ /dev/null @@ -1,74 +0,0 @@ -// -*- 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 -#include -#include - -#endif /* _CPP_SET */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream deleted file mode 100644 index fb909862a1e..00000000000 --- a/libstdc++-v3/include/std/sstream +++ /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 -#include - -namespace std -{ - template - 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 __streambuf_type; - typedef basic_string __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(_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 - 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 __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 - 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 __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 - 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 __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 -#endif -#endif - -#endif // _CPP_SSTREAM diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack deleted file mode 100644 index 166f428bf85..00000000000 --- a/libstdc++-v3/include/std/stack +++ /dev/null @@ -1,77 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include - -#endif /* _CPP_STACK */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/std_algorithm.h b/libstdc++-v3/include/std/std_algorithm.h new file mode 100644 index 00000000000..746eb47541b --- /dev/null +++ b/libstdc++-v3/include/std/std_algorithm.h @@ -0,0 +1,76 @@ +// -*- 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 +#include +#include +#include +#include + +#endif /* _CPP_ALGORITHM */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h new file mode 100644 index 00000000000..d9119e17b36 --- /dev/null +++ b/libstdc++-v3/include/std/std_bitset.h @@ -0,0 +1,814 @@ +// -*- 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 // for size_t +#include // for memset +#include +#include +#include // for invalid_argument, out_of_range, + // overflow_error +#include // for ostream (operator<<) +#include // 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 +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 +struct _First_one { + static unsigned char _S_first_one[256]; +}; + +// +// Base class: general case. +// + +template +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::_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 +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 +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 +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 _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(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one::_S_first_one[__this_byte]; + + __thisword >>= CHAR_BIT; + } + } + } + // not found, so return an indication of failure. + return __not_found; +} + +template +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(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one::_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(__thisword & (~(unsigned char)0)); + if ( __this_byte ) + return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT + + _First_one::_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::_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 struct _Sanitize { + static void _M_do_sanitize(unsigned long& __val) + { __val &= ~((~static_cast(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 +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 + 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 + 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 + 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 + void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, + size_t, + size_t); + + template + 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 +template +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 +template +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 +inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result &= __y; + return __result; +} + + +template +inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result |= __y; + return __result; +} + +template +inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { + bitset<_Nb> __result(__x); + __result ^= __y; + return __result; +} + +template +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(0), _Nb); + } + + return __is; +} + +template +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/std_complex.h b/libstdc++-v3/include/std/std_complex.h new file mode 100644 index 00000000000..18dd8675823 --- /dev/null +++ b/libstdc++-v3/include/std/std_complex.h @@ -0,0 +1,1058 @@ +// 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 +// Improved by Gabriel Dos Reis +// + +/** @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 +#include +#include +#include + +namespace std +{ + // Forward declarations + template class complex; + template<> class complex; + template<> class complex; + template<> class complex; + + template _Tp abs(const complex<_Tp>&); + template _Tp arg(const complex<_Tp>&); + template _Tp norm(const complex<_Tp>&); + + template complex<_Tp> conj(const complex<_Tp>&); + template complex<_Tp> polar(const _Tp&, const _Tp& = 0); + + // Transcendentals: + template complex<_Tp> cos(const complex<_Tp>&); + template complex<_Tp> cosh(const complex<_Tp>&); + template complex<_Tp> exp(const complex<_Tp>&); + template complex<_Tp> log(const complex<_Tp>&); + template complex<_Tp> log10(const complex<_Tp>&); + template complex<_Tp> pow(const complex<_Tp>&, int); + template complex<_Tp> pow(const complex<_Tp>&, const _Tp&); + template complex<_Tp> pow(const complex<_Tp>&, + const complex<_Tp>&); + template complex<_Tp> pow(const _Tp&, const complex<_Tp>&); + template complex<_Tp> sin(const complex<_Tp>&); + template complex<_Tp> sinh(const complex<_Tp>&); + template complex<_Tp> sqrt(const complex<_Tp>&); + template complex<_Tp> tan(const complex<_Tp>&); + template complex<_Tp> tanh(const complex<_Tp>&); + + + // 26.2.2 Primary template class complex + template + 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 + 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 + complex<_Tp>& operator=(const complex<_Up>&); + template + complex<_Tp>& operator+=(const complex<_Up>&); + template + complex<_Tp>& operator-=(const complex<_Up>&); + template + complex<_Tp>& operator*=(const complex<_Up>&); + template + complex<_Tp>& operator/=(const complex<_Up>&); + + private: + _Tp _M_real, _M_imag; + }; + + template + inline _Tp + complex<_Tp>::real() const { return _M_real; } + + template + inline _Tp + complex<_Tp>::imag() const { return _M_imag; } + + template + inline + complex<_Tp>::complex(const _Tp& __r, const _Tp& __i) + : _M_real(__r), _M_imag(__i) { } + + template + template + inline + complex<_Tp>::complex(const complex<_Up>& __z) + : _M_real(__z.real()), _M_imag(__z.imag()) { } + + template + complex<_Tp>& + complex<_Tp>::operator=(const _Tp& __t) + { + _M_real = __t; + _M_imag = _Tp(); + return *this; + } + + // 26.2.5/1 + template + inline complex<_Tp>& + complex<_Tp>::operator+=(const _Tp& __t) + { + _M_real += __t; + return *this; + } + + // 26.2.5/3 + template + inline complex<_Tp>& + complex<_Tp>::operator-=(const _Tp& __t) + { + _M_real -= __t; + return *this; + } + + // 26.2.5/5 + template + complex<_Tp>& + complex<_Tp>::operator*=(const _Tp& __t) + { + _M_real *= __t; + _M_imag *= __t; + return *this; + } + + // 26.2.5/7 + template + complex<_Tp>& + complex<_Tp>::operator/=(const _Tp& __t) + { + _M_real /= __t; + _M_imag /= __t; + return *this; + } + + template + template + complex<_Tp>& + complex<_Tp>::operator=(const complex<_Up>& __z) + { + _M_real = __z.real(); + _M_imag = __z.imag(); + return *this; + } + + // 26.2.5/9 + template + template + complex<_Tp>& + complex<_Tp>::operator+=(const complex<_Up>& __z) + { + _M_real += __z.real(); + _M_imag += __z.imag(); + return *this; + } + + // 26.2.5/11 + template + template + 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 + template + 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 + template + 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 + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) += __y; } + + template + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) += __y; } + + template + inline complex<_Tp> + operator+(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__y) += __x; } + + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) -= __y; } + + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) -= __y; } + + template + inline complex<_Tp> + operator-(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) -= __y; } + + template + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) *= __y; } + + template + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) *= __y; } + + template + inline complex<_Tp> + operator*(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__y) *= __x; } + + template + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) /= __y; } + + template + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const _Tp& __y) + { return complex<_Tp> (__x) /= __y; } + + template + inline complex<_Tp> + operator/(const _Tp& __x, const complex<_Tp>& __y) + { return complex<_Tp> (__x) /= __y; } + + template + inline complex<_Tp> + operator+(const complex<_Tp>& __x) + { return __x; } + + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x) + { return complex<_Tp>(-__x.real(), -__x.imag()); } + + template + inline bool + operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() == __y.real() && __x.imag() == __y.imag(); } + + template + inline bool + operator==(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() == __y && __x.imag() == _Tp(); } + + template + inline bool + operator==(const _Tp& __x, const complex<_Tp>& __y) + { return __x == __y.real() && _Tp() == __y.imag(); } + + template + inline bool + operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() != __y.real() || __x.imag() != __y.imag(); } + + template + inline bool + operator!=(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() != __y || __x.imag() != _Tp(); } + + template + inline bool + operator!=(const _Tp& __x, const complex<_Tp>& __y) + { return __x != __y.real() || _Tp() != __y.imag(); } + + template + 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 + 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 + inline _Tp + real(const complex<_Tp>& __z) + { return __z.real(); } + + template + inline _Tp + imag(const complex<_Tp>& __z) + { return __z.imag(); } + + template + 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 + 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 + struct _Norm_helper + { + template + 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 + { + template + static inline _Tp _S_do_it(const complex<_Tp>& __z) + { + _Tp __res = abs(__z); + return __res * __res; + } + }; + + template + inline _Tp + norm(const complex<_Tp>& __z) + { + return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z); + } + + template + inline complex<_Tp> + polar(const _Tp& __rho, const _Tp& __theta) + { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } + + template + inline complex<_Tp> + conj(const complex<_Tp>& __z) + { return complex<_Tp>(__z.real(), -__z.imag()); } + + // Transcendentals + template + 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 + 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 + inline complex<_Tp> + exp(const complex<_Tp>& __z) + { return polar(exp(__z.real()), __z.imag()); } + + template + inline complex<_Tp> + log(const complex<_Tp>& __z) + { return complex<_Tp>(log(abs(__z)), arg(__z)); } + + template + inline complex<_Tp> + log10(const complex<_Tp>& __z) + { return log(__z) / log(_Tp(10.0)); } + + template + 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 + 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 + 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 + inline complex<_Tp> + tan(const complex<_Tp>& __z) + { + return sin(__z) / cos(__z); + } + + template + inline complex<_Tp> + tanh(const complex<_Tp>& __z) + { + return sinh(__z) / cosh(__z); + } + + template + inline complex<_Tp> + pow(const complex<_Tp>& __z, int __n) + { + return __pow_helper(__z, __n); + } + + template + inline complex<_Tp> + pow(const complex<_Tp>& __x, const _Tp& __y) + { + return exp(__y * log(__x)); + } + + template + inline complex<_Tp> + pow(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + return exp(__y * log(__x)); + } + + template + inline complex<_Tp> + pow(const _Tp& __x, const complex<_Tp>& __y) + { + return exp(__y * log(__x)); + } + + // 26.2.3 complex specializations + // complex specialization + template<> class complex + { + 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&); + explicit complex(const complex&); + + float real() const; + float imag() const; + + complex& operator=(float); + complex& operator+=(float); + complex& operator-=(float); + complex& operator*=(float); + complex& operator/=(float); + + // Let's the compiler synthetize the copy and assignment + // operator. It always does a pretty good job. + // complex& operator= (const complex&); + template + complex&operator=(const complex<_Tp>&); + template + complex& operator+=(const complex<_Tp>&); + template + complex& operator-=(const complex<_Tp>&); + template + complex& operator*=(const complex<_Tp>&); + template + complex&operator/=(const complex<_Tp>&); + + private: + typedef __complex__ float _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex; + friend class complex; + }; + + inline float + complex::real() const + { return __real__ _M_value; } + + inline float + complex::imag() const + { return __imag__ _M_value; } + + inline + complex::complex(float r, float i) + { + __real__ _M_value = r; + __imag__ _M_value = i; + } + + inline complex& + complex::operator=(float __f) + { + __real__ _M_value = __f; + __imag__ _M_value = 0.0f; + return *this; + } + + inline complex& + complex::operator+=(float __f) + { + __real__ _M_value += __f; + return *this; + } + + inline complex& + complex::operator-=(float __f) + { + __real__ _M_value -= __f; + return *this; + } + + inline complex& + complex::operator*=(float __f) + { + _M_value *= __f; + return *this; + } + + inline complex& + complex::operator/=(float __f) + { + _M_value /= __f; + return *this; + } + + template + inline complex& + complex::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + inline complex& + complex::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + inline complex& + complex::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + inline complex& + complex::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + inline complex& + complex::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 specialization + template<> class complex + { + 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&); + explicit complex(const complex&); + + double real() const; + double imag() const; + + complex& operator=(double); + complex& operator+=(double); + complex& operator-=(double); + complex& operator*=(double); + complex& operator/=(double); + + // The compiler will synthetize this, efficiently. + // complex& operator= (const complex&); + template + complex& operator=(const complex<_Tp>&); + template + complex& operator+=(const complex<_Tp>&); + template + complex& operator-=(const complex<_Tp>&); + template + complex& operator*=(const complex<_Tp>&); + template + complex& operator/=(const complex<_Tp>&); + + private: + typedef __complex__ double _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex; + friend class complex; + }; + + inline double + complex::real() const + { return __real__ _M_value; } + + inline double + complex::imag() const + { return __imag__ _M_value; } + + inline + complex::complex(double __r, double __i) + { + __real__ _M_value = __r; + __imag__ _M_value = __i; + } + + inline complex& + complex::operator=(double __d) + { + __real__ _M_value = __d; + __imag__ _M_value = 0.0; + return *this; + } + + inline complex& + complex::operator+=(double __d) + { + __real__ _M_value += __d; + return *this; + } + + inline complex& + complex::operator-=(double __d) + { + __real__ _M_value -= __d; + return *this; + } + + inline complex& + complex::operator*=(double __d) + { + _M_value *= __d; + return *this; + } + + inline complex& + complex::operator/=(double __d) + { + _M_value /= __d; + return *this; + } + + template + inline complex& + complex::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + inline complex& + complex::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + inline complex& + complex::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + inline complex& + complex::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + inline complex& + complex::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 specialization + template<> class complex + { + 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&); + complex(const complex&); + + long double real() const; + long double imag() const; + + complex& operator= (long double); + complex& operator+= (long double); + complex& operator-= (long double); + complex& operator*= (long double); + complex& operator/= (long double); + + // The compiler knows how to do this efficiently + // complex& operator= (const complex&); + template + complex& operator=(const complex<_Tp>&); + template + complex& operator+=(const complex<_Tp>&); + template + complex& operator-=(const complex<_Tp>&); + template + complex& operator*=(const complex<_Tp>&); + template + complex& operator/=(const complex<_Tp>&); + + private: + typedef __complex__ long double _ComplexT; + _ComplexT _M_value; + + complex(_ComplexT __z) : _M_value(__z) { } + + friend class complex; + friend class complex; + }; + + inline + complex::complex(long double __r, long double __i) + { + __real__ _M_value = __r; + __imag__ _M_value = __i; + } + + inline long double + complex::real() const + { return __real__ _M_value; } + + inline long double + complex::imag() const + { return __imag__ _M_value; } + + inline complex& + complex::operator=(long double __r) + { + __real__ _M_value = __r; + __imag__ _M_value = 0.0L; + return *this; + } + + inline complex& + complex::operator+=(long double __r) + { + __real__ _M_value += __r; + return *this; + } + + inline complex& + complex::operator-=(long double __r) + { + __real__ _M_value -= __r; + return *this; + } + + inline complex& + complex::operator*=(long double __r) + { + _M_value *= __r; + return *this; + } + + inline complex& + complex::operator/=(long double __r) + { + _M_value /= __r; + return *this; + } + + template + inline complex& + complex::operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + inline complex& + complex::operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + inline complex& + complex::operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + inline complex& + complex::operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + inline complex& + complex::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::complex(const complex& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex::complex(const complex& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex::complex(const complex& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex::complex(const complex& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + } + + inline + complex::complex(const complex& __z) + : _M_value(_ComplexT(__z._M_value)) { } + + inline + complex::complex(const complex& __z) + : _M_value(_ComplexT(__z._M_value)) { } +} // namespace std + +#endif /* _CPP_COMPLEX */ diff --git a/libstdc++-v3/include/std/std_deque.h b/libstdc++-v3/include/std/std_deque.h new file mode 100644 index 00000000000..394eef3b845 --- /dev/null +++ b/libstdc++-v3/include/std/std_deque.h @@ -0,0 +1,77 @@ +// -*- 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 +#include +#include +#include +#include +#include + +#endif /* _CPP_DEQUE */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h new file mode 100644 index 00000000000..a04ddf098dd --- /dev/null +++ b/libstdc++-v3/include/std/std_fstream.h @@ -0,0 +1,433 @@ +// 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 +#include +#include +#include // For codecvt +#include + +namespace std +{ + template + 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 __streambuf_type; + typedef basic_filebuf __filebuf_type; + typedef __basic_file __file_type; + typedef typename traits_type::state_type __state_type; + typedef codecvt __codecvt_type; + typedef typename __codecvt_type::result __res_type; + typedef ctype __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(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; + + // Make sure that the internal buffer resyncs its idea of + // the file position with the external file. + if (__testput && !_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 + 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 __filebuf_type; + typedef basic_istream __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 + 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 __filebuf_type; + typedef basic_ostream __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()) + this->setstate(ios_base::failbit); + } + }; + + + // 27.8.1.11 Template class basic_fstream + template + 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 __filebuf_type; + typedef basic_ios __ios_type; + typedef basic_iostream __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 +#endif +#endif + +#endif + diff --git a/libstdc++-v3/include/std/std_functional.h b/libstdc++-v3/include/std/std_functional.h new file mode 100644 index 00000000000..16702caead1 --- /dev/null +++ b/libstdc++-v3/include/std/std_functional.h @@ -0,0 +1,62 @@ +// -*- 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 +#include +#include + +#endif /* _CPP_FUNCTIONAL */ + +// Local Variables: +// mode:C++ +// End: + diff --git a/libstdc++-v3/include/std/std_iomanip.h b/libstdc++-v3/include/std/std_iomanip.h new file mode 100644 index 00000000000..ab279d20ab6 --- /dev/null +++ b/libstdc++-v3/include/std/std_iomanip.h @@ -0,0 +1,221 @@ +// 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 +#include +#include + +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 + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f) + { + __is.setf(ios_base::fmtflags(0), __f._M_mask); + return __is; + } + + template + 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 + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f) + { + __is.setf(__f._M_mask); + return __is; + } + + template + 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 + 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 + 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 + struct _Setfill { _CharT _M_c; }; + + template + _Setfill<_CharT> + setfill(_CharT __c) + { + _Setfill<_CharT> __x; + __x._M_c = __c; + return __x; + } + + template + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f) + { + __is.fill(__f._M_c); + return __is; + } + + template + 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 + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f) + { + __is.precision(__f._M_n); + return __is; + } + + template + 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 + basic_istream<_CharT,_Traits>& + operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f) + { + __is.width(__f._M_n); + return __is; + } + + template + 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/std_ios.h b/libstdc++-v3/include/std/std_ios.h new file mode 100644 index 00000000000..1e61c366d4e --- /dev/null +++ b/libstdc++-v3/include/std/std_ios.h @@ -0,0 +1,54 @@ +// 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 +#include // For ios_base::failure +#include // For char_traits, streamoff, streamsize, fpos +#include // For SEEK_SET, SEEK_CUR, SEEK_END +#include // For class locale +#include // For ios_base declarations. +#include +#include + +#endif /* _CPP_IOS */ + diff --git a/libstdc++-v3/include/std/std_iosfwd.h b/libstdc++-v3/include/std/std_iosfwd.h new file mode 100644 index 00000000000..93c30b3fbf4 --- /dev/null +++ b/libstdc++-v3/include/std/std_iosfwd.h @@ -0,0 +1,136 @@ +// 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 +#include // For string forward declarations. +#include +#include + +namespace std +{ + template > + class basic_ios; + + template > + class basic_streambuf; + + template > + class basic_istream; + + template > + class basic_ostream; + + template > + class basic_iostream; + + template, + typename _Alloc = allocator<_CharT> > + class basic_stringbuf; + + template, + typename _Alloc = allocator<_CharT> > + class basic_istringstream; + + template, + typename _Alloc = allocator<_CharT> > + class basic_ostringstream; + + template, + typename _Alloc = allocator<_CharT> > + class basic_stringstream; + + template > + class basic_filebuf; + + template > + class basic_ifstream; + + template > + class basic_ofstream; + + template > + class basic_fstream; + + template > + class istreambuf_iterator; + + template > + class ostreambuf_iterator; + +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS + // Not included. (??? Apparently no LWG number?) + class ios_base; +#endif + + typedef basic_ios ios; + typedef basic_streambuf streambuf; + typedef basic_istream istream; + typedef basic_ostream ostream; + typedef basic_iostream iostream; + typedef basic_stringbuf stringbuf; + typedef basic_istringstream istringstream; + typedef basic_ostringstream ostringstream; + typedef basic_stringstream stringstream; + typedef basic_filebuf filebuf; + typedef basic_ifstream ifstream; + typedef basic_ofstream ofstream; + typedef basic_fstream fstream; + +#ifdef _GLIBCPP_USE_WCHAR_T + typedef basic_ios wios; + typedef basic_streambuf wstreambuf; + typedef basic_istream wistream; + typedef basic_ostream wostream; + typedef basic_iostream wiostream; + typedef basic_stringbuf wstringbuf; + typedef basic_istringstream wistringstream; + typedef basic_ostringstream wostringstream; + typedef basic_stringstream wstringstream; + typedef basic_filebuf wfilebuf; + typedef basic_ifstream wifstream; + typedef basic_ofstream wofstream; + typedef basic_fstream wfstream; +#endif +} // namespace std + +#endif diff --git a/libstdc++-v3/include/std/std_iostream.h b/libstdc++-v3/include/std/std_iostream.h new file mode 100644 index 00000000000..47b83798f5d --- /dev/null +++ b/libstdc++-v3/include/std/std_iostream.h @@ -0,0 +1,65 @@ +// 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 +#include +#include + +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/std_istream.h b/libstdc++-v3/include/std/std_istream.h new file mode 100644 index 00000000000..7b5185289b2 --- /dev/null +++ b/libstdc++-v3/include/std/std_istream.h @@ -0,0 +1,299 @@ +// 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 +#include // For numeric_limits + +namespace std +{ + // 27.6.1.1 Template class basic_istream + template + 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 + 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 + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c); + + template + basic_istream& + operator>>(basic_istream& __in, unsigned char& __c) + { return (__in >> reinterpret_cast(__c)); } + + template + basic_istream& + operator>>(basic_istream& __in, signed char& __c) + { return (__in >> reinterpret_cast(__c)); } + + template + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s); + + template + basic_istream& + operator>>(basic_istream& __in, unsigned char* __s) + { return (__in >> reinterpret_cast(__s)); } + + template + basic_istream& + operator>>(basic_istream& __in, signed char* __s) + { return (__in >> reinterpret_cast(__s)); } + + // 27.6.1.5 Template class basic_iostream + template + 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 + 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 +#endif +#endif + +#endif /* _CPP_ISTREAM */ diff --git a/libstdc++-v3/include/std/std_iterator.h b/libstdc++-v3/include/std/std_iterator.h new file mode 100644 index 00000000000..f0eee1164ba --- /dev/null +++ b/libstdc++-v3/include/std/std_iterator.h @@ -0,0 +1,79 @@ +// -*- 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* _CPP_ITERATOR */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_limits.h b/libstdc++-v3/include/std/std_limits.h new file mode 100644 index 00000000000..7a6463625ae --- /dev/null +++ b/libstdc++-v3/include/std/std_limits.h @@ -0,0 +1,2017 @@ +// 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 + +// +// 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 +#include + +// +// 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 + 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 + const bool + numeric_limits<_Tp>::is_specialized; + + template + const int + numeric_limits<_Tp>::digits; + + template + const int + numeric_limits<_Tp>::digits10; + + template + const bool + numeric_limits<_Tp>::is_signed; + + template + const bool + numeric_limits<_Tp>::is_integer; + + template + const bool + numeric_limits<_Tp>::is_exact; + + template + const int + numeric_limits<_Tp>::radix; + + template + const int + numeric_limits<_Tp>::min_exponent; + + template + const int + numeric_limits<_Tp>::min_exponent10; + + template + const int + numeric_limits<_Tp>::max_exponent; + + template + const int + numeric_limits<_Tp>::max_exponent10; + + template + const bool + numeric_limits<_Tp>::has_infinity; + + template + const bool + numeric_limits<_Tp>::has_quiet_NaN; + + template + const bool + numeric_limits<_Tp>::has_signaling_NaN; + + template + const float_denorm_style + numeric_limits<_Tp>::has_denorm; + + template + const bool + numeric_limits<_Tp>::has_denorm_loss; + + template + const bool + numeric_limits<_Tp>::is_iec559; + + template + const bool + numeric_limits<_Tp>::is_bounded; + + template + const bool + numeric_limits<_Tp>::is_modulo; + + template + const bool + numeric_limits<_Tp>::traps; + + template + const bool + numeric_limits<_Tp>::tinyness_before; + + template + 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 + { + 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 + { + 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(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 + { + 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(0); } + static signed char quiet_NaN() throw() + { return static_cast(0); } + static signed char signaling_NaN() throw() + { return static_cast(0); } + static signed char denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static unsigned char quiet_NaN() throw() + { return static_cast(0); } + static unsigned char signaling_NaN() throw() + { return static_cast(0); } + static unsigned char denorm_min() throw() + { return static_cast(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 + { + 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 + { + 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 + { + 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(0); } + static unsigned short quiet_NaN() throw() + { return static_cast(0); } + static unsigned short signaling_NaN() throw() + { return static_cast(0); } + static unsigned short denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static int quiet_NaN() throw() + { return static_cast(0); } + static int signaling_NaN() throw() + { return static_cast(0); } + static int denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static unsigned int quiet_NaN() throw() + { return static_cast(0); } + static unsigned int signaling_NaN() throw() + { return static_cast(0); } + static unsigned int denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static long quiet_NaN() throw() + { return static_cast(0); } + static long signaling_NaN() throw() + { return static_cast(0); } + static long denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static unsigned long quiet_NaN() throw() + { return static_cast(0); } + static unsigned long signaling_NaN() throw() + { return static_cast(0); } + static unsigned long denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static long long quiet_NaN() throw() + { return static_cast(0); } + static long long signaling_NaN() throw() + { return static_cast(0); } + static long long denorm_min() throw() + { return static_cast(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 + { + 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(0); } + static unsigned long long quiet_NaN() throw() + { return static_cast(0); } + static unsigned long long signaling_NaN() throw() + { return static_cast(0); } + static unsigned long long denorm_min() throw() + { return static_cast(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 + { + 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 + { + 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 + { + 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/std_list.h b/libstdc++-v3/include/std/std_list.h new file mode 100644 index 00000000000..683e0a7e66d --- /dev/null +++ b/libstdc++-v3/include/std/std_list.h @@ -0,0 +1,77 @@ +// -*- 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 +#include +#include +#include +#include +#include + +#endif /* _CPP_LIST */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_locale.h b/libstdc++-v3/include/std/std_locale.h new file mode 100644 index 00000000000..82089d01539 --- /dev/null +++ b/libstdc++-v3/include/std/std_locale.h @@ -0,0 +1,52 @@ +// 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 +#include +#include + +#endif + +// Local Variables: +// mode:c++ +// End: diff --git a/libstdc++-v3/include/std/std_map.h b/libstdc++-v3/include/std/std_map.h new file mode 100644 index 00000000000..0dd38bfafd3 --- /dev/null +++ b/libstdc++-v3/include/std/std_map.h @@ -0,0 +1,74 @@ +// -*- 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 +#include +#include + +#endif /* _CPP_MAP */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_memory.h b/libstdc++-v3/include/std/std_memory.h new file mode 100644 index 00000000000..c9a2e59e48e --- /dev/null +++ b/libstdc++-v3/include/std/std_memory.h @@ -0,0 +1,149 @@ +// -*- 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 +#include +#include +#include //for iterator_traits +#include +#include +#include + +namespace std +{ + + template 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 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 auto_ptr(auto_ptr<_Tp1>& __a) throw() + : _M_ptr(__a.release()) {} + + auto_ptr& operator=(auto_ptr& __a) throw() { + reset(__a.release()); + return *this; + } + + template + 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 operator auto_ptr_ref<_Tp1>() throw() + { return auto_ptr_ref<_Tp>(this->release()); } + template 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/std_numeric.h b/libstdc++-v3/include/std/std_numeric.h new file mode 100644 index 00000000000..e7a6adc3ad4 --- /dev/null +++ b/libstdc++-v3/include/std/std_numeric.h @@ -0,0 +1,75 @@ +// -*- 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 +#include +#include +#include +#include + +#endif /* _CPP_NUMERIC */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_ostream.h b/libstdc++-v3/include/std/std_ostream.h new file mode 100644 index 00000000000..e3ec3260ec0 --- /dev/null +++ b/libstdc++-v3/include/std/std_ostream.h @@ -0,0 +1,288 @@ +// 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 + +namespace std +{ + // 27.6.2.1 Template class basic_ostream + template + 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 + (static_cast(__n))); + else + return this->operator<<(static_cast(__n)); + } + + __ostream_type& + operator<<(unsigned short __n) + { return this->operator<<(static_cast(__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 + (static_cast(__n))); + else + return this->operator<<(static_cast(__n)); + } + + __ostream_type& + operator<<(unsigned int __n) + { return this->operator<<(static_cast(__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(__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 + 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 + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c); + + template + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) + { return (__out << __out.widen(__c)); } + + // Specialization + template + basic_ostream& + operator<<(basic_ostream& __out, char __c); + + // Signed and unsigned + template + basic_ostream& + operator<<(basic_ostream& __out, signed char __c) + { return (__out << static_cast(__c)); } + + template + basic_ostream& + operator<<(basic_ostream& __out, unsigned char __c) + { return (__out << static_cast(__c)); } + + template + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s); + + template + basic_ostream<_CharT, _Traits> & + operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s); + + // Partial specializationss + template + basic_ostream& + operator<<(basic_ostream& __out, const char* __s); + + // Signed and unsigned + template + basic_ostream& + operator<<(basic_ostream& __out, const signed char* __s) + { return (__out << reinterpret_cast(__s)); } + + template + basic_ostream & + operator<<(basic_ostream& __out, const unsigned char* __s) + { return (__out << reinterpret_cast(__s)); } + + // 27.6.2.7 Standard basic_ostream manipulators + template + basic_ostream<_CharT, _Traits>& + endl(basic_ostream<_CharT, _Traits>& __os) + { return flush(__os.put(__os.widen('\n'))); } + + template + basic_ostream<_CharT, _Traits>& + ends(basic_ostream<_CharT, _Traits>& __os) + { return __os.put(_CharT()); } + + template + 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 +#endif +#endif + +#endif /* _CPP_OSTREAM */ + diff --git a/libstdc++-v3/include/std/std_queue.h b/libstdc++-v3/include/std/std_queue.h new file mode 100644 index 00000000000..ecf7f4c135d --- /dev/null +++ b/libstdc++-v3/include/std/std_queue.h @@ -0,0 +1,81 @@ +// -*- 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* _CPP_QUEUE */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_set.h b/libstdc++-v3/include/std/std_set.h new file mode 100644 index 00000000000..dab8e71af5b --- /dev/null +++ b/libstdc++-v3/include/std/std_set.h @@ -0,0 +1,74 @@ +// -*- 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 +#include +#include + +#endif /* _CPP_SET */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h new file mode 100644 index 00000000000..fb909862a1e --- /dev/null +++ b/libstdc++-v3/include/std/std_sstream.h @@ -0,0 +1,372 @@ +// 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 +#include + +namespace std +{ + template + 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 __streambuf_type; + typedef basic_string __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(_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 + 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 __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 + 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 __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 + 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 __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 +#endif +#endif + +#endif // _CPP_SSTREAM diff --git a/libstdc++-v3/include/std/std_stack.h b/libstdc++-v3/include/std/std_stack.h new file mode 100644 index 00000000000..166f428bf85 --- /dev/null +++ b/libstdc++-v3/include/std/std_stack.h @@ -0,0 +1,77 @@ +// -*- 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 +#include +#include +#include +#include +#include + +#endif /* _CPP_STACK */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_stdexcept.h b/libstdc++-v3/include/std/std_stdexcept.h new file mode 100644 index 00000000000..66bac5011be --- /dev/null +++ b/libstdc++-v3/include/std/std_stdexcept.h @@ -0,0 +1,150 @@ +// 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 +#include + +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/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h new file mode 100644 index 00000000000..59f70705361 --- /dev/null +++ b/libstdc++-v3/include/std/std_streambuf.h @@ -0,0 +1,540 @@ +// 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 +#include +#include // For SEEK_SET, SEEK_CUR, SEEK_END +#include +#include + +namespace std +{ + template + 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 + 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 __ctype_type; + typedef basic_streambuf __streambuf_type; + + friend class basic_ios; + friend class basic_istream; + friend class basic_ostream; + friend class istreambuf_iterator; + friend class ostreambuf_iterator; + + friend streamsize + __copy_streambufs<>(basic_ios& __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(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* + 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 +#endif +#endif + +#endif /* _CPP_STREAMBUF */ + diff --git a/libstdc++-v3/include/std/std_string.h b/libstdc++-v3/include/std/std_string.h new file mode 100644 index 00000000000..9cdc533e4a2 --- /dev/null +++ b/libstdc++-v3/include/std/std_string.h @@ -0,0 +1,60 @@ +// 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 +#include +#include +#include // For allocator. +#include +#include // For operators >>, <<, and getline decls. +#include +#include // For less +#include + +#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT +# include // for find_if +# include +#endif + +#endif /* _CPP_STRING */ + diff --git a/libstdc++-v3/include/std/std_utility.h b/libstdc++-v3/include/std/std_utility.h new file mode 100644 index 00000000000..5917c833818 --- /dev/null +++ b/libstdc++-v3/include/std/std_utility.h @@ -0,0 +1,73 @@ +// -*- 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 +#include +#include + +#endif /* _CPP_UTILITY */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/std_valarray.h b/libstdc++-v3/include/std/std_valarray.h new file mode 100644 index 00000000000..a3547080ed3 --- /dev/null +++ b/libstdc++-v3/include/std/std_valarray.h @@ -0,0 +1,742 @@ +// 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 + +/** @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 +#include +#include +#include +#include +#include +#include + +namespace std +{ + template class _Expr; + + template class _ValArray; + + template class _Oper, + template class _Meta, class _Dom> struct _UnClos; + + template class _Oper, + template class _Meta1, + template class _Meta2, + class _Dom1, class _Dom2> class _BinClos; + + template class _Meta, class _Dom> class _SClos; + + template class _Meta, class _Dom> class _GClos; + + template class _Meta, class _Dom> class _IClos; + + template class _Meta, class _Dom> class _ValFunClos; + + template class _Meta, class _Dom> class _RefFunClos; + + template struct _Unary_plus; + template struct _Bitwise_and; + template struct _Bitwise_or; + template struct _Bitwise_xor; + template struct _Bitwise_not; + template struct _Shift_left; + template struct _Shift_right; + + template class valarray; // An array of type _Tp + class slice; // BLAS-like slice out of an array + template class slice_array; + class gslice; // generalized slice out of an array + template class gslice_array; + template class mask_array; // masked array + template class indirect_array; // indirected array + +} // namespace std + +#include +#include + +namespace std +{ + template 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 + 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 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&) const; + mask_array<_Tp> operator[](const valarray&); + _Expr<_IClos<_ValArray, _Tp>, _Tp> + operator[](const valarray&) const; + indirect_array<_Tp> operator[](const valarray&); + + // _lib.valarray.unary_ unary operators: + _Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const; + _Expr<_UnClos,_Tp> operator- () const; + _Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const; + _Expr<_UnClos,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 + valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&); + template + valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&); + template + 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 struct _Unary_plus : unary_function<_Tp,_Tp> { + _Tp operator() (const _Tp& __t) const { return __t; } + }; + + template struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; } + }; + + template struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; } + }; + + template struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; } + }; + + template struct _Bitwise_not : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __t) const { return ~__t; } + }; + + template struct _Shift_left : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; } + }; + + template struct _Shift_right : unary_function<_Tp,_Tp> { + _Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; } + }; + + + template + inline const _Tp& + valarray<_Tp>::operator[] (size_t __i) const + { return _M_data[__i]; } + + template + inline _Tp& + valarray<_Tp>::operator[] (size_t __i) + { return _M_data[__i]; } + +} // std:: + +#include +#include +#include +#include +#include +#include + +namespace std +{ + template + inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {} + + template + 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 + 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 + 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 + 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 + 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 + 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(__ga._M_index), + _Array<_Tp>(_M_data), _M_size); + } + + template + 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 + 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 template + 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 + inline valarray<_Tp>::~valarray () + { + __valarray_destroy_elements(_M_data, _M_data + _M_size); + __valarray_release_memory(_M_data); + } + + template + inline valarray<_Tp>& + valarray<_Tp>::operator= (const valarray<_Tp>& __v) + { + __valarray_copy(__v._M_data, _M_size, _M_data); + return *this; + } + + template + inline valarray<_Tp>& + valarray<_Tp>::operator= (const _Tp& __t) + { + __valarray_fill (_M_data, _M_size, __t); + return *this; + } + + template + 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 + inline valarray<_Tp>& + valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga) + { + __valarray_copy (__ga._M_array, _Array(__ga._M_index), + _Array<_Tp>(_M_data), _M_size); + return *this; + } + + template + 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 + 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 template + inline valarray<_Tp>& + valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e) + { + __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); + return *this; + } + + template + 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 + inline slice_array<_Tp> + valarray<_Tp>::operator[] (slice __s) + { + return slice_array<_Tp> (_Array<_Tp>(_M_data), __s); + } + + template + 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 + inline gslice_array<_Tp> + valarray<_Tp>::operator[] (const gslice& __gs) + { + return gslice_array<_Tp> + (_Array<_Tp>(_M_data), __gs._M_index->_M_index); + } + + template + inline valarray<_Tp> + valarray<_Tp>::operator[] (const valarray& __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 (__m))); + } + + template + inline mask_array<_Tp> + valarray<_Tp>::operator[] (const valarray& __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 (__m)); + } + + template + inline _Expr<_IClos<_ValArray,_Tp>, _Tp> + valarray<_Tp>::operator[] (const valarray& __i) const + { + typedef _IClos<_ValArray,_Tp> _Closure; + return _Expr<_Closure, _Tp> (_Closure (*this, __i)); + } + + template + inline indirect_array<_Tp> + valarray<_Tp>::operator[] (const valarray& __i) + { + return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(), + _Array (__i)); + } + + template + inline size_t valarray<_Tp>::size () const { return _M_size; } + + template + inline _Tp + valarray<_Tp>::sum () const + { + return __valarray_sum(_M_data, _M_data + _M_size); + } + +// template +// inline _Tp +// valarray<_Tp>::product () const +// { +// return __valarray_product(_M_data, _M_data + _M_size); +// } + + template + 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 + 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 + inline void + valarray<_Tp>::resize (size_t __n, _Tp __c) + { + // This complication is so to make valarray > work + // even though it is not required by the standard. Nobody should + // be saying valarray > 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 + inline _Tp + valarray<_Tp>::min() const + { + return *min_element (_M_data, _M_data+_M_size); + } + + template + inline _Tp + valarray<_Tp>::max() const + { + return *max_element (_M_data, _M_data+_M_size); + } + + template + 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 + 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 \ + 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 + inline _Expr<_UnClos, bool> + valarray<_Tp>::operator!() const + { + typedef _UnClos _Closure; + return _Expr<_Closure, bool> (_Closure (*this)); + } + +#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \ + template \ + inline valarray<_Tp> & \ + valarray<_Tp>::operator _Op##= (const _Tp &__t) \ + { \ + _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \ + return *this; \ + } \ + \ + template \ + 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 template \ + 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 \ + 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 \ + 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 \ + 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 \ + 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 \ + 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 \ + 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/std_vector.h b/libstdc++-v3/include/std/std_vector.h new file mode 100644 index 00000000000..995daec7249 --- /dev/null +++ b/libstdc++-v3/include/std/std_vector.h @@ -0,0 +1,78 @@ +// -*- 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 +#include +#include +#include +#include +#include +#include + +#endif /* _CPP_VECTOR */ + +// Local Variables: +// mode:C++ +// End: diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept deleted file mode 100644 index 66bac5011be..00000000000 --- a/libstdc++-v3/include/std/stdexcept +++ /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 -#include - -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 deleted file mode 100644 index 59f70705361..00000000000 --- a/libstdc++-v3/include/std/streambuf +++ /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 -#include -#include // For SEEK_SET, SEEK_CUR, SEEK_END -#include -#include - -namespace std -{ - template - 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 - 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 __ctype_type; - typedef basic_streambuf __streambuf_type; - - friend class basic_ios; - friend class basic_istream; - friend class basic_ostream; - friend class istreambuf_iterator; - friend class ostreambuf_iterator; - - friend streamsize - __copy_streambufs<>(basic_ios& __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(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* - 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 -#endif -#endif - -#endif /* _CPP_STREAMBUF */ - diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string deleted file mode 100644 index 9cdc533e4a2..00000000000 --- a/libstdc++-v3/include/std/string +++ /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 -#include -#include -#include // For allocator. -#include -#include // For operators >>, <<, and getline decls. -#include -#include // For less -#include - -#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT -# include // for find_if -# include -#endif - -#endif /* _CPP_STRING */ - diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility deleted file mode 100644 index 5917c833818..00000000000 --- a/libstdc++-v3/include/std/utility +++ /dev/null @@ -1,73 +0,0 @@ -// -*- 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 -#include -#include - -#endif /* _CPP_UTILITY */ - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray deleted file mode 100644 index a3547080ed3..00000000000 --- a/libstdc++-v3/include/std/valarray +++ /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 - -/** @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 -#include -#include -#include -#include -#include -#include - -namespace std -{ - template class _Expr; - - template class _ValArray; - - template class _Oper, - template class _Meta, class _Dom> struct _UnClos; - - template class _Oper, - template class _Meta1, - template class _Meta2, - class _Dom1, class _Dom2> class _BinClos; - - template class _Meta, class _Dom> class _SClos; - - template class _Meta, class _Dom> class _GClos; - - template class _Meta, class _Dom> class _IClos; - - template class _Meta, class _Dom> class _ValFunClos; - - template class _Meta, class _Dom> class _RefFunClos; - - template struct _Unary_plus; - template struct _Bitwise_and; - template struct _Bitwise_or; - template struct _Bitwise_xor; - template struct _Bitwise_not; - template struct _Shift_left; - template struct _Shift_right; - - template class valarray; // An array of type _Tp - class slice; // BLAS-like slice out of an array - template class slice_array; - class gslice; // generalized slice out of an array - template class gslice_array; - template class mask_array; // masked array - template class indirect_array; // indirected array - -} // namespace std - -#include -#include - -namespace std -{ - template 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 - 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 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&) const; - mask_array<_Tp> operator[](const valarray&); - _Expr<_IClos<_ValArray, _Tp>, _Tp> - operator[](const valarray&) const; - indirect_array<_Tp> operator[](const valarray&); - - // _lib.valarray.unary_ unary operators: - _Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const; - _Expr<_UnClos,_Tp> operator- () const; - _Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const; - _Expr<_UnClos,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 - valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&); - template - valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&); - template - 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 struct _Unary_plus : unary_function<_Tp,_Tp> { - _Tp operator() (const _Tp& __t) const { return __t; } - }; - - template struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; } - }; - - template struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; } - }; - - template struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; } - }; - - template struct _Bitwise_not : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __t) const { return ~__t; } - }; - - template struct _Shift_left : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; } - }; - - template struct _Shift_right : unary_function<_Tp,_Tp> { - _Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; } - }; - - - template - inline const _Tp& - valarray<_Tp>::operator[] (size_t __i) const - { return _M_data[__i]; } - - template - inline _Tp& - valarray<_Tp>::operator[] (size_t __i) - { return _M_data[__i]; } - -} // std:: - -#include -#include -#include -#include -#include -#include - -namespace std -{ - template - inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {} - - template - 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 - 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 - 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 - 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 - 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 - 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(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - } - - template - 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 - 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 template - 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 - inline valarray<_Tp>::~valarray () - { - __valarray_destroy_elements(_M_data, _M_data + _M_size); - __valarray_release_memory(_M_data); - } - - template - inline valarray<_Tp>& - valarray<_Tp>::operator= (const valarray<_Tp>& __v) - { - __valarray_copy(__v._M_data, _M_size, _M_data); - return *this; - } - - template - inline valarray<_Tp>& - valarray<_Tp>::operator= (const _Tp& __t) - { - __valarray_fill (_M_data, _M_size, __t); - return *this; - } - - template - 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 - inline valarray<_Tp>& - valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga) - { - __valarray_copy (__ga._M_array, _Array(__ga._M_index), - _Array<_Tp>(_M_data), _M_size); - return *this; - } - - template - 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 - 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 template - inline valarray<_Tp>& - valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e) - { - __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); - return *this; - } - - template - 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 - inline slice_array<_Tp> - valarray<_Tp>::operator[] (slice __s) - { - return slice_array<_Tp> (_Array<_Tp>(_M_data), __s); - } - - template - 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 - inline gslice_array<_Tp> - valarray<_Tp>::operator[] (const gslice& __gs) - { - return gslice_array<_Tp> - (_Array<_Tp>(_M_data), __gs._M_index->_M_index); - } - - template - inline valarray<_Tp> - valarray<_Tp>::operator[] (const valarray& __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 (__m))); - } - - template - inline mask_array<_Tp> - valarray<_Tp>::operator[] (const valarray& __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 (__m)); - } - - template - inline _Expr<_IClos<_ValArray,_Tp>, _Tp> - valarray<_Tp>::operator[] (const valarray& __i) const - { - typedef _IClos<_ValArray,_Tp> _Closure; - return _Expr<_Closure, _Tp> (_Closure (*this, __i)); - } - - template - inline indirect_array<_Tp> - valarray<_Tp>::operator[] (const valarray& __i) - { - return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(), - _Array (__i)); - } - - template - inline size_t valarray<_Tp>::size () const { return _M_size; } - - template - inline _Tp - valarray<_Tp>::sum () const - { - return __valarray_sum(_M_data, _M_data + _M_size); - } - -// template -// inline _Tp -// valarray<_Tp>::product () const -// { -// return __valarray_product(_M_data, _M_data + _M_size); -// } - - template - 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 - 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 - inline void - valarray<_Tp>::resize (size_t __n, _Tp __c) - { - // This complication is so to make valarray > work - // even though it is not required by the standard. Nobody should - // be saying valarray > 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 - inline _Tp - valarray<_Tp>::min() const - { - return *min_element (_M_data, _M_data+_M_size); - } - - template - inline _Tp - valarray<_Tp>::max() const - { - return *max_element (_M_data, _M_data+_M_size); - } - - template - 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 - 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 \ - 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 - inline _Expr<_UnClos, bool> - valarray<_Tp>::operator!() const - { - typedef _UnClos _Closure; - return _Expr<_Closure, bool> (_Closure (*this)); - } - -#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \ - template \ - inline valarray<_Tp> & \ - valarray<_Tp>::operator _Op##= (const _Tp &__t) \ - { \ - _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \ - return *this; \ - } \ - \ - template \ - 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 template \ - 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 \ - 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 \ - 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 \ - 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 \ - 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 \ - 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 \ - 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 deleted file mode 100644 index 995daec7249..00000000000 --- a/libstdc++-v3/include/std/vector +++ /dev/null @@ -1,78 +0,0 @@ -// -*- 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 -#include -#include -#include -#include -#include -#include - -#endif /* _CPP_VECTOR */ - -// Local Variables: -// mode:C++ -// End: