Makefile.am (std_headers): Remove cXXX from list.
2002-01-04 Benjamin Kosnik <bkoz@redhat.com> * include/Makefile.am (std_headers): Remove cXXX from list. (c_base_srcdir): No bits subdirectory. (c_base_builddir): Same. (c_base_headers): Adjust names, add ciso646. (bits_headers): Remove std_xxx.h headers. * include/Makefile.in: Regenerate. * include/ext/iterator: Adjust includes. * include/ext/ropeimpl.h: Same. * include/ext/stl_hash_fun.h: Same. * include/ext/algorithm: Same. * include/backward/bvector.h: Adjust includes. * include/backward/vector.h: Same. * include/backward/strstream: Same. * include/backward/streambuf.h: Same. * include/backward/stack.h: Same. * include/backward/set.h: Same. * include/backward/queue.h: Same. * include/backward/multiset.h: Same. * include/backward/multimap.h: Same. * include/backward/map.h: Same. * include/backward/list.h: Same. * include/backward/iterator.h: Same. * include/backward/iostream.h: Same. * include/backward/iomanip.h: Same. * include/backward/fstream.h: Same. * include/backward/deque.h: Same. * include/backward/complex.h: Same. * include/bits/std_algorithm.h: Move to... * include/std/algorithm: ...here. * include/bits/std_iosfwd.h, std_locale.h, std_stack.h, std_bitset.h, std_ios.h, std_map.h, std_stdexcept.h, std_complex.h, std_iostream.h, std_memory.h, std_streambuf.h, std_deque.h, std_istream.h, std_numeric.h, std_string.h, std_fstream.h, std_ostream.h, std_utility.h, std_iterator.h, std_queue.h, std_valarray.h, std_functional.h, std_limits.h, std_set.h, std_vector.h, std_iomanip.h, std_list.h, std_sstream.h: Same. * include/c_std/bits/std_cassert.h: Move to... * include/c_std/cassert: Here. * include/c_std/std_cctype.h, std_cerrno.h, std_cfloat.h, std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h, std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h, std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h, std_cwctype.h: Same. * include/c_std/cmath: Adjust cmath.tcc include. * include/c_std/cstdlib: Adjust includes. * include/c_std/cwchar: Same. * include/c_std/ctime: Same. * include/c_std/cstring: Same. * include/c_std/cstdio: Same. * include/c_std/bits: Remove directory. * include/c/bits/std_cassert.h: Move to... * include/c/cassert: Here. * include/c/std_cctype.h, std_cerrno.h, std_cfloat.h, std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h, std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h, std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h, std_cwctype.h: Same. * include/c/bits: Remove directory. * include/std/cwctype: Remove. * include/std/cwchar: Remove. * include/std/ctime: Remove. * include/std/cstring: Remove. * include/std/cstdlib: Remove. * include/std/cstdio: Remove. * include/std/cstddef: Remove. * include/std/cstdarg: Remove. * include/std/csignal: Remove. * include/std/csetjmp: Remove. * include/std/cmath: Remove. * include/std/clocale: Remove. * include/std/climits: Remove. * include/std/ciso646: Remove. * include/std/cfloat: Remove. * include/std/cerrno: Remove. * include/std/cctype: Remove. * include/std/cassert: Remove. * include/bits/fpos.h: Adjust includes, removing <bits/std_xxx.h> files and subsituting <.xxx> * include/bits/valarray_array.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/stl_alloc.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/sstream.tcc: Same. * include/bits/pthread_allocimpl.h: Same. * include/bits/ostream.tcc: Same. * include/bits/localefwd.h: Same. * include/bits/locale_facets.tcc: Same. * include/bits/locale_facets.h: Same. * include/bits/istream.tcc: Same. * include/bits/char_traits.h: Same. * include/bits/boost_concept_check.h: Same. * include/bits/basic_file.h: Same. * include/std/bitset: Same. * include/std/complex: Same. * include/std/fstream: Same. * include/std/functional: Same. * include/std/ios: Same. * include/std/iostream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/std/streambuf: Same. * include/std/string: Same. * include/std/iterator: Same. * include/std/valarray: Same. * src/ios.cc: Adjust includes. * src/valarray-inst.cc: Same. * src/string-inst.cc: Same. * src/stl-inst.cc: Same. * src/stdexcept.cc: Same. * src/misc-inst.cc: Same. * src/localename.cc: Same. * src/locale-inst.cc: Same. * src/locale.cc: Same. * src/limits.cc: Same. * src/concept-inst.cc: Same. * src/complex_io.cc: Same. * src/codecvt.cc: Same. * src/bitset.cc: Same. * src/cmath.cc: Same. From-SVN: r48544
This commit is contained in:
parent
48180d6890
commit
54c1bf7801
|
@ -1,3 +1,134 @@
|
|||
2002-01-04 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* include/Makefile.am (std_headers): Remove cXXX from list.
|
||||
(c_base_srcdir): No bits subdirectory.
|
||||
(c_base_builddir): Same.
|
||||
(c_base_headers): Adjust names, add ciso646.
|
||||
(bits_headers): Remove std_xxx.h headers.
|
||||
* include/Makefile.in: Regenerate.
|
||||
|
||||
* include/ext/iterator: Adjust includes.
|
||||
* include/ext/ropeimpl.h: Same.
|
||||
* include/ext/stl_hash_fun.h: Same.
|
||||
* include/ext/algorithm: Same.
|
||||
|
||||
* include/backward/bvector.h: Adjust includes.
|
||||
* include/backward/vector.h: Same.
|
||||
* include/backward/strstream: Same.
|
||||
* include/backward/streambuf.h: Same.
|
||||
* include/backward/stack.h: Same.
|
||||
* include/backward/set.h: Same.
|
||||
* include/backward/queue.h: Same.
|
||||
* include/backward/multiset.h: Same.
|
||||
* include/backward/multimap.h: Same.
|
||||
* include/backward/map.h: Same.
|
||||
* include/backward/list.h: Same.
|
||||
* include/backward/iterator.h: Same.
|
||||
* include/backward/iostream.h: Same.
|
||||
* include/backward/iomanip.h: Same.
|
||||
* include/backward/fstream.h: Same.
|
||||
* include/backward/deque.h: Same.
|
||||
* include/backward/complex.h: Same.
|
||||
|
||||
* include/bits/std_algorithm.h: Move to...
|
||||
* include/std/algorithm: ...here.
|
||||
* include/bits/std_iosfwd.h, std_locale.h, std_stack.h,
|
||||
std_bitset.h, std_ios.h, std_map.h, std_stdexcept.h,
|
||||
std_complex.h, std_iostream.h, std_memory.h, std_streambuf.h,
|
||||
std_deque.h, std_istream.h, std_numeric.h, std_string.h,
|
||||
std_fstream.h, std_ostream.h, std_utility.h, std_iterator.h,
|
||||
std_queue.h, std_valarray.h, std_functional.h, std_limits.h,
|
||||
std_set.h, std_vector.h, std_iomanip.h, std_list.h, std_sstream.h:
|
||||
Same.
|
||||
|
||||
* include/c_std/bits/std_cassert.h: Move to...
|
||||
* include/c_std/cassert: Here.
|
||||
* include/c_std/std_cctype.h, std_cerrno.h, std_cfloat.h,
|
||||
std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h,
|
||||
std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h,
|
||||
std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h,
|
||||
std_cwctype.h: Same.
|
||||
* include/c_std/cmath: Adjust cmath.tcc include.
|
||||
* include/c_std/cstdlib: Adjust includes.
|
||||
* include/c_std/cwchar: Same.
|
||||
* include/c_std/ctime: Same.
|
||||
* include/c_std/cstring: Same.
|
||||
* include/c_std/cstdio: Same.
|
||||
* include/c_std/bits: Remove directory.
|
||||
|
||||
* include/c/bits/std_cassert.h: Move to...
|
||||
* include/c/cassert: Here.
|
||||
* include/c/std_cctype.h, std_cerrno.h, std_cfloat.h,
|
||||
std_climits.h, std_clocale.h, std_cmath.h, std_csetjmp.h,
|
||||
std_csignal.h, std_cstdarg.h, std_cstddef.h, std_cstdio.h,
|
||||
std_cstdlib.h, std_cstring.h, std_ctime.h, std_cwchar.h,
|
||||
std_cwctype.h: Same.
|
||||
* include/c/bits: Remove directory.
|
||||
|
||||
* include/std/cwctype: Remove.
|
||||
* include/std/cwchar: Remove.
|
||||
* include/std/ctime: Remove.
|
||||
* include/std/cstring: Remove.
|
||||
* include/std/cstdlib: Remove.
|
||||
* include/std/cstdio: Remove.
|
||||
* include/std/cstddef: Remove.
|
||||
* include/std/cstdarg: Remove.
|
||||
* include/std/csignal: Remove.
|
||||
* include/std/csetjmp: Remove.
|
||||
* include/std/cmath: Remove.
|
||||
* include/std/clocale: Remove.
|
||||
* include/std/climits: Remove.
|
||||
* include/std/ciso646: Remove.
|
||||
* include/std/cfloat: Remove.
|
||||
* include/std/cerrno: Remove.
|
||||
* include/std/cctype: Remove.
|
||||
* include/std/cassert: Remove.
|
||||
|
||||
* include/bits/fpos.h: Adjust includes, removing <bits/std_xxx.h>
|
||||
files and subsituting <.xxx>
|
||||
* include/bits/valarray_array.h: Same.
|
||||
* include/bits/stl_uninitialized.h: Same.
|
||||
* include/bits/stl_alloc.h: Same.
|
||||
* include/bits/stl_algobase.h: Same.
|
||||
* include/bits/sstream.tcc: Same.
|
||||
* include/bits/pthread_allocimpl.h: Same.
|
||||
* include/bits/ostream.tcc: Same.
|
||||
* include/bits/localefwd.h: Same.
|
||||
* include/bits/locale_facets.tcc: Same.
|
||||
* include/bits/locale_facets.h: Same.
|
||||
* include/bits/istream.tcc: Same.
|
||||
* include/bits/char_traits.h: Same.
|
||||
* include/bits/boost_concept_check.h: Same.
|
||||
* include/bits/basic_file.h: Same.
|
||||
* include/std/bitset: Same.
|
||||
* include/std/complex: Same.
|
||||
* include/std/fstream: Same.
|
||||
* include/std/functional: Same.
|
||||
* include/std/ios: Same.
|
||||
* include/std/iostream: Same.
|
||||
* include/std/ostream: Same.
|
||||
* include/std/sstream: Same.
|
||||
* include/std/streambuf: Same.
|
||||
* include/std/string: Same.
|
||||
* include/std/iterator: Same.
|
||||
* include/std/valarray: Same.
|
||||
|
||||
* src/ios.cc: Adjust includes.
|
||||
* src/valarray-inst.cc: Same.
|
||||
* src/string-inst.cc: Same.
|
||||
* src/stl-inst.cc: Same.
|
||||
* src/stdexcept.cc: Same.
|
||||
* src/misc-inst.cc: Same.
|
||||
* src/localename.cc: Same.
|
||||
* src/locale-inst.cc: Same.
|
||||
* src/locale.cc: Same.
|
||||
* src/limits.cc: Same.
|
||||
* src/concept-inst.cc: Same.
|
||||
* src/complex_io.cc: Same.
|
||||
* src/codecvt.cc: Same.
|
||||
* src/bitset.cc: Same.
|
||||
* src/cmath.cc: Same.
|
||||
|
||||
2002-01-04 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
* include/bits/stl_tree.h (rb_tree): Move to...
|
||||
|
@ -30,7 +161,7 @@
|
|||
* include/backward/function.h: Include <ext/functional>, tweak.
|
||||
* include/ext/ropeimpl.h: Include <ext/numeric>.
|
||||
|
||||
Thu Jan 3 11:05:41 2002 Jeffrey A Law (law@redhat.com)
|
||||
2002-01-03 Jeffrey A Law <law@redhat.com>
|
||||
|
||||
* config/os/hpux/bits/os_defines.h: Prefix __strtoll and
|
||||
__strtoull declarations with __extension__.
|
||||
|
|
|
@ -18520,7 +18520,7 @@ else
|
|||
fi
|
||||
rm -f conftest*
|
||||
|
||||
for ac_hdr in unistd.h
|
||||
for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
|
@ -18652,11 +18652,24 @@ else
|
|||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* This mess was copied from the GNU getpagesize.h. */
|
||||
#ifndef HAVE_GETPAGESIZE
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
/* Assume that all systems that can run configure have sys/param.h. */
|
||||
# ifndef HAVE_SYS_PARAM_H
|
||||
|
@ -18764,7 +18777,7 @@ main()
|
|||
}
|
||||
|
||||
EOF
|
||||
if { (eval echo configure:18768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
if { (eval echo configure:18781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_func_mmap_fixed_mapped=yes
|
||||
else
|
||||
|
@ -18795,17 +18808,17 @@ fi
|
|||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:18799: checking for $ac_hdr" >&5
|
||||
echo "configure:18812: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18804 "configure"
|
||||
#line 18817 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:18809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:18822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
|
@ -18838,7 +18851,7 @@ done
|
|||
# Can't do these in a loop, else the resulting syntax is wrong.
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18842 "configure"
|
||||
#line 18855 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
@ -18847,7 +18860,7 @@ int main() {
|
|||
int f = RLIMIT_DATA ;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:18851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:18864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
glibcpp_mresult=1
|
||||
else
|
||||
|
@ -18864,7 +18877,7 @@ EOF
|
|||
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18868 "configure"
|
||||
#line 18881 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
@ -18873,7 +18886,7 @@ int main() {
|
|||
int f = RLIMIT_RSS ;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:18877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:18890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
glibcpp_mresult=1
|
||||
else
|
||||
|
@ -18890,7 +18903,7 @@ EOF
|
|||
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18894 "configure"
|
||||
#line 18907 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
@ -18899,7 +18912,7 @@ int main() {
|
|||
int f = RLIMIT_VMEM ;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:18903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:18916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
glibcpp_mresult=1
|
||||
else
|
||||
|
@ -18916,7 +18929,7 @@ EOF
|
|||
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18920 "configure"
|
||||
#line 18933 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
@ -18925,7 +18938,7 @@ int main() {
|
|||
int f = RLIMIT_AS ;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:18929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:18942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
glibcpp_mresult=1
|
||||
else
|
||||
|
@ -18947,7 +18960,7 @@ EOF
|
|||
else
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18951 "configure"
|
||||
#line 18964 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
|
@ -18956,7 +18969,7 @@ int main() {
|
|||
struct rlimit r; setrlimit(0, &r);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:18960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:18973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_setrlimit=yes
|
||||
else
|
||||
|
@ -18972,7 +18985,7 @@ fi
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6
|
||||
echo "configure:18976: checking for testsuite memory limit support" >&5
|
||||
echo "configure:18989: checking for testsuite memory limit support" >&5
|
||||
if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
|
||||
ac_mem_limits=yes
|
||||
cat >> confdefs.h <<\EOF
|
||||
|
@ -19074,13 +19087,13 @@ glibcpp_toolexeclibdir=no
|
|||
glibcpp_prefixdir=${prefix}
|
||||
|
||||
echo $ac_n "checking for interface version number""... $ac_c" 1>&6
|
||||
echo "configure:19078: checking for interface version number" >&5
|
||||
echo "configure:19091: checking for interface version number" >&5
|
||||
libstdcxx_interface=$INTERFACE
|
||||
echo "$ac_t""$libstdcxx_interface" 1>&6
|
||||
|
||||
# Process the option --with-gxx-include-dir=<path to include-files directory>
|
||||
echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6
|
||||
echo "configure:19084: checking for --with-gxx-include-dir" >&5
|
||||
echo "configure:19097: checking for --with-gxx-include-dir" >&5
|
||||
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
|
||||
if test "${with_gxx_include_dir+set}" = set; then
|
||||
withval="$with_gxx_include_dir"
|
||||
|
@ -19104,7 +19117,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6
|
|||
|
||||
# Process the option "--enable-version-specific-runtime-libs"
|
||||
echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6
|
||||
echo "configure:19108: checking for --enable-version-specific-runtime-libs" >&5
|
||||
echo "configure:19121: checking for --enable-version-specific-runtime-libs" >&5
|
||||
# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
|
||||
if test "${enable_version_specific_runtime_libs+set}" = set; then
|
||||
enableval="$enable_version_specific_runtime_libs"
|
||||
|
@ -19151,7 +19164,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then
|
|||
fi
|
||||
|
||||
echo $ac_n "checking for install location""... $ac_c" 1>&6
|
||||
echo "configure:19155: checking for install location" >&5
|
||||
echo "configure:19168: checking for install location" >&5
|
||||
echo "$ac_t""$gxx_include_dir" 1>&6
|
||||
|
||||
|
||||
|
|
|
@ -64,35 +64,6 @@ bits_headers = \
|
|||
${bits_srcdir}/slice.h \
|
||||
${bits_srcdir}/slice_array.h \
|
||||
${bits_srcdir}/sstream.tcc \
|
||||
${bits_srcdir}/std_algorithm.h \
|
||||
${bits_srcdir}/std_bitset.h \
|
||||
${bits_srcdir}/std_complex.h \
|
||||
${bits_srcdir}/std_deque.h \
|
||||
${bits_srcdir}/std_fstream.h \
|
||||
${bits_srcdir}/std_functional.h \
|
||||
${bits_srcdir}/std_iomanip.h \
|
||||
${bits_srcdir}/std_ios.h \
|
||||
${bits_srcdir}/std_iosfwd.h \
|
||||
${bits_srcdir}/std_iostream.h \
|
||||
${bits_srcdir}/std_istream.h \
|
||||
${bits_srcdir}/std_iterator.h \
|
||||
${bits_srcdir}/std_limits.h \
|
||||
${bits_srcdir}/std_list.h \
|
||||
${bits_srcdir}/std_locale.h \
|
||||
${bits_srcdir}/std_map.h \
|
||||
${bits_srcdir}/std_memory.h \
|
||||
${bits_srcdir}/std_numeric.h \
|
||||
${bits_srcdir}/std_ostream.h \
|
||||
${bits_srcdir}/std_queue.h \
|
||||
${bits_srcdir}/std_set.h \
|
||||
${bits_srcdir}/std_sstream.h \
|
||||
${bits_srcdir}/std_stack.h \
|
||||
${bits_srcdir}/std_stdexcept.h \
|
||||
${bits_srcdir}/std_streambuf.h \
|
||||
${bits_srcdir}/std_string.h \
|
||||
${bits_srcdir}/std_utility.h \
|
||||
${bits_srcdir}/std_valarray.h \
|
||||
${bits_srcdir}/std_vector.h \
|
||||
${bits_srcdir}/stl_algo.h \
|
||||
${bits_srcdir}/stl_algobase.h \
|
||||
${bits_srcdir}/stl_alloc.h \
|
||||
|
@ -188,26 +159,27 @@ ext_headers = \
|
|||
${ext_srcdir}/stl_rope.h
|
||||
|
||||
# This is the common subset of files that all three "C" header models use.
|
||||
c_base_srcdir = @C_INCLUDE_DIR@/bits
|
||||
c_base_builddir = ./bits
|
||||
c_base_srcdir = @C_INCLUDE_DIR@/
|
||||
c_base_builddir = ./
|
||||
c_base_headers = \
|
||||
${c_base_srcdir}/std_cassert.h \
|
||||
${c_base_srcdir}/std_cctype.h \
|
||||
${c_base_srcdir}/std_cerrno.h \
|
||||
${c_base_srcdir}/std_cfloat.h \
|
||||
${c_base_srcdir}/std_climits.h \
|
||||
${c_base_srcdir}/std_clocale.h \
|
||||
${c_base_srcdir}/std_cmath.h \
|
||||
${c_base_srcdir}/std_csetjmp.h \
|
||||
${c_base_srcdir}/std_csignal.h \
|
||||
${c_base_srcdir}/std_cstdarg.h \
|
||||
${c_base_srcdir}/std_cstddef.h \
|
||||
${c_base_srcdir}/std_cstdio.h \
|
||||
${c_base_srcdir}/std_cstdlib.h \
|
||||
${c_base_srcdir}/std_cstring.h \
|
||||
${c_base_srcdir}/std_ctime.h \
|
||||
${c_base_srcdir}/std_cwchar.h \
|
||||
${c_base_srcdir}/std_cwctype.h \
|
||||
${c_base_srcdir}/cassert \
|
||||
${c_base_srcdir}/cctype \
|
||||
${c_base_srcdir}/cerrno \
|
||||
${c_base_srcdir}/cfloat \
|
||||
${c_base_srcdir}/ciso646 \
|
||||
${c_base_srcdir}/climits \
|
||||
${c_base_srcdir}/clocale \
|
||||
${c_base_srcdir}/cmath \
|
||||
${c_base_srcdir}/csetjmp \
|
||||
${c_base_srcdir}/csignal \
|
||||
${c_base_srcdir}/cstdarg \
|
||||
${c_base_srcdir}/cstddef \
|
||||
${c_base_srcdir}/cstdio \
|
||||
${c_base_srcdir}/cstdlib \
|
||||
${c_base_srcdir}/cstring \
|
||||
${c_base_srcdir}/ctime \
|
||||
${c_base_srcdir}/cwchar \
|
||||
${c_base_srcdir}/cwctype \
|
||||
${c_base_srcdir}/cmath.tcc
|
||||
|
||||
std_srcdir = ${glibcpp_srcdir}/include/std
|
||||
|
@ -241,25 +213,7 @@ std_headers = \
|
|||
${std_srcdir}/string \
|
||||
${std_srcdir}/utility \
|
||||
${std_srcdir}/valarray \
|
||||
${std_srcdir}/vector \
|
||||
${std_srcdir}/cassert \
|
||||
${std_srcdir}/cctype \
|
||||
${std_srcdir}/cerrno \
|
||||
${std_srcdir}/cfloat \
|
||||
${std_srcdir}/climits \
|
||||
${std_srcdir}/clocale \
|
||||
${std_srcdir}/ciso646 \
|
||||
${std_srcdir}/cmath \
|
||||
${std_srcdir}/csetjmp \
|
||||
${std_srcdir}/csignal \
|
||||
${std_srcdir}/cstdarg \
|
||||
${std_srcdir}/cstddef \
|
||||
${std_srcdir}/cstdio \
|
||||
${std_srcdir}/cstdlib \
|
||||
${std_srcdir}/cstring \
|
||||
${std_srcdir}/ctime \
|
||||
${std_srcdir}/cwchar \
|
||||
${std_srcdir}/cwctype
|
||||
${std_srcdir}/vector
|
||||
|
||||
target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
|
||||
target_builddir = ./${target_alias}/bits
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
|
||||
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -11,7 +10,6 @@
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
|
@ -33,9 +31,13 @@ infodir = @infodir@
|
|||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
|
@ -44,11 +46,11 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
|
@ -82,6 +84,7 @@ C_INCLUDE_DIR = @C_INCLUDE_DIR@
|
|||
DATADIRNAME = @DATADIRNAME@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
|
||||
GCJ = @GCJ@
|
||||
GCJFLAGS = @GCJFLAGS@
|
||||
|
@ -105,6 +108,7 @@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
|
|||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
|
@ -142,23 +146,16 @@ libtool_VERSION = @libtool_VERSION@
|
|||
release_VERSION = @release_VERSION@
|
||||
toplevel_srcdir = @toplevel_srcdir@
|
||||
|
||||
# Cross compiler and multilib support.
|
||||
CXX = @glibcpp_CXX@
|
||||
glibcpp_builddir = @glibcpp_builddir@
|
||||
glibcpp_srcdir = @glibcpp_srcdir@
|
||||
|
||||
# Target includes for threads
|
||||
glibcpp_thread_h = @glibcpp_thread_h@
|
||||
|
||||
# One big happy istallation: just copy everything from the build to the
|
||||
# install tree (except for the build stamps).
|
||||
gxx_include_dir = @gxx_include_dir@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 gnits
|
||||
MAINT_CHARSET = latin1
|
||||
|
||||
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
|
||||
|
||||
# Cross compiler and multilib support.
|
||||
CXX = @glibcpp_CXX@
|
||||
glibcpp_srcdir = @glibcpp_srcdir@
|
||||
glibcpp_builddir = @glibcpp_builddir@
|
||||
|
||||
bits_srcdir = ${glibcpp_srcdir}/include/bits
|
||||
bits_builddir = ./bits
|
||||
bits_headers = \
|
||||
|
@ -192,35 +189,6 @@ bits_headers = \
|
|||
${bits_srcdir}/slice.h \
|
||||
${bits_srcdir}/slice_array.h \
|
||||
${bits_srcdir}/sstream.tcc \
|
||||
${bits_srcdir}/std_algorithm.h \
|
||||
${bits_srcdir}/std_bitset.h \
|
||||
${bits_srcdir}/std_complex.h \
|
||||
${bits_srcdir}/std_deque.h \
|
||||
${bits_srcdir}/std_fstream.h \
|
||||
${bits_srcdir}/std_functional.h \
|
||||
${bits_srcdir}/std_iomanip.h \
|
||||
${bits_srcdir}/std_ios.h \
|
||||
${bits_srcdir}/std_iosfwd.h \
|
||||
${bits_srcdir}/std_iostream.h \
|
||||
${bits_srcdir}/std_istream.h \
|
||||
${bits_srcdir}/std_iterator.h \
|
||||
${bits_srcdir}/std_limits.h \
|
||||
${bits_srcdir}/std_list.h \
|
||||
${bits_srcdir}/std_locale.h \
|
||||
${bits_srcdir}/std_map.h \
|
||||
${bits_srcdir}/std_memory.h \
|
||||
${bits_srcdir}/std_numeric.h \
|
||||
${bits_srcdir}/std_ostream.h \
|
||||
${bits_srcdir}/std_queue.h \
|
||||
${bits_srcdir}/std_set.h \
|
||||
${bits_srcdir}/std_sstream.h \
|
||||
${bits_srcdir}/std_stack.h \
|
||||
${bits_srcdir}/std_stdexcept.h \
|
||||
${bits_srcdir}/std_streambuf.h \
|
||||
${bits_srcdir}/std_string.h \
|
||||
${bits_srcdir}/std_utility.h \
|
||||
${bits_srcdir}/std_valarray.h \
|
||||
${bits_srcdir}/std_vector.h \
|
||||
${bits_srcdir}/stl_algo.h \
|
||||
${bits_srcdir}/stl_algobase.h \
|
||||
${bits_srcdir}/stl_alloc.h \
|
||||
|
@ -319,26 +287,27 @@ ext_headers = \
|
|||
|
||||
|
||||
# This is the common subset of files that all three "C" header models use.
|
||||
c_base_srcdir = @C_INCLUDE_DIR@/bits
|
||||
c_base_builddir = ./bits
|
||||
c_base_srcdir = @C_INCLUDE_DIR@/
|
||||
c_base_builddir = ./
|
||||
c_base_headers = \
|
||||
${c_base_srcdir}/std_cassert.h \
|
||||
${c_base_srcdir}/std_cctype.h \
|
||||
${c_base_srcdir}/std_cerrno.h \
|
||||
${c_base_srcdir}/std_cfloat.h \
|
||||
${c_base_srcdir}/std_climits.h \
|
||||
${c_base_srcdir}/std_clocale.h \
|
||||
${c_base_srcdir}/std_cmath.h \
|
||||
${c_base_srcdir}/std_csetjmp.h \
|
||||
${c_base_srcdir}/std_csignal.h \
|
||||
${c_base_srcdir}/std_cstdarg.h \
|
||||
${c_base_srcdir}/std_cstddef.h \
|
||||
${c_base_srcdir}/std_cstdio.h \
|
||||
${c_base_srcdir}/std_cstdlib.h \
|
||||
${c_base_srcdir}/std_cstring.h \
|
||||
${c_base_srcdir}/std_ctime.h \
|
||||
${c_base_srcdir}/std_cwchar.h \
|
||||
${c_base_srcdir}/std_cwctype.h \
|
||||
${c_base_srcdir}/cassert \
|
||||
${c_base_srcdir}/cctype \
|
||||
${c_base_srcdir}/cerrno \
|
||||
${c_base_srcdir}/cfloat \
|
||||
${c_base_srcdir}/ciso646 \
|
||||
${c_base_srcdir}/climits \
|
||||
${c_base_srcdir}/clocale \
|
||||
${c_base_srcdir}/cmath \
|
||||
${c_base_srcdir}/csetjmp \
|
||||
${c_base_srcdir}/csignal \
|
||||
${c_base_srcdir}/cstdarg \
|
||||
${c_base_srcdir}/cstddef \
|
||||
${c_base_srcdir}/cstdio \
|
||||
${c_base_srcdir}/cstdlib \
|
||||
${c_base_srcdir}/cstring \
|
||||
${c_base_srcdir}/ctime \
|
||||
${c_base_srcdir}/cwchar \
|
||||
${c_base_srcdir}/cwctype \
|
||||
${c_base_srcdir}/cmath.tcc
|
||||
|
||||
|
||||
|
@ -373,25 +342,7 @@ std_headers = \
|
|||
${std_srcdir}/string \
|
||||
${std_srcdir}/utility \
|
||||
${std_srcdir}/valarray \
|
||||
${std_srcdir}/vector \
|
||||
${std_srcdir}/cassert \
|
||||
${std_srcdir}/cctype \
|
||||
${std_srcdir}/cerrno \
|
||||
${std_srcdir}/cfloat \
|
||||
${std_srcdir}/climits \
|
||||
${std_srcdir}/clocale \
|
||||
${std_srcdir}/ciso646 \
|
||||
${std_srcdir}/cmath \
|
||||
${std_srcdir}/csetjmp \
|
||||
${std_srcdir}/csignal \
|
||||
${std_srcdir}/cstdarg \
|
||||
${std_srcdir}/cstddef \
|
||||
${std_srcdir}/cstdio \
|
||||
${std_srcdir}/cstdlib \
|
||||
${std_srcdir}/cstring \
|
||||
${std_srcdir}/ctime \
|
||||
${std_srcdir}/cwchar \
|
||||
${std_srcdir}/cwctype
|
||||
${std_srcdir}/vector
|
||||
|
||||
|
||||
target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
|
||||
|
@ -417,108 +368,114 @@ thread_headers = \
|
|||
allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \
|
||||
stamp-target stamp-thread
|
||||
|
||||
|
||||
# Target includes for threads
|
||||
glibcpp_thread_h = @glibcpp_thread_h@
|
||||
uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
|
||||
subdir = include
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
||||
# One big happy istallation: just copy everything from the build to the
|
||||
# install tree (except for the build stamps).
|
||||
gxx_include_dir = @gxx_include_dir@
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
depcomp =
|
||||
DIST_SOURCES =
|
||||
all: all-am
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --cygnus include/Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
|
||||
uninstall-info-am:
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --cygnus include/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = include
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am:
|
||||
check: check-am
|
||||
all-am: Makefile all-local
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-info-am:
|
||||
install-info: install-info-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-data-local
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile all-local
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-data-local
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info:
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
uninstall-am:
|
||||
clean: clean-am
|
||||
|
||||
.PHONY: all all-am all-local check check-am clean clean-generic \
|
||||
clean-libtool distclean distclean-generic distclean-libtool dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-data-local install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool uninstall uninstall-am uninstall-info-am
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-info-am install-info \
|
||||
install-exec-am install-exec install-data-local install-data-am \
|
||||
install-data install-am install uninstall-am uninstall all-local \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Here are the rules for building the headers
|
||||
|
@ -625,6 +582,7 @@ install-data-local:
|
|||
|
||||
# By adding these files here, automake will remove them for 'make clean'
|
||||
#CLEANFILES = ${allstamps}
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_vector.h>
|
||||
#include <vector>
|
||||
|
||||
using std::bit_vector;
|
||||
|
||||
|
@ -67,5 +67,3 @@ using std::bit_vector;
|
|||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define _CPP_BACKWARD_COMPLEX_H 1
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_complex.h>
|
||||
#include <complex>
|
||||
|
||||
using std::complex;
|
||||
typedef complex<float> float_complex;
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#include "backward_warning.h"
|
||||
#include "algobase.h"
|
||||
#include "alloc.h"
|
||||
#include <bits/std_deque.h>
|
||||
#include <deque>
|
||||
|
||||
using std::deque;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define _CPP_BACKWARD_FSTREAM_H 1
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_fstream.h>
|
||||
#include <fstream>
|
||||
|
||||
using std::filebuf;
|
||||
using std::ifstream;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "backward_warning.h"
|
||||
#include "iostream.h"
|
||||
#include <bits/std_iomanip.h>
|
||||
#include <iomanip>
|
||||
|
||||
// These are from <ios> as per [27.4].
|
||||
using std::boolalpha;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define _CPP_BACKWARD_IOSTREAM_H 1
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_iostream.h>
|
||||
#include <iostream>
|
||||
|
||||
using std::iostream;
|
||||
using std::ostream;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "function.h"
|
||||
#include <stddef.h>
|
||||
#include "iostream.h"
|
||||
#include <bits/std_iterator.h>
|
||||
#include <iterator>
|
||||
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_raw_storage_iter.h>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#include "backward_warning.h"
|
||||
#include "algobase.h"
|
||||
#include "alloc.h"
|
||||
#include <bits/std_list.h>
|
||||
#include <list>
|
||||
|
||||
using std::list;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
#include "backward_warning.h"
|
||||
#include "tree.h"
|
||||
#include <bits/std_map.h>
|
||||
#include <map>
|
||||
|
||||
using std::map;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
#include "backward_warning.h"
|
||||
#include "tree.h"
|
||||
#include <bits/std_map.h>
|
||||
#include <map>
|
||||
|
||||
using std::multimap;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
#include "backward_warning.h"
|
||||
#include "tree.h"
|
||||
#include <bits/std_set.h>
|
||||
#include <set>
|
||||
|
||||
using std::multiset;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define _CPP_BACKWARD_QUEUE_H 1
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_queue.h>
|
||||
#include <queue>
|
||||
|
||||
using std::queue;
|
||||
using std::priority_queue;
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
#include "backward_warning.h"
|
||||
#include "tree.h"
|
||||
#include <bits/std_set.h>
|
||||
#include <set>
|
||||
|
||||
using std::set;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#include "deque.h"
|
||||
#include "heap.h"
|
||||
#include "queue.h"
|
||||
#include <bits/std_stack.h>
|
||||
#include <stack>
|
||||
|
||||
using std::stack;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define _CPP_BACKWARD_STREAMBUF_H 1
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_streambuf.h>
|
||||
#include <streambuf>
|
||||
|
||||
using std::streambuf;
|
||||
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
#define __SGI_STL_STRSTREAM
|
||||
|
||||
#include "backward_warning.h"
|
||||
#include <bits/std_iosfwd.h>
|
||||
#include <bits/std_ios.h>
|
||||
#include <bits/std_istream.h>
|
||||
#include <bits/std_ostream.h>
|
||||
#include <bits/std_string.h>
|
||||
#include <iosfwd>
|
||||
#include <ios>
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#include "backward_warning.h"
|
||||
#include "algobase.h"
|
||||
#include "alloc.h"
|
||||
#include <bits/std_vector.h>
|
||||
#include <vector>
|
||||
|
||||
using std::vector;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_ios.h>
|
||||
#include <ios>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#define _GLIBCPP_BOOST_CONCEPT_CHECK 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/std_cstddef.h> // for ptrdiff_t, used next
|
||||
#include <cstddef> // for ptrdiff_t, used next
|
||||
#include <bits/stl_iterator_base_types.h> // for traits and tags
|
||||
#include <utility> // for pair<>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_cstring.h> // For memmove, memset, memchr
|
||||
#include <cstring> // For memmove, memset, memchr
|
||||
#include <bits/fpos.h> // For streampos
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++io.h>
|
||||
#include <bits/std_cwchar.h> // For mbstate_t.
|
||||
#include <cwchar> // For mbstate_t.
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
@ -121,6 +121,3 @@ namespace std
|
|||
} // namespace std
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
// ISO C++ 14882: 27.6.2 Output streams
|
||||
//
|
||||
|
||||
#include <bits/std_locale.h>
|
||||
#include <bits/std_ostream.h> // for flush()
|
||||
#include <locale>
|
||||
#include <ostream> // For flush()
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -41,11 +41,11 @@
|
|||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_ctime.h> // For struct tm
|
||||
#include <bits/std_ios.h> // For ios_base
|
||||
#include <ctime> // For struct tm
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
# include <bits/std_cwctype.h> // For wctype_t
|
||||
# include <cwctype> // For wctype_t
|
||||
#endif
|
||||
#include <ios> // For ios_base
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -32,16 +32,16 @@
|
|||
#ifndef _CPP_BITS_LOCFACETS_TCC
|
||||
#define _CPP_BITS_LOCFACETS_TCC 1
|
||||
|
||||
#include <bits/std_cerrno.h>
|
||||
#include <bits/std_clocale.h> // For localeconv
|
||||
#include <bits/std_cstdlib.h> // For strof, strtold
|
||||
#include <bits/std_cmath.h> // For ceil
|
||||
#include <bits/std_limits.h> // For numeric_limits
|
||||
#include <bits/std_memory.h> // For auto_ptr
|
||||
#include <cerrno>
|
||||
#include <clocale> // For localeconv
|
||||
#include <cstdlib> // For strof, strtold
|
||||
#include <cmath> // For ceil
|
||||
#include <cctype> // For isspace
|
||||
#include <limits> // For numeric_limits
|
||||
#include <memory> // For auto_ptr
|
||||
#include <bits/streambuf_iterator.h> // For streambuf_iterators
|
||||
#include <bits/std_cctype.h> // For isspace
|
||||
#include <typeinfo> // For bad_cast
|
||||
#include <bits/std_vector.h>
|
||||
#include <vector>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/c++locale.h> // Defines __c_locale, config-specific includes
|
||||
#include <bits/std_climits.h> // For CHAR_BIT
|
||||
#include <bits/std_string.h> // For string
|
||||
#include <bits/std_cctype.h> // For isspace, etc.
|
||||
#include <climits> // For CHAR_BIT
|
||||
#include <cctype> // For isspace, etc.
|
||||
#include <string> // For string
|
||||
#include <bits/functexcept.h>
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
// ISO C++ 14882: 27.6.2 Output streams
|
||||
//
|
||||
|
||||
#include <bits/std_locale.h>
|
||||
#include <locale>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
// consequences.
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cerrno.h>
|
||||
#include <cerrno>
|
||||
#include <bits/stl_alloc.h>
|
||||
#ifndef __RESTRICT
|
||||
# define __RESTRICT
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef _CPP_BITS_SSTREAM_TCC
|
||||
#define _CPP_BITS_SSTREAM_TCC 1
|
||||
|
||||
#include <bits/std_sstream.h>
|
||||
#include <sstream>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
// <algorithm> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_algorithm.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_ALGORITHM
|
||||
#define _CPP_ALGORITHM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_tempbuf.h>
|
||||
#include <bits/stl_algo.h>
|
||||
|
||||
#endif /* _CPP_ALGORITHM */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,814 +0,0 @@
|
|||
// <bitset> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_bitset.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBCPP_BITSET
|
||||
#define __GLIBCPP_BITSET
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
// A bitset of size N has N % (sizeof(unsigned long) * CHAR_BIT) unused
|
||||
// bits. (They are the high- order bits in the highest word.) It is
|
||||
// a class invariant of class bitset<> that those unused bits are
|
||||
// always zero.
|
||||
|
||||
// Most of the actual code isn't contained in bitset<> itself, but in the
|
||||
// base class _Base_bitset. The base class works with whole words, not with
|
||||
// individual bits. This allows us to specialize _Base_bitset for the
|
||||
// important special case where the bitset is only a single word.
|
||||
|
||||
|
||||
#include <bits/std_cstddef.h> // for size_t
|
||||
#include <bits/std_cstring.h> // for memset
|
||||
#include <bits/std_string.h>
|
||||
#include <bits/std_stdexcept.h>
|
||||
#include <bits/functexcept.h> // for invalid_argument, out_of_range,
|
||||
// overflow_error
|
||||
#include <bits/std_ostream.h> // for ostream (operator<<)
|
||||
#include <bits/std_istream.h> // for istream (operator>>)
|
||||
|
||||
#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
|
||||
#define __BITSET_WORDS(__n) \
|
||||
((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
// structure to aid in counting bits
|
||||
template<bool __dummy>
|
||||
struct _Bit_count {
|
||||
static unsigned char _S_bit_count[256];
|
||||
};
|
||||
|
||||
// Mapping from 8 bit unsigned integers to the index of the first one
|
||||
// bit:
|
||||
template<bool __dummy>
|
||||
struct _First_one {
|
||||
static unsigned char _S_first_one[256];
|
||||
};
|
||||
|
||||
//
|
||||
// Base class: general case.
|
||||
//
|
||||
|
||||
template<size_t _Nw>
|
||||
struct _Base_bitset {
|
||||
typedef unsigned long _WordT;
|
||||
|
||||
_WordT _M_w[_Nw]; // 0 is the least significant word.
|
||||
|
||||
_Base_bitset( void ) { _M_do_reset(); }
|
||||
_Base_bitset(unsigned long __val) {
|
||||
_M_do_reset();
|
||||
_M_w[0] = __val;
|
||||
}
|
||||
|
||||
static size_t _S_whichword( size_t __pos )
|
||||
{ return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; }
|
||||
static size_t _S_whichbyte( size_t __pos )
|
||||
{ return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; }
|
||||
static size_t _S_whichbit( size_t __pos )
|
||||
{ return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; }
|
||||
static _WordT _S_maskbit( size_t __pos )
|
||||
{ return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
|
||||
|
||||
_WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; }
|
||||
_WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; }
|
||||
|
||||
_WordT& _M_hiword() { return _M_w[_Nw - 1]; }
|
||||
_WordT _M_hiword() const { return _M_w[_Nw - 1]; }
|
||||
|
||||
void _M_do_and(const _Base_bitset<_Nw>& __x) {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_M_w[__i] &= __x._M_w[__i];
|
||||
}
|
||||
}
|
||||
|
||||
void _M_do_or(const _Base_bitset<_Nw>& __x) {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_M_w[__i] |= __x._M_w[__i];
|
||||
}
|
||||
}
|
||||
|
||||
void _M_do_xor(const _Base_bitset<_Nw>& __x) {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_M_w[__i] ^= __x._M_w[__i];
|
||||
}
|
||||
}
|
||||
|
||||
void _M_do_left_shift(size_t __shift);
|
||||
void _M_do_right_shift(size_t __shift);
|
||||
|
||||
void _M_do_flip() {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_M_w[__i] = ~_M_w[__i];
|
||||
}
|
||||
}
|
||||
|
||||
void _M_do_set() {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_M_w[__i] = ~static_cast<_WordT>(0);
|
||||
}
|
||||
}
|
||||
|
||||
void _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); }
|
||||
|
||||
bool _M_is_equal(const _Base_bitset<_Nw>& __x) const {
|
||||
for (size_t __i = 0; __i < _Nw; ++__i) {
|
||||
if (_M_w[__i] != __x._M_w[__i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _M_is_any() const {
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
if ( _M_w[__i] != static_cast<_WordT>(0) )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t _M_do_count() const {
|
||||
size_t __result = 0;
|
||||
const unsigned char* __byte_ptr = (const unsigned char*)_M_w;
|
||||
const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw);
|
||||
|
||||
while ( __byte_ptr < __end_ptr ) {
|
||||
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
|
||||
__byte_ptr++;
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
unsigned long _M_do_to_ulong() const;
|
||||
|
||||
// find first "on" bit
|
||||
size_t _M_do_find_first(size_t __not_found) const;
|
||||
|
||||
// find the next "on" bit that follows "prev"
|
||||
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
|
||||
};
|
||||
|
||||
//
|
||||
// Definitions of non-inline functions from _Base_bitset.
|
||||
//
|
||||
|
||||
template<size_t _Nw>
|
||||
void _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift)
|
||||
{
|
||||
if (__shift != 0) {
|
||||
const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD;
|
||||
const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD;
|
||||
|
||||
if (__offset == 0)
|
||||
for (size_t __n = _Nw - 1; __n >= __wshift; --__n)
|
||||
_M_w[__n] = _M_w[__n - __wshift];
|
||||
|
||||
else {
|
||||
const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset;
|
||||
for (size_t __n = _Nw - 1; __n > __wshift; --__n)
|
||||
_M_w[__n] = (_M_w[__n - __wshift] << __offset) |
|
||||
(_M_w[__n - __wshift - 1] >> __sub_offset);
|
||||
_M_w[__wshift] = _M_w[0] << __offset;
|
||||
}
|
||||
|
||||
fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0));
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t _Nw>
|
||||
void _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift)
|
||||
{
|
||||
if (__shift != 0) {
|
||||
const size_t __wshift = __shift / _GLIBCPP_BITSET_BITS_PER_WORD;
|
||||
const size_t __offset = __shift % _GLIBCPP_BITSET_BITS_PER_WORD;
|
||||
const size_t __limit = _Nw - __wshift - 1;
|
||||
|
||||
if (__offset == 0)
|
||||
for (size_t __n = 0; __n <= __limit; ++__n)
|
||||
_M_w[__n] = _M_w[__n + __wshift];
|
||||
|
||||
else {
|
||||
const size_t __sub_offset = _GLIBCPP_BITSET_BITS_PER_WORD - __offset;
|
||||
for (size_t __n = 0; __n < __limit; ++__n)
|
||||
_M_w[__n] = (_M_w[__n + __wshift] >> __offset) |
|
||||
(_M_w[__n + __wshift + 1] << __sub_offset);
|
||||
_M_w[__limit] = _M_w[_Nw-1] >> __offset;
|
||||
}
|
||||
|
||||
fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0));
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t _Nw>
|
||||
unsigned long _Base_bitset<_Nw>::_M_do_to_ulong() const
|
||||
{
|
||||
for (size_t __i = 1; __i < _Nw; ++__i)
|
||||
if (_M_w[__i])
|
||||
__throw_overflow_error("bitset");
|
||||
|
||||
return _M_w[0];
|
||||
}
|
||||
|
||||
template<size_t _Nw>
|
||||
size_t _Base_bitset<_Nw>::_M_do_find_first(size_t __not_found) const
|
||||
{
|
||||
for ( size_t __i = 0; __i < _Nw; __i++ ) {
|
||||
_WordT __thisword = _M_w[__i];
|
||||
if ( __thisword != static_cast<_WordT>(0) ) {
|
||||
// find byte within word
|
||||
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
|
||||
unsigned char __this_byte
|
||||
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
|
||||
if ( __this_byte )
|
||||
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
|
||||
_First_one<true>::_S_first_one[__this_byte];
|
||||
|
||||
__thisword >>= CHAR_BIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
// not found, so return an indication of failure.
|
||||
return __not_found;
|
||||
}
|
||||
|
||||
template<size_t _Nw>
|
||||
size_t
|
||||
_Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
|
||||
{
|
||||
// make bound inclusive
|
||||
++__prev;
|
||||
|
||||
// check out of bounds
|
||||
if ( __prev >= _Nw * _GLIBCPP_BITSET_BITS_PER_WORD )
|
||||
return __not_found;
|
||||
|
||||
// search first word
|
||||
size_t __i = _S_whichword(__prev);
|
||||
_WordT __thisword = _M_w[__i];
|
||||
|
||||
// mask off bits below bound
|
||||
__thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
|
||||
|
||||
if ( __thisword != static_cast<_WordT>(0) ) {
|
||||
// find byte within word
|
||||
// get first byte into place
|
||||
__thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
|
||||
for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
|
||||
unsigned char __this_byte
|
||||
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
|
||||
if ( __this_byte )
|
||||
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
|
||||
_First_one<true>::_S_first_one[__this_byte];
|
||||
|
||||
__thisword >>= CHAR_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
// check subsequent words
|
||||
__i++;
|
||||
for ( ; __i < _Nw; __i++ ) {
|
||||
__thisword = _M_w[__i];
|
||||
if ( __thisword != static_cast<_WordT>(0) ) {
|
||||
// find byte within word
|
||||
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
|
||||
unsigned char __this_byte
|
||||
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
|
||||
if ( __this_byte )
|
||||
return __i*_GLIBCPP_BITSET_BITS_PER_WORD + __j*CHAR_BIT +
|
||||
_First_one<true>::_S_first_one[__this_byte];
|
||||
|
||||
__thisword >>= CHAR_BIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// not found, so return an indication of failure.
|
||||
return __not_found;
|
||||
} // end _M_do_find_next
|
||||
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Base class: specialization for a single word.
|
||||
//
|
||||
|
||||
template<> struct _Base_bitset<1> {
|
||||
typedef unsigned long _WordT;
|
||||
_WordT _M_w;
|
||||
|
||||
_Base_bitset( void ) : _M_w(0) {}
|
||||
_Base_bitset(unsigned long __val) : _M_w(__val) {}
|
||||
|
||||
static size_t _S_whichword( size_t __pos )
|
||||
{ return __pos / _GLIBCPP_BITSET_BITS_PER_WORD; }
|
||||
static size_t _S_whichbyte( size_t __pos )
|
||||
{ return (__pos % _GLIBCPP_BITSET_BITS_PER_WORD) / CHAR_BIT; }
|
||||
static size_t _S_whichbit( size_t __pos )
|
||||
{ return __pos % _GLIBCPP_BITSET_BITS_PER_WORD; }
|
||||
static _WordT _S_maskbit( size_t __pos )
|
||||
{ return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
|
||||
|
||||
_WordT& _M_getword(size_t) { return _M_w; }
|
||||
_WordT _M_getword(size_t) const { return _M_w; }
|
||||
|
||||
_WordT& _M_hiword() { return _M_w; }
|
||||
_WordT _M_hiword() const { return _M_w; }
|
||||
|
||||
void _M_do_and(const _Base_bitset<1>& __x) { _M_w &= __x._M_w; }
|
||||
void _M_do_or(const _Base_bitset<1>& __x) { _M_w |= __x._M_w; }
|
||||
void _M_do_xor(const _Base_bitset<1>& __x) { _M_w ^= __x._M_w; }
|
||||
void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; }
|
||||
void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; }
|
||||
void _M_do_flip() { _M_w = ~_M_w; }
|
||||
void _M_do_set() { _M_w = ~static_cast<_WordT>(0); }
|
||||
void _M_do_reset() { _M_w = 0; }
|
||||
|
||||
bool _M_is_equal(const _Base_bitset<1>& __x) const
|
||||
{ return _M_w == __x._M_w; }
|
||||
bool _M_is_any() const
|
||||
{ return _M_w != 0; }
|
||||
|
||||
size_t _M_do_count() const {
|
||||
size_t __result = 0;
|
||||
const unsigned char* __byte_ptr = (const unsigned char*)&_M_w;
|
||||
const unsigned char* __end_ptr
|
||||
= ((const unsigned char*)&_M_w)+sizeof(_M_w);
|
||||
while ( __byte_ptr < __end_ptr ) {
|
||||
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
|
||||
__byte_ptr++;
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
unsigned long _M_do_to_ulong() const { return _M_w; }
|
||||
|
||||
size_t _M_do_find_first(size_t __not_found) const;
|
||||
|
||||
// find the next "on" bit that follows "prev"
|
||||
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Helper class to zero out the unused high-order bits in the highest word.
|
||||
|
||||
template <size_t _Extrabits> struct _Sanitize {
|
||||
static void _M_do_sanitize(unsigned long& __val)
|
||||
{ __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
|
||||
};
|
||||
|
||||
template<> struct _Sanitize<0> {
|
||||
static void _M_do_sanitize(unsigned long) {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Class bitset.
|
||||
// _Nb may be any nonzero number of type size_t.
|
||||
|
||||
template<size_t _Nb>
|
||||
class bitset : private _Base_bitset<__BITSET_WORDS(_Nb)>
|
||||
{
|
||||
private:
|
||||
typedef _Base_bitset<__BITSET_WORDS(_Nb)> _Base;
|
||||
typedef unsigned long _WordT;
|
||||
|
||||
private:
|
||||
void _M_do_sanitize() {
|
||||
_Sanitize<_Nb%_GLIBCPP_BITSET_BITS_PER_WORD>::_M_do_sanitize(this->_M_hiword());
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// bit reference:
|
||||
class reference;
|
||||
friend class reference;
|
||||
|
||||
class reference {
|
||||
friend class bitset;
|
||||
|
||||
_WordT *_M_wp;
|
||||
size_t _M_bpos;
|
||||
|
||||
// left undefined
|
||||
reference();
|
||||
|
||||
public:
|
||||
reference( bitset& __b, size_t __pos ) {
|
||||
_M_wp = &__b._M_getword(__pos);
|
||||
_M_bpos = _Base::_S_whichbit(__pos);
|
||||
}
|
||||
|
||||
~reference() {}
|
||||
|
||||
// for b[i] = __x;
|
||||
reference& operator=(bool __x) {
|
||||
if ( __x )
|
||||
*_M_wp |= _Base::_S_maskbit(_M_bpos);
|
||||
else
|
||||
*_M_wp &= ~_Base::_S_maskbit(_M_bpos);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// for b[i] = b[__j];
|
||||
reference& operator=(const reference& __j) {
|
||||
if ( (*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)) )
|
||||
*_M_wp |= _Base::_S_maskbit(_M_bpos);
|
||||
else
|
||||
*_M_wp &= ~_Base::_S_maskbit(_M_bpos);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// flips the bit
|
||||
bool operator~() const
|
||||
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
|
||||
|
||||
// for __x = b[i];
|
||||
operator bool() const
|
||||
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
|
||||
|
||||
// for b[i].flip();
|
||||
reference& flip() {
|
||||
*_M_wp ^= _Base::_S_maskbit(_M_bpos);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// 23.3.5.1 constructors:
|
||||
bitset() {}
|
||||
bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val)
|
||||
{ _M_do_sanitize(); }
|
||||
|
||||
template<class _CharT, class _Traits, class _Alloc>
|
||||
explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
|
||||
size_t __pos = 0)
|
||||
: _Base()
|
||||
{
|
||||
if (__pos > __s.size())
|
||||
__throw_out_of_range("bitset");
|
||||
_M_copy_from_string(__s, __pos,
|
||||
basic_string<_CharT, _Traits, _Alloc>::npos);
|
||||
}
|
||||
template<class _CharT, class _Traits, class _Alloc>
|
||||
bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
|
||||
size_t __pos,
|
||||
size_t __n)
|
||||
: _Base()
|
||||
{
|
||||
if (__pos > __s.size())
|
||||
__throw_out_of_range("bitset");
|
||||
_M_copy_from_string(__s, __pos, __n);
|
||||
}
|
||||
|
||||
// 23.3.5.2 bitset operations:
|
||||
bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) {
|
||||
this->_M_do_and(__rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& operator|=(const bitset<_Nb>& __rhs) {
|
||||
this->_M_do_or(__rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& operator^=(const bitset<_Nb>& __rhs) {
|
||||
this->_M_do_xor(__rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& operator<<=(size_t __pos) {
|
||||
this->_M_do_left_shift(__pos);
|
||||
this->_M_do_sanitize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& operator>>=(size_t __pos) {
|
||||
this->_M_do_right_shift(__pos);
|
||||
this->_M_do_sanitize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// Extension:
|
||||
// Versions of single-bit set, reset, flip, test with no range checking.
|
||||
//
|
||||
|
||||
bitset<_Nb>& _Unchecked_set(size_t __pos) {
|
||||
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& _Unchecked_set(size_t __pos, int __val) {
|
||||
if (__val)
|
||||
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
|
||||
else
|
||||
this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& _Unchecked_reset(size_t __pos) {
|
||||
this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& _Unchecked_flip(size_t __pos) {
|
||||
this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool _Unchecked_test(size_t __pos) const {
|
||||
return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
|
||||
!= static_cast<_WordT>(0);
|
||||
}
|
||||
|
||||
// Set, reset, and flip.
|
||||
|
||||
bitset<_Nb>& set() {
|
||||
this->_M_do_set();
|
||||
this->_M_do_sanitize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& set(size_t __pos, bool __val = true) {
|
||||
if (__pos >= _Nb)
|
||||
__throw_out_of_range("bitset");
|
||||
|
||||
return _Unchecked_set(__pos, __val);
|
||||
}
|
||||
|
||||
bitset<_Nb>& reset() {
|
||||
this->_M_do_reset();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& reset(size_t __pos) {
|
||||
if (__pos >= _Nb)
|
||||
__throw_out_of_range("bitset");
|
||||
|
||||
return _Unchecked_reset(__pos);
|
||||
}
|
||||
|
||||
bitset<_Nb>& flip() {
|
||||
this->_M_do_flip();
|
||||
this->_M_do_sanitize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bitset<_Nb>& flip(size_t __pos) {
|
||||
if (__pos >= _Nb)
|
||||
__throw_out_of_range("bitset");
|
||||
|
||||
return _Unchecked_flip(__pos);
|
||||
}
|
||||
|
||||
bitset<_Nb> operator~() const {
|
||||
return bitset<_Nb>(*this).flip();
|
||||
}
|
||||
|
||||
// element access:
|
||||
//for b[i];
|
||||
// _GLIBCPP_RESOLVE_LIB_DEFECTS Note that this implementation already
|
||||
// resolves DR 11 (items 1 and 2), but does not do the range-checking
|
||||
// required by that DR's resolution. -pme
|
||||
reference operator[](size_t __pos) { return reference(*this,__pos); }
|
||||
bool operator[](size_t __pos) const { return _Unchecked_test(__pos); }
|
||||
|
||||
unsigned long to_ulong() const { return this->_M_do_to_ulong(); }
|
||||
|
||||
template <class _CharT, class _Traits, class _Alloc>
|
||||
basic_string<_CharT, _Traits, _Alloc> to_string() const {
|
||||
basic_string<_CharT, _Traits, _Alloc> __result;
|
||||
_M_copy_to_string(__result);
|
||||
return __result;
|
||||
}
|
||||
|
||||
// Helper functions for string operations.
|
||||
template<class _CharT, class _Traits, class _Alloc>
|
||||
void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
|
||||
size_t,
|
||||
size_t);
|
||||
|
||||
template<class _CharT, class _Traits, class _Alloc>
|
||||
void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const;
|
||||
|
||||
size_t count() const { return this->_M_do_count(); }
|
||||
|
||||
size_t size() const { return _Nb; }
|
||||
|
||||
bool operator==(const bitset<_Nb>& __rhs) const {
|
||||
return this->_M_is_equal(__rhs);
|
||||
}
|
||||
bool operator!=(const bitset<_Nb>& __rhs) const {
|
||||
return !this->_M_is_equal(__rhs);
|
||||
}
|
||||
|
||||
bool test(size_t __pos) const {
|
||||
if (__pos >= _Nb)
|
||||
__throw_out_of_range("bitset");
|
||||
|
||||
return _Unchecked_test(__pos);
|
||||
}
|
||||
|
||||
bool any() const { return this->_M_is_any(); }
|
||||
bool none() const { return !this->_M_is_any(); }
|
||||
|
||||
bitset<_Nb> operator<<(size_t __pos) const
|
||||
{ return bitset<_Nb>(*this) <<= __pos; }
|
||||
bitset<_Nb> operator>>(size_t __pos) const
|
||||
{ return bitset<_Nb>(*this) >>= __pos; }
|
||||
|
||||
//
|
||||
// EXTENSIONS: bit-find operations. These operations are
|
||||
// experimental, and are subject to change or removal in future
|
||||
// versions.
|
||||
//
|
||||
|
||||
// find the index of the first "on" bit
|
||||
size_t _Find_first() const
|
||||
{ return this->_M_do_find_first(_Nb); }
|
||||
|
||||
// find the index of the next "on" bit after prev
|
||||
size_t _Find_next( size_t __prev ) const
|
||||
{ return this->_M_do_find_next(__prev, _Nb); }
|
||||
|
||||
};
|
||||
|
||||
//
|
||||
// Definitions of non-inline member functions.
|
||||
//
|
||||
|
||||
template <size_t _Nb>
|
||||
template<class _CharT, class _Traits, class _Alloc>
|
||||
void bitset<_Nb>
|
||||
::_M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
|
||||
size_t __pos,
|
||||
size_t __n)
|
||||
{
|
||||
reset();
|
||||
const size_t __nbits = min(_Nb, min(__n, __s.size() - __pos));
|
||||
for (size_t __i = 0; __i < __nbits; ++__i) {
|
||||
switch(__s[__pos + __nbits - __i - 1]) {
|
||||
case '0':
|
||||
break;
|
||||
case '1':
|
||||
set(__i);
|
||||
break;
|
||||
default:
|
||||
__throw_invalid_argument("bitset");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <size_t _Nb>
|
||||
template <class _CharT, class _Traits, class _Alloc>
|
||||
void bitset<_Nb>
|
||||
::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const
|
||||
{
|
||||
__s.assign(_Nb, '0');
|
||||
|
||||
for (size_t __i = 0; __i < _Nb; ++__i)
|
||||
if (_Unchecked_test(__i))
|
||||
__s[_Nb - 1 - __i] = '1';
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
//
|
||||
// 23.3.5.3 bitset operations:
|
||||
//
|
||||
|
||||
template <size_t _Nb>
|
||||
inline bitset<_Nb> operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
|
||||
bitset<_Nb> __result(__x);
|
||||
__result &= __y;
|
||||
return __result;
|
||||
}
|
||||
|
||||
|
||||
template <size_t _Nb>
|
||||
inline bitset<_Nb> operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
|
||||
bitset<_Nb> __result(__x);
|
||||
__result |= __y;
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <size_t _Nb>
|
||||
inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
|
||||
bitset<_Nb> __result(__x);
|
||||
__result ^= __y;
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Nb>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
|
||||
{
|
||||
typedef typename _Traits::char_type char_type;
|
||||
basic_string<_CharT, _Traits> __tmp;
|
||||
__tmp.reserve(_Nb);
|
||||
|
||||
// Skip whitespace
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sentry(__is);
|
||||
if (__sentry) {
|
||||
basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
|
||||
for (size_t __i = 0; __i < _Nb; ++__i) {
|
||||
static typename _Traits::int_type __eof = _Traits::eof();
|
||||
|
||||
typename _Traits::int_type __c1 = __buf->sbumpc();
|
||||
if (_Traits::eq_int_type(__c1, __eof)) {
|
||||
__is.setstate(ios_base::eofbit);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
char_type __c2 = _Traits::to_char_type(__c1);
|
||||
char_type __c = __is.narrow(__c2, '*');
|
||||
|
||||
if (__c == '0' || __c == '1')
|
||||
__tmp.push_back(__c);
|
||||
else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) {
|
||||
__is.setstate(ios_base::failbit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (__tmp.empty())
|
||||
__is.setstate(ios_base::failbit);
|
||||
else
|
||||
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
|
||||
}
|
||||
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Nb>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x)
|
||||
{
|
||||
basic_string<_CharT, _Traits> __tmp;
|
||||
__x._M_copy_to_string(__tmp);
|
||||
return __os << __tmp;
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
|
||||
#undef __BITSET_WORDS
|
||||
|
||||
#endif /* __GLIBCPP_BITSET */
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,77 +0,0 @@
|
|||
// <deque> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_deque.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_DEQUE
|
||||
#define _CPP_DEQUE 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/functexcept.h>
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_deque.h>
|
||||
|
||||
#endif /* _CPP_DEQUE */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,434 +0,0 @@
|
|||
// File based streams -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.8 File-based streams
|
||||
//
|
||||
|
||||
/** @file std_fstream.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_FSTREAM
|
||||
#define _CPP_FSTREAM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_istream.h>
|
||||
#include <bits/std_ostream.h>
|
||||
#include <bits/basic_file.h>
|
||||
#include <bits/std_locale.h> // For codecvt
|
||||
#include <bits/gthr.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
|
||||
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
|
||||
typedef __basic_file<char_type> __file_type;
|
||||
typedef typename traits_type::state_type __state_type;
|
||||
typedef codecvt<char_type, char, __state_type> __codecvt_type;
|
||||
typedef typename __codecvt_type::result __res_type;
|
||||
typedef ctype<char_type> __ctype_type;
|
||||
|
||||
friend class ios_base; // For sync_with_stdio.
|
||||
|
||||
private:
|
||||
// Data Members:
|
||||
// External buffer.
|
||||
__file_type* _M_file;
|
||||
|
||||
// Current and beginning state type for codecvt.
|
||||
__state_type _M_state_cur;
|
||||
__state_type _M_state_beg;
|
||||
|
||||
// MT lock inherited from libio or other low-level io library.
|
||||
__c_lock _M_lock;
|
||||
|
||||
// Set iff _M_buf is allocated memory from _M_allocate_internal_buffer..
|
||||
bool _M_buf_allocated;
|
||||
|
||||
// XXX Needed?
|
||||
bool _M_last_overflowed;
|
||||
|
||||
public:
|
||||
// Constructors/destructor:
|
||||
basic_filebuf();
|
||||
|
||||
// Non-standard ctor:
|
||||
basic_filebuf(__c_file_type* __f, ios_base::openmode __mode,
|
||||
int_type __s = static_cast<int_type>(BUFSIZ));
|
||||
|
||||
// Non-standard member:
|
||||
int
|
||||
fd();
|
||||
|
||||
virtual
|
||||
~basic_filebuf()
|
||||
{
|
||||
this->close();
|
||||
_M_last_overflowed = false;
|
||||
}
|
||||
|
||||
// Members:
|
||||
bool
|
||||
is_open(void) const { return _M_file ? _M_file->is_open() : false; }
|
||||
|
||||
__filebuf_type*
|
||||
open(const char* __s, ios_base::openmode __mode);
|
||||
|
||||
__filebuf_type*
|
||||
close(void);
|
||||
|
||||
protected:
|
||||
void
|
||||
_M_allocate_internal_buffer();
|
||||
|
||||
void
|
||||
_M_destroy_internal_buffer();
|
||||
|
||||
void
|
||||
_M_allocate_pback_buffer();
|
||||
|
||||
// Create __file_type object and initialize it properly.
|
||||
void
|
||||
_M_allocate_file();
|
||||
|
||||
// Overridden virtual functions:
|
||||
virtual streamsize
|
||||
showmanyc(void);
|
||||
|
||||
// Stroustrup, 1998, p. 628
|
||||
// underflow() and uflow() functions are called to get the next
|
||||
// charater from the real input source when the buffer is empty.
|
||||
// Buffered input uses underflow()
|
||||
virtual int_type
|
||||
underflow(void);
|
||||
|
||||
virtual int_type
|
||||
pbackfail(int_type __c = _Traits::eof());
|
||||
|
||||
// NB: For what the standard expects of the overflow function,
|
||||
// see _M_really_overflow(), below. Because basic_streambuf's
|
||||
// sputc/sputn call overflow directly, and the complications of
|
||||
// this implementation's setting of the initial pointers all
|
||||
// equal to _M_buf when initializing, it seems essential to have
|
||||
// this in actuality be a helper function that checks for the
|
||||
// eccentricities of this implementation, and then call
|
||||
// overflow() if indeed the buffer is full.
|
||||
virtual int_type
|
||||
overflow(int_type __c = _Traits::eof());
|
||||
|
||||
// Stroustrup, 1998, p 648
|
||||
// The overflow() function is called to transfer characters to the
|
||||
// real output destination when the buffer is full. A call to
|
||||
// overflow(c) outputs the contents of the buffer plus the
|
||||
// character c.
|
||||
// 27.5.2.4.5
|
||||
// Consume some sequence of the characters in the pending sequence.
|
||||
int_type
|
||||
_M_really_overflow(int_type __c = _Traits::eof());
|
||||
|
||||
virtual __streambuf_type*
|
||||
setbuf(char_type* __s, streamsize __n);
|
||||
|
||||
virtual pos_type
|
||||
seekoff(off_type __off, ios_base::seekdir __way,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
|
||||
virtual pos_type
|
||||
seekpos(pos_type __pos,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
|
||||
virtual int
|
||||
sync(void)
|
||||
{
|
||||
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
|
||||
if (__testput)
|
||||
{
|
||||
// Make sure that libio resyncs its idea of the file position
|
||||
// with the external file.
|
||||
_M_file->sync();
|
||||
|
||||
// Need to restore current position. This interpreted as
|
||||
// the position of the external byte sequence (_M_file)
|
||||
// plus the offset in the current internal buffer
|
||||
// (_M_out_beg - _M_out_cur)
|
||||
streamoff __cur = _M_file->seekoff(0, ios_base::cur);
|
||||
off_type __off = _M_out_cur - _M_out_beg;
|
||||
_M_really_overflow();
|
||||
_M_file->seekpos(__cur + __off);
|
||||
}
|
||||
_M_last_overflowed = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void
|
||||
imbue(const locale& __loc);
|
||||
|
||||
virtual streamsize
|
||||
xsgetn(char_type* __s, streamsize __n)
|
||||
{
|
||||
streamsize __ret = 0;
|
||||
// Clear out pback buffer before going on to the real deal...
|
||||
if (_M_pback_init)
|
||||
{
|
||||
while (__ret < __n && _M_in_cur < _M_in_end)
|
||||
{
|
||||
*__s = *_M_in_cur;
|
||||
++__ret;
|
||||
++__s;
|
||||
++_M_in_cur;
|
||||
}
|
||||
_M_pback_destroy();
|
||||
}
|
||||
if (__ret < __n)
|
||||
__ret += __streambuf_type::xsgetn(__s, __n - __ret);
|
||||
return __ret;
|
||||
}
|
||||
|
||||
virtual streamsize
|
||||
xsputn(const char_type* __s, streamsize __n)
|
||||
{
|
||||
_M_pback_destroy();
|
||||
return __streambuf_type::xsputn(__s, __n);
|
||||
}
|
||||
|
||||
void
|
||||
_M_output_unshift();
|
||||
};
|
||||
|
||||
|
||||
// 27.8.1.5 Template class basic_ifstream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_ifstream : public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard types:
|
||||
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
|
||||
typedef basic_istream<char_type, traits_type> __istream_type;
|
||||
|
||||
private:
|
||||
__filebuf_type _M_filebuf;
|
||||
|
||||
public:
|
||||
// Constructors/Destructors:
|
||||
basic_ifstream()
|
||||
: __istream_type(NULL), _M_filebuf()
|
||||
{ this->init(&_M_filebuf); }
|
||||
|
||||
explicit
|
||||
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
|
||||
: __istream_type(NULL), _M_filebuf()
|
||||
{
|
||||
this->init(&_M_filebuf);
|
||||
this->open(__s, __mode);
|
||||
}
|
||||
|
||||
~basic_ifstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__filebuf_type*
|
||||
rdbuf() const
|
||||
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
|
||||
|
||||
bool
|
||||
is_open(void) { return _M_filebuf.is_open(); }
|
||||
|
||||
void
|
||||
open(const char* __s, ios_base::openmode __mode = ios_base::in)
|
||||
{
|
||||
if (_M_filebuf.open(__s, __mode | ios_base::in) == NULL)
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
void
|
||||
close(void)
|
||||
{
|
||||
if (!_M_filebuf.close())
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 27.8.1.8 Template class basic_ofstream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_ofstream : public basic_ostream<_CharT,_Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard types:
|
||||
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
|
||||
typedef basic_ostream<char_type, traits_type> __ostream_type;
|
||||
|
||||
private:
|
||||
__filebuf_type _M_filebuf;
|
||||
|
||||
public:
|
||||
// Constructors:
|
||||
basic_ofstream()
|
||||
: __ostream_type(NULL), _M_filebuf()
|
||||
{ this->init(&_M_filebuf); }
|
||||
|
||||
explicit
|
||||
basic_ofstream(const char* __s,
|
||||
ios_base::openmode __mode = ios_base::out|ios_base::trunc)
|
||||
: __ostream_type(NULL), _M_filebuf()
|
||||
{
|
||||
this->init(&_M_filebuf);
|
||||
this->open(__s, __mode);
|
||||
}
|
||||
|
||||
~basic_ofstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__filebuf_type*
|
||||
rdbuf(void) const
|
||||
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
|
||||
|
||||
bool
|
||||
is_open(void) { return _M_filebuf.is_open(); }
|
||||
|
||||
void
|
||||
open(const char* __s,
|
||||
ios_base::openmode __mode = ios_base::out | ios_base::trunc)
|
||||
{
|
||||
if (!_M_filebuf.open(__s, __mode | ios_base::out))
|
||||
this->setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
void
|
||||
close(void)
|
||||
{
|
||||
if (!_M_filebuf.close())
|
||||
setstate(ios_base::failbit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 27.8.1.11 Template class basic_fstream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_fstream : public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard types:
|
||||
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
|
||||
typedef basic_ios<char_type, traits_type> __ios_type;
|
||||
typedef basic_iostream<char_type, traits_type> __iostream_type;
|
||||
|
||||
private:
|
||||
__filebuf_type _M_filebuf;
|
||||
|
||||
public:
|
||||
// Constructors/destructor:
|
||||
basic_fstream()
|
||||
: __iostream_type(NULL), _M_filebuf()
|
||||
{ this->init(&_M_filebuf); }
|
||||
|
||||
explicit
|
||||
basic_fstream(const char* __s,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
: __iostream_type(NULL), _M_filebuf()
|
||||
{
|
||||
this->init(&_M_filebuf);
|
||||
this->open(__s, __mode);
|
||||
}
|
||||
|
||||
~basic_fstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__filebuf_type*
|
||||
rdbuf(void) const
|
||||
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
|
||||
|
||||
bool
|
||||
is_open(void) { return _M_filebuf.is_open(); }
|
||||
|
||||
void
|
||||
open(const char* __s,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
{
|
||||
if (!_M_filebuf.open(__s, __mode))
|
||||
setstate(ios_base::failbit);
|
||||
}
|
||||
|
||||
void
|
||||
close(void)
|
||||
{
|
||||
if (!_M_filebuf.close())
|
||||
setstate(ios_base::failbit);
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
|
||||
# include <bits/fstream.tcc>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
// <functional> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file std_functional.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_FUNCTIONAL
|
||||
#define _CPP_FUNCTIONAL 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <bits/stl_function.h>
|
||||
|
||||
#endif /* _CPP_FUNCTIONAL */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
// Standard stream manipulators -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.6.3 Standard manipulators
|
||||
//
|
||||
|
||||
/** @file std_iomanip.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_IOMANIP
|
||||
#define _CPP_IOMANIP 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_istream.h>
|
||||
#include <bits/std_functional.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
struct _Resetiosflags { ios_base::fmtflags _M_mask; };
|
||||
|
||||
inline _Resetiosflags
|
||||
resetiosflags(ios_base::fmtflags __mask)
|
||||
{
|
||||
_Resetiosflags __x;
|
||||
__x._M_mask = __mask;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Resetiosflags __f)
|
||||
{
|
||||
__is.setf(ios_base::fmtflags(0), __f._M_mask);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Resetiosflags __f)
|
||||
{
|
||||
__os.setf(ios_base::fmtflags(0), __f._M_mask);
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
||||
struct _Setiosflags { ios_base::fmtflags _M_mask; };
|
||||
|
||||
inline _Setiosflags
|
||||
setiosflags(ios_base::fmtflags __mask)
|
||||
{
|
||||
_Setiosflags __x;
|
||||
__x._M_mask = __mask;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Setiosflags __f)
|
||||
{
|
||||
__is.setf(__f._M_mask);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setiosflags __f)
|
||||
{
|
||||
__os.setf(__f._M_mask);
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
||||
struct _Setbase { int _M_base; };
|
||||
|
||||
inline _Setbase
|
||||
setbase(int __base)
|
||||
{
|
||||
_Setbase __x;
|
||||
__x._M_base = __base;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Setbase __f)
|
||||
{
|
||||
__is.setf(__f._M_base == 8 ? ios_base::oct :
|
||||
__f._M_base == 10 ? ios_base::dec :
|
||||
__f._M_base == 16 ? ios_base::hex :
|
||||
ios_base::fmtflags(0), ios_base::basefield);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setbase __f)
|
||||
{
|
||||
__os.setf(__f._M_base == 8 ? ios_base::oct :
|
||||
__f._M_base == 10 ? ios_base::dec :
|
||||
__f._M_base == 16 ? ios_base::hex :
|
||||
ios_base::fmtflags(0), ios_base::basefield);
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
||||
template<class _CharT>
|
||||
struct _Setfill { _CharT _M_c; };
|
||||
|
||||
template<class _CharT>
|
||||
_Setfill<_CharT>
|
||||
setfill(_CharT __c)
|
||||
{
|
||||
_Setfill<_CharT> __x;
|
||||
__x._M_c = __c;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Setfill<_CharT> __f)
|
||||
{
|
||||
__is.fill(__f._M_c);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setfill<_CharT> __f)
|
||||
{
|
||||
__os.fill(__f._M_c);
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
||||
struct _Setprecision { int _M_n; };
|
||||
|
||||
inline _Setprecision
|
||||
setprecision(int __n)
|
||||
{
|
||||
_Setprecision __x;
|
||||
__x._M_n = __n;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Setprecision __f)
|
||||
{
|
||||
__is.precision(__f._M_n);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setprecision __f)
|
||||
{
|
||||
__os.precision(__f._M_n);
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
||||
struct _Setw { int _M_n; };
|
||||
|
||||
inline _Setw
|
||||
setw(int __n)
|
||||
{
|
||||
_Setw __x;
|
||||
__x._M_n = __n;
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_istream<_CharT,_Traits>&
|
||||
operator>>(basic_istream<_CharT,_Traits>& __is, _Setw __f)
|
||||
{
|
||||
__is.width(__f._M_n);
|
||||
return __is;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
basic_ostream<_CharT,_Traits>&
|
||||
operator<<(basic_ostream<_CharT,_Traits>& __os, _Setw __f)
|
||||
{
|
||||
__os.width(__f._M_n);
|
||||
return __os;
|
||||
}
|
||||
} // namespace std
|
||||
|
||||
#endif
|
|
@ -1,54 +0,0 @@
|
|||
// Iostreams base classes -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.4 Iostreams base classes
|
||||
//
|
||||
|
||||
/** @file std_ios.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_IOS
|
||||
#define _CPP_IOS 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_iosfwd.h>
|
||||
#include <exception> // For ios_base::failure
|
||||
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
|
||||
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
|
||||
#include <bits/localefwd.h> // For class locale
|
||||
#include <bits/ios_base.h> // For ios_base declarations.
|
||||
#include <bits/std_streambuf.h>
|
||||
#include <bits/basic_ios.h>
|
||||
|
||||
#endif /* _CPP_IOS */
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
// Forwarding declarations -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.2 Forward declarations
|
||||
//
|
||||
|
||||
/** @file std_iosfwd.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_IOSFWD
|
||||
#define _CPP_IOSFWD 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/stringfwd.h> // For string forward declarations.
|
||||
#include <bits/fpos.h>
|
||||
#include <bits/functexcept.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ios;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_streambuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_istream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ostream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_iostream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_stringbuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_istringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_ostringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_stringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_filebuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ifstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ofstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_fstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class istreambuf_iterator;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class ostreambuf_iterator;
|
||||
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// Not included. (??? Apparently no LWG number?)
|
||||
class ios_base;
|
||||
#endif
|
||||
|
||||
typedef basic_ios<char> ios;
|
||||
typedef basic_streambuf<char> streambuf;
|
||||
typedef basic_istream<char> istream;
|
||||
typedef basic_ostream<char> ostream;
|
||||
typedef basic_iostream<char> iostream;
|
||||
typedef basic_stringbuf<char> stringbuf;
|
||||
typedef basic_istringstream<char> istringstream;
|
||||
typedef basic_ostringstream<char> ostringstream;
|
||||
typedef basic_stringstream<char> stringstream;
|
||||
typedef basic_filebuf<char> filebuf;
|
||||
typedef basic_ifstream<char> ifstream;
|
||||
typedef basic_ofstream<char> ofstream;
|
||||
typedef basic_fstream<char> fstream;
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
typedef basic_ios<wchar_t> wios;
|
||||
typedef basic_streambuf<wchar_t> wstreambuf;
|
||||
typedef basic_istream<wchar_t> wistream;
|
||||
typedef basic_ostream<wchar_t> wostream;
|
||||
typedef basic_iostream<wchar_t> wiostream;
|
||||
typedef basic_stringbuf<wchar_t> wstringbuf;
|
||||
typedef basic_istringstream<wchar_t> wistringstream;
|
||||
typedef basic_ostringstream<wchar_t> wostringstream;
|
||||
typedef basic_stringstream<wchar_t> wstringstream;
|
||||
typedef basic_filebuf<wchar_t> wfilebuf;
|
||||
typedef basic_ifstream<wchar_t> wifstream;
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
typedef basic_fstream<wchar_t> wfstream;
|
||||
#endif
|
||||
} // namespace std
|
||||
|
||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||
// Standard iostream objects -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.3 Standard iostream objects
|
||||
//
|
||||
|
||||
/** @file std_iostream.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_IOSTREAM
|
||||
#define _CPP_IOSTREAM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_ostream.h>
|
||||
#include <bits/std_istream.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
extern istream cin;
|
||||
extern ostream cout;
|
||||
extern ostream cerr;
|
||||
extern ostream clog;
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
extern wistream wcin;
|
||||
extern wostream wcout;
|
||||
extern wostream wcerr;
|
||||
extern wostream wclog;
|
||||
#endif
|
||||
|
||||
// For construction of filebuffers for cout, cin, cerr, clog et. al.
|
||||
static ios_base::Init __ioinit;
|
||||
} // namespace std
|
||||
|
||||
#endif
|
|
@ -1,299 +0,0 @@
|
|||
// Input streams -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.6.1 Input streams
|
||||
//
|
||||
|
||||
/** @file std_istream.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_ISTREAM
|
||||
#define _CPP_ISTREAM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_ios.h>
|
||||
#include <bits/std_limits.h> // For numeric_limits
|
||||
|
||||
namespace std
|
||||
{
|
||||
// 27.6.1.1 Template class basic_istream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_istream : virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types (inherited from basic_ios (27.4.4)):
|
||||
typedef _CharT char_type;
|
||||
typedef typename _Traits::int_type int_type;
|
||||
typedef typename _Traits::pos_type pos_type;
|
||||
typedef typename _Traits::off_type off_type;
|
||||
typedef _Traits traits_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
|
||||
typedef basic_ios<_CharT, _Traits> __ios_type;
|
||||
typedef basic_istream<_CharT, _Traits> __istream_type;
|
||||
typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
|
||||
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
|
||||
typedef ctype<_CharT> __ctype_type;
|
||||
|
||||
protected:
|
||||
// Data Members:
|
||||
streamsize _M_gcount;
|
||||
|
||||
public:
|
||||
// 27.6.1.1.1 Constructor/destructor:
|
||||
explicit
|
||||
basic_istream(__streambuf_type* __sb)
|
||||
{
|
||||
this->init(__sb);
|
||||
_M_gcount = streamsize(0);
|
||||
}
|
||||
|
||||
virtual
|
||||
~basic_istream()
|
||||
{ _M_gcount = streamsize(0); }
|
||||
|
||||
// 27.6.1.1.2 Prefix/suffix:
|
||||
class sentry;
|
||||
friend class sentry;
|
||||
|
||||
// 27.6.1.2 Formatted input:
|
||||
// 27.6.1.2.3 basic_istream::operator>>
|
||||
__istream_type&
|
||||
operator>>(__istream_type& (*__pf)(__istream_type&));
|
||||
|
||||
__istream_type&
|
||||
operator>>(__ios_type& (*__pf)(__ios_type&));
|
||||
|
||||
__istream_type&
|
||||
operator>>(ios_base& (*__pf)(ios_base&));
|
||||
|
||||
// 27.6.1.2.2 Arithmetic Extractors
|
||||
__istream_type&
|
||||
operator>>(bool& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(short& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(unsigned short& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(int& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(unsigned int& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(long& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(unsigned long& __n);
|
||||
|
||||
#ifdef _GLIBCPP_USE_LONG_LONG
|
||||
__istream_type&
|
||||
operator>>(long long& __n);
|
||||
|
||||
__istream_type&
|
||||
operator>>(unsigned long long& __n);
|
||||
#endif
|
||||
|
||||
__istream_type&
|
||||
operator>>(float& __f);
|
||||
|
||||
__istream_type&
|
||||
operator>>(double& __f);
|
||||
|
||||
__istream_type&
|
||||
operator>>(long double& __f);
|
||||
|
||||
__istream_type&
|
||||
operator>>(void*& __p);
|
||||
|
||||
__istream_type&
|
||||
operator>>(__streambuf_type* __sb);
|
||||
|
||||
// 27.6.1.3 Unformatted input:
|
||||
inline streamsize
|
||||
gcount(void) const
|
||||
{ return _M_gcount; }
|
||||
|
||||
int_type
|
||||
get(void);
|
||||
|
||||
__istream_type&
|
||||
get(char_type& __c);
|
||||
|
||||
__istream_type&
|
||||
get(char_type* __s, streamsize __n, char_type __delim);
|
||||
|
||||
inline __istream_type&
|
||||
get(char_type* __s, streamsize __n)
|
||||
{ return this->get(__s, __n, this->widen('\n')); }
|
||||
|
||||
__istream_type&
|
||||
get(__streambuf_type& __sb, char_type __delim);
|
||||
|
||||
inline __istream_type&
|
||||
get(__streambuf_type& __sb)
|
||||
{ return this->get(__sb, this->widen('\n')); }
|
||||
|
||||
__istream_type&
|
||||
getline(char_type* __s, streamsize __n, char_type __delim);
|
||||
|
||||
inline __istream_type&
|
||||
getline(char_type* __s, streamsize __n)
|
||||
{ return this->getline(__s, __n, this->widen('\n')); }
|
||||
|
||||
__istream_type&
|
||||
ignore(streamsize __n = 1, int_type __delim = traits_type::eof());
|
||||
|
||||
int_type
|
||||
peek(void);
|
||||
|
||||
__istream_type&
|
||||
read(char_type* __s, streamsize __n);
|
||||
|
||||
streamsize
|
||||
readsome(char_type* __s, streamsize __n);
|
||||
|
||||
__istream_type&
|
||||
putback(char_type __c);
|
||||
|
||||
__istream_type&
|
||||
unget(void);
|
||||
|
||||
int
|
||||
sync(void);
|
||||
|
||||
pos_type
|
||||
tellg(void);
|
||||
|
||||
__istream_type&
|
||||
seekg(pos_type);
|
||||
|
||||
__istream_type&
|
||||
seekg(off_type, ios_base::seekdir);
|
||||
|
||||
private:
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// Not defined. (Side effect of DR 50.)
|
||||
__istream_type&
|
||||
operator=(const __istream_type&);
|
||||
|
||||
basic_istream(const __istream_type&);
|
||||
#endif
|
||||
};
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_istream<_CharT, _Traits>::sentry
|
||||
{
|
||||
public:
|
||||
typedef _Traits traits_type;
|
||||
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
|
||||
typedef basic_istream<_CharT, _Traits> __istream_type;
|
||||
typedef typename __istream_type::__ctype_type __ctype_type;
|
||||
typedef typename _Traits::int_type __int_type;
|
||||
|
||||
explicit
|
||||
sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
|
||||
|
||||
operator bool() { return _M_ok; }
|
||||
|
||||
private:
|
||||
bool _M_ok;
|
||||
};
|
||||
|
||||
// 27.6.1.2.3 Character extraction templates
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
|
||||
|
||||
template<class _Traits>
|
||||
basic_istream<char, _Traits>&
|
||||
operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
|
||||
{ return (__in >> reinterpret_cast<char&>(__c)); }
|
||||
|
||||
template<class _Traits>
|
||||
basic_istream<char, _Traits>&
|
||||
operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
|
||||
{ return (__in >> reinterpret_cast<char&>(__c)); }
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
|
||||
|
||||
template<class _Traits>
|
||||
basic_istream<char,_Traits>&
|
||||
operator>>(basic_istream<char,_Traits>& __in, unsigned char* __s)
|
||||
{ return (__in >> reinterpret_cast<char*>(__s)); }
|
||||
|
||||
template<class _Traits>
|
||||
basic_istream<char,_Traits>&
|
||||
operator>>(basic_istream<char,_Traits>& __in, signed char* __s)
|
||||
{ return (__in >> reinterpret_cast<char*>(__s)); }
|
||||
|
||||
// 27.6.1.5 Template class basic_iostream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_iostream
|
||||
: public basic_istream<_CharT, _Traits>,
|
||||
public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Non-standard Types:
|
||||
typedef basic_istream<_CharT, _Traits> __istream_type;
|
||||
typedef basic_ostream<_CharT, _Traits> __ostream_type;
|
||||
|
||||
explicit
|
||||
basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
|
||||
: __istream_type(__sb), __ostream_type(__sb)
|
||||
{ }
|
||||
|
||||
virtual
|
||||
~basic_iostream() { }
|
||||
};
|
||||
|
||||
// 27.6.1.4 Standard basic_istream manipulators
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_istream<_CharT, _Traits>&
|
||||
ws(basic_istream<_CharT, _Traits>& __is);
|
||||
} // namespace std
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
|
||||
# include <bits/istream.tcc>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _CPP_ISTREAM */
|
|
@ -1,79 +0,0 @@
|
|||
// <iterator> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_iterator.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_ITERATOR
|
||||
#define _CPP_ITERATOR 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <bits/stl_iterator_base_types.h>
|
||||
#include <bits/stl_iterator_base_funcs.h>
|
||||
#include <bits/stl_iterator.h>
|
||||
#include <bits/std_ostream.h>
|
||||
#include <bits/std_istream.h>
|
||||
#include <bits/stream_iterator.h>
|
||||
#include <bits/streambuf_iterator.h>
|
||||
|
||||
#endif /* _CPP_ITERATOR */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,77 +0,0 @@
|
|||
// <list> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_list.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_LIST
|
||||
#define _CPP_LIST 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/functexcept.h>
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_list.h>
|
||||
|
||||
#endif /* _CPP_LIST */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,52 +0,0 @@
|
|||
// Locale support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 22.1 Locales
|
||||
//
|
||||
|
||||
/** @file std_locale.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_LOCALE
|
||||
#define _CPP_LOCALE 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/localefwd.h>
|
||||
#include <bits/locale_facets.h>
|
||||
#include <bits/locale_facets.tcc>
|
||||
|
||||
#endif
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
|
@ -1,74 +0,0 @@
|
|||
// <map> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_map.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_MAP
|
||||
#define _CPP_MAP 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/stl_tree.h>
|
||||
#include <bits/stl_map.h>
|
||||
#include <bits/stl_multimap.h>
|
||||
|
||||
#endif /* _CPP_MAP */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,149 +0,0 @@
|
|||
// <memory> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997-1999
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file std_memory.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_MEMORY
|
||||
#define _CPP_MEMORY 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_iterator_base_types.h> //for iterator_traits
|
||||
#include <bits/stl_tempbuf.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_raw_storage_iter.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<class _Tp1> struct auto_ptr_ref {
|
||||
_Tp1* _M_ptr;
|
||||
auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* A simple smart pointer providing strict ownership semantics. (More later.)
|
||||
*/
|
||||
template <class _Tp> class auto_ptr {
|
||||
private:
|
||||
_Tp* _M_ptr;
|
||||
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
|
||||
explicit auto_ptr(_Tp* __p = 0) throw() : _M_ptr(__p) {}
|
||||
auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) {}
|
||||
|
||||
template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) throw()
|
||||
: _M_ptr(__a.release()) {}
|
||||
|
||||
auto_ptr& operator=(auto_ptr& __a) throw() {
|
||||
reset(__a.release());
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Tp1>
|
||||
auto_ptr& operator=(auto_ptr<_Tp1>& __a) throw() {
|
||||
reset(__a.release());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Note: The C++ standard says there is supposed to be an empty throw
|
||||
// specification here, but omitting it is standard conforming. Its
|
||||
// presence can be detected only if _Tp::~_Tp() throws, but (17.4.3.6/2)
|
||||
// this is prohibited.
|
||||
~auto_ptr() { delete _M_ptr; }
|
||||
|
||||
_Tp& operator*() const throw() {
|
||||
return *_M_ptr;
|
||||
}
|
||||
_Tp* operator->() const throw() {
|
||||
return _M_ptr;
|
||||
}
|
||||
_Tp* get() const throw() {
|
||||
return _M_ptr;
|
||||
}
|
||||
_Tp* release() throw() {
|
||||
_Tp* __tmp = _M_ptr;
|
||||
_M_ptr = 0;
|
||||
return __tmp;
|
||||
}
|
||||
void reset(_Tp* __p = 0) throw() {
|
||||
if (__p != _M_ptr) {
|
||||
delete _M_ptr;
|
||||
_M_ptr = __p;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
auto_ptr(auto_ptr_ref<_Tp> __ref) throw()
|
||||
: _M_ptr(__ref._M_ptr) {}
|
||||
|
||||
auto_ptr& operator=(auto_ptr_ref<_Tp> __ref) throw() {
|
||||
if (__ref._M_ptr != this->get()) {
|
||||
delete _M_ptr;
|
||||
_M_ptr = __ref._M_ptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Tp1> operator auto_ptr_ref<_Tp1>() throw()
|
||||
{ return auto_ptr_ref<_Tp>(this->release()); }
|
||||
template <class _Tp1> operator auto_ptr<_Tp1>() throw()
|
||||
{ return auto_ptr<_Tp1>(this->release()); }
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif /* _CPP_MEMORY */
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,75 +0,0 @@
|
|||
// <numeric> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_numeric.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_NUMERIC
|
||||
#define _CPP_NUMERIC 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <bits/std_iterator.h>
|
||||
#include <bits/stl_function.h>
|
||||
#include <bits/stl_numeric.h>
|
||||
|
||||
#endif /* _CPP_NUMERIC */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,288 +0,0 @@
|
|||
// Output streams -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.6.2 Output streams
|
||||
//
|
||||
|
||||
/** @file std_ostream.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_OSTREAM
|
||||
#define _CPP_OSTREAM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_ios.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
// 27.6.2.1 Template class basic_ostream
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_ostream : virtual public basic_ios<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
|
||||
// Types (inherited from basic_ios (27.4.4)):
|
||||
typedef _CharT char_type;
|
||||
typedef typename _Traits::int_type int_type;
|
||||
typedef typename _Traits::pos_type pos_type;
|
||||
typedef typename _Traits::off_type off_type;
|
||||
typedef _Traits traits_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
|
||||
typedef basic_ios<_CharT, _Traits> __ios_type;
|
||||
typedef basic_ostream<_CharT, _Traits> __ostream_type;
|
||||
typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
|
||||
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
|
||||
typedef ctype<_CharT> __ctype_type;
|
||||
|
||||
// 27.6.2.2 Constructor/destructor:
|
||||
explicit
|
||||
basic_ostream(__streambuf_type* __sb)
|
||||
{ this->init(__sb); }
|
||||
|
||||
virtual
|
||||
~basic_ostream() { }
|
||||
|
||||
// 27.6.2.3 Prefix/suffix:
|
||||
class sentry;
|
||||
friend class sentry;
|
||||
|
||||
// 27.6.2.5 Formatted output:
|
||||
// 27.6.2.5.3 basic_ostream::operator<<
|
||||
__ostream_type&
|
||||
operator<<(__ostream_type& (*__pf)(__ostream_type&));
|
||||
|
||||
__ostream_type&
|
||||
operator<<(__ios_type& (*__pf)(__ios_type&));
|
||||
|
||||
__ostream_type&
|
||||
operator<<(ios_base& (*__pf) (ios_base&));
|
||||
|
||||
// 27.6.2.5.2 Arithmetic Inserters
|
||||
__ostream_type&
|
||||
operator<<(long __n);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(unsigned long __n);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(bool __n);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(short __n)
|
||||
{
|
||||
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
|
||||
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
|
||||
return this->operator<<(static_cast<unsigned long>
|
||||
(static_cast<unsigned short>(__n)));
|
||||
else
|
||||
return this->operator<<(static_cast<long>(__n));
|
||||
}
|
||||
|
||||
__ostream_type&
|
||||
operator<<(unsigned short __n)
|
||||
{ return this->operator<<(static_cast<unsigned long>(__n)); }
|
||||
|
||||
__ostream_type&
|
||||
operator<<(int __n)
|
||||
{
|
||||
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
|
||||
if (__fmt & ios_base::oct || __fmt & ios_base::hex)
|
||||
return this->operator<<(static_cast<unsigned long>
|
||||
(static_cast<unsigned int>(__n)));
|
||||
else
|
||||
return this->operator<<(static_cast<long>(__n));
|
||||
}
|
||||
|
||||
__ostream_type&
|
||||
operator<<(unsigned int __n)
|
||||
{ return this->operator<<(static_cast<unsigned long>(__n)); }
|
||||
|
||||
#ifdef _GLIBCPP_USE_LONG_LONG
|
||||
__ostream_type&
|
||||
operator<<(long long __n);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(unsigned long long __n);
|
||||
#endif
|
||||
|
||||
__ostream_type&
|
||||
operator<<(double __f);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(float __f)
|
||||
{ return this->operator<<(static_cast<double>(__f)); }
|
||||
|
||||
__ostream_type&
|
||||
operator<<(long double __f);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(const void* __p);
|
||||
|
||||
__ostream_type&
|
||||
operator<<(__streambuf_type* __sb);
|
||||
|
||||
// Unformatted output:
|
||||
__ostream_type&
|
||||
put(char_type __c);
|
||||
|
||||
__ostream_type&
|
||||
write(const char_type* __s, streamsize __n);
|
||||
|
||||
__ostream_type&
|
||||
flush();
|
||||
|
||||
// Seeks:
|
||||
pos_type
|
||||
tellp();
|
||||
|
||||
__ostream_type&
|
||||
seekp(pos_type);
|
||||
|
||||
__ostream_type&
|
||||
seekp(off_type, ios_base::seekdir);
|
||||
|
||||
private:
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// Not defined. (Side effect of DR 50.)
|
||||
__ostream_type&
|
||||
operator=(const __ostream_type&);
|
||||
|
||||
basic_ostream(const __ostream_type&);
|
||||
#endif
|
||||
};
|
||||
|
||||
// 27.6.2.3 Class basic_ostream::sentry
|
||||
template <typename _CharT, typename _Traits>
|
||||
class basic_ostream<_CharT, _Traits>::sentry
|
||||
{
|
||||
// Data Members:
|
||||
bool _M_ok;
|
||||
basic_ostream<_CharT,_Traits>& _M_os;
|
||||
|
||||
public:
|
||||
explicit
|
||||
sentry(basic_ostream<_CharT,_Traits>& __os);
|
||||
|
||||
~sentry()
|
||||
{
|
||||
// XXX MT
|
||||
if (_M_os.flags() & ios_base::unitbuf && !uncaught_exception())
|
||||
{
|
||||
// Can't call flush directly or else will get into recursive lock.
|
||||
if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
|
||||
_M_os.setstate(ios_base::badbit);
|
||||
}
|
||||
}
|
||||
|
||||
operator bool()
|
||||
{ return _M_ok; }
|
||||
};
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c);
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
|
||||
{ return (__out << __out.widen(__c)); }
|
||||
|
||||
// Specialization
|
||||
template <class _Traits>
|
||||
basic_ostream<char, _Traits>&
|
||||
operator<<(basic_ostream<char, _Traits>& __out, char __c);
|
||||
|
||||
// Signed and unsigned
|
||||
template<class _Traits>
|
||||
basic_ostream<char, _Traits>&
|
||||
operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
|
||||
{ return (__out << static_cast<char>(__c)); }
|
||||
|
||||
template<class _Traits>
|
||||
basic_ostream<char, _Traits>&
|
||||
operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
|
||||
{ return (__out << static_cast<char>(__c)); }
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s);
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits> &
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
|
||||
|
||||
// Partial specializationss
|
||||
template<class _Traits>
|
||||
basic_ostream<char, _Traits>&
|
||||
operator<<(basic_ostream<char, _Traits>& __out, const char* __s);
|
||||
|
||||
// Signed and unsigned
|
||||
template<class _Traits>
|
||||
basic_ostream<char, _Traits>&
|
||||
operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
|
||||
{ return (__out << reinterpret_cast<const char*>(__s)); }
|
||||
|
||||
template<class _Traits>
|
||||
basic_ostream<char, _Traits> &
|
||||
operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
|
||||
{ return (__out << reinterpret_cast<const char*>(__s)); }
|
||||
|
||||
// 27.6.2.7 Standard basic_ostream manipulators
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
endl(basic_ostream<_CharT, _Traits>& __os)
|
||||
{ return flush(__os.put(__os.widen('\n'))); }
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
ends(basic_ostream<_CharT, _Traits>& __os)
|
||||
{ return __os.put(_CharT()); }
|
||||
|
||||
template<typename _CharT, typename _Traits>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
flush(basic_ostream<_CharT, _Traits>& __os)
|
||||
{ return __os.flush(); }
|
||||
|
||||
} // namespace std
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
|
||||
# include <bits/ostream.tcc>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _CPP_OSTREAM */
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
// <queue> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_queue.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_QUEUE
|
||||
#define _CPP_QUEUE 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/functexcept.h>
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_vector.h>
|
||||
#include <bits/stl_heap.h>
|
||||
#include <bits/stl_deque.h>
|
||||
#include <bits/stl_function.h>
|
||||
#include <bits/stl_queue.h>
|
||||
|
||||
#endif /* _CPP_QUEUE */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,74 +0,0 @@
|
|||
// <set> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_set.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_SET
|
||||
#define _CPP_SET 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/stl_tree.h>
|
||||
#include <bits/stl_set.h>
|
||||
#include <bits/stl_multiset.h>
|
||||
|
||||
#endif /* _CPP_SET */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,372 +0,0 @@
|
|||
// String based streams -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.7 String-based streams
|
||||
//
|
||||
|
||||
/** @file std_sstream.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_SSTREAM
|
||||
#define _CPP_SSTREAM 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/std_istream.h>
|
||||
#include <bits/std_ostream.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<typename _CharT, typename _Traits, typename _Alloc>
|
||||
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// 251. basic_stringbuf missing allocator_type
|
||||
typedef _Alloc allocator_type;
|
||||
#endif
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
|
||||
typedef basic_string<char_type, _Traits, _Alloc> __string_type;
|
||||
typedef typename __string_type::size_type __size_type;
|
||||
|
||||
private:
|
||||
// Data Members:
|
||||
__string_type _M_string;
|
||||
|
||||
public:
|
||||
// Constructors:
|
||||
explicit
|
||||
basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
: __streambuf_type(), _M_string()
|
||||
{ _M_stringbuf_init(__mode); }
|
||||
|
||||
explicit
|
||||
basic_stringbuf(const __string_type& __str,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
: __streambuf_type(), _M_string(__str.data(), __str.size())
|
||||
{ _M_stringbuf_init(__mode); }
|
||||
|
||||
// Get and set:
|
||||
__string_type
|
||||
str() const
|
||||
{
|
||||
if (_M_mode & ios_base::out)
|
||||
{
|
||||
// This is the deal: _M_string.size() is a value that
|
||||
// represents the size of the initial string that makes
|
||||
// _M_string, and may not be the correct size of the
|
||||
// current stringbuf internal buffer.
|
||||
__size_type __len = _M_string.size();
|
||||
if (_M_out_cur > _M_out_beg)
|
||||
__len = max(__size_type(_M_out_end - _M_out_beg), __len);
|
||||
return __string_type(_M_out_beg, _M_out_beg + __len);
|
||||
}
|
||||
else
|
||||
return _M_string;
|
||||
}
|
||||
|
||||
void
|
||||
str(const __string_type& __s)
|
||||
{
|
||||
_M_string = __s;
|
||||
_M_stringbuf_init(_M_mode);
|
||||
}
|
||||
|
||||
protected:
|
||||
// Common initialization code for both ctors goes here.
|
||||
void
|
||||
_M_stringbuf_init(ios_base::openmode __mode)
|
||||
{
|
||||
// _M_buf_size is a convenient alias for "what the streambuf
|
||||
// thinks the allocated size of the string really is." This is
|
||||
// necessary as ostringstreams are implemented with the
|
||||
// streambufs having control of the allocation and
|
||||
// re-allocation of the internal string object, _M_string.
|
||||
_M_buf_size = _M_string.size();
|
||||
|
||||
// NB: Start ostringstream buffers at 512 bytes. This is an
|
||||
// experimental value (pronounced "arbitrary" in some of the
|
||||
// hipper english-speaking countries), and can be changed to
|
||||
// suite particular needs.
|
||||
_M_buf_size_opt = 512;
|
||||
_M_mode = __mode;
|
||||
if (_M_mode & ios_base::ate)
|
||||
_M_really_sync(0, _M_buf_size);
|
||||
else
|
||||
_M_really_sync(0, 0);
|
||||
}
|
||||
|
||||
// Overridden virtual functions:
|
||||
virtual int_type
|
||||
underflow()
|
||||
{
|
||||
if (_M_in_cur && _M_in_cur < _M_in_end)
|
||||
return traits_type::to_int_type(*gptr());
|
||||
else
|
||||
return traits_type::eof();
|
||||
}
|
||||
|
||||
virtual int_type
|
||||
pbackfail(int_type __c = traits_type::eof());
|
||||
|
||||
virtual int_type
|
||||
overflow(int_type __c = traits_type::eof());
|
||||
|
||||
virtual __streambuf_type*
|
||||
setbuf(char_type* __s, streamsize __n)
|
||||
{
|
||||
if (__s && __n)
|
||||
{
|
||||
_M_string = __string_type(__s, __n);
|
||||
_M_really_sync(0, 0);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
virtual pos_type
|
||||
seekoff(off_type __off, ios_base::seekdir __way,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
|
||||
virtual pos_type
|
||||
seekpos(pos_type __sp,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out);
|
||||
|
||||
// Internal function for correctly updating the internal buffer
|
||||
// for a particular _M_string, due to initialization or
|
||||
// re-sizing of an existing _M_string.
|
||||
// Assumes: contents of _M_string and internal buffer match exactly.
|
||||
// __i == _M_in_cur - _M_in_beg
|
||||
// __o == _M_out_cur - _M_out_beg
|
||||
virtual int
|
||||
_M_really_sync(__size_type __i, __size_type __o)
|
||||
{
|
||||
char_type* __base = const_cast<char_type*>(_M_string.data());
|
||||
bool __testin = _M_mode & ios_base::in;
|
||||
bool __testout = _M_mode & ios_base::out;
|
||||
__size_type __len = _M_string.size();
|
||||
|
||||
_M_buf = __base;
|
||||
if (__testin)
|
||||
this->setg(__base, __base + __i, __base + __len);
|
||||
if (__testout)
|
||||
{
|
||||
this->setp(__base, __base + __len);
|
||||
_M_out_cur += __o;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 27.7.2 Template class basic_istringstream
|
||||
template<typename _CharT, typename _Traits, typename _Alloc>
|
||||
class basic_istringstream : public basic_istream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// 251. basic_stringbuf missing allocator_type
|
||||
typedef _Alloc allocator_type;
|
||||
#endif
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard types:
|
||||
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
|
||||
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
|
||||
typedef basic_istream<char_type, traits_type> __istream_type;
|
||||
|
||||
private:
|
||||
__stringbuf_type _M_stringbuf;
|
||||
|
||||
public:
|
||||
// Constructors:
|
||||
explicit
|
||||
basic_istringstream(ios_base::openmode __mode = ios_base::in)
|
||||
: __istream_type(NULL), _M_stringbuf(__mode | ios_base::in)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
explicit
|
||||
basic_istringstream(const __string_type& __str,
|
||||
ios_base::openmode __mode = ios_base::in)
|
||||
: __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
~basic_istringstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__stringbuf_type*
|
||||
rdbuf() const
|
||||
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
|
||||
|
||||
__string_type
|
||||
str() const
|
||||
{ return _M_stringbuf.str(); }
|
||||
|
||||
void
|
||||
str(const __string_type& __s)
|
||||
{ _M_stringbuf.str(__s); }
|
||||
};
|
||||
|
||||
|
||||
// 27.7.3 Template class basic_ostringstream
|
||||
template <typename _CharT, typename _Traits, typename _Alloc>
|
||||
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// 251. basic_stringbuf missing allocator_type
|
||||
typedef _Alloc allocator_type;
|
||||
#endif
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard types:
|
||||
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
|
||||
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
|
||||
typedef basic_ostream<char_type, traits_type> __ostream_type;
|
||||
|
||||
private:
|
||||
__stringbuf_type _M_stringbuf;
|
||||
|
||||
public:
|
||||
// Constructors/destructor:
|
||||
explicit
|
||||
basic_ostringstream(ios_base::openmode __mode = ios_base::out)
|
||||
: __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
explicit
|
||||
basic_ostringstream(const __string_type& __str,
|
||||
ios_base::openmode __mode = ios_base::out)
|
||||
: __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
~basic_ostringstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__stringbuf_type*
|
||||
rdbuf() const
|
||||
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
|
||||
|
||||
__string_type
|
||||
str() const
|
||||
{ return _M_stringbuf.str(); }
|
||||
|
||||
void
|
||||
str(const __string_type& __s)
|
||||
{ _M_stringbuf.str(__s); }
|
||||
};
|
||||
|
||||
|
||||
// 27.7.4 Template class basic_stringstream
|
||||
template <typename _CharT, typename _Traits, typename _Alloc>
|
||||
class basic_stringstream : public basic_iostream<_CharT, _Traits>
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// 251. basic_stringbuf missing allocator_type
|
||||
typedef _Alloc allocator_type;
|
||||
#endif
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
|
||||
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
|
||||
typedef basic_iostream<char_type, traits_type> __iostream_type;
|
||||
|
||||
private:
|
||||
__stringbuf_type _M_stringbuf;
|
||||
|
||||
public:
|
||||
// Constructors/destructors
|
||||
explicit
|
||||
basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
|
||||
: __iostream_type(NULL), _M_stringbuf(__m)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
explicit
|
||||
basic_stringstream(const __string_type& __str,
|
||||
ios_base::openmode __m = ios_base::out | ios_base::in)
|
||||
: __iostream_type(NULL), _M_stringbuf(__str, __m)
|
||||
{ this->init(&_M_stringbuf); }
|
||||
|
||||
~basic_stringstream()
|
||||
{ }
|
||||
|
||||
// Members:
|
||||
__stringbuf_type*
|
||||
rdbuf() const
|
||||
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
|
||||
|
||||
__string_type
|
||||
str() const
|
||||
{ return _M_stringbuf.str(); }
|
||||
|
||||
void
|
||||
str(const __string_type& __s)
|
||||
{ _M_stringbuf.str(__s); }
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
|
||||
# include <bits/sstream.tcc>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // _CPP_SSTREAM
|
|
@ -1,77 +0,0 @@
|
|||
// <stack> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_stack.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_STACK
|
||||
#define _CPP_STACK 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_deque.h>
|
||||
#include <bits/stl_stack.h>
|
||||
|
||||
#endif /* _CPP_STACK */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,150 +0,0 @@
|
|||
// Standard exception classes -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 19.1 Exception classes
|
||||
//
|
||||
|
||||
/** @file std_stdexcept.h
|
||||
* The Standard C++ library provides classes to be used to report certain
|
||||
* errors (17.4.4.8) in C++ programs. In the error model reflected in these
|
||||
* classes, errors are divided into two broad categories: logic errors and
|
||||
* runtime errors.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_STDEXCEPT
|
||||
#define _CPP_STDEXCEPT 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace std
|
||||
{
|
||||
/** Logic errors represent problems in the internal logic of a program;
|
||||
* in theory, these are preventable, and even detectable before the
|
||||
* program runs (e.g., violations of class invariants).
|
||||
* @brief One of two subclasses of exception.
|
||||
*/
|
||||
class logic_error : public exception
|
||||
{
|
||||
string _M_msg;
|
||||
|
||||
public:
|
||||
/** Takes a character string describing the error. */
|
||||
explicit
|
||||
logic_error(const string& __arg);
|
||||
|
||||
virtual
|
||||
~logic_error() throw();
|
||||
|
||||
/** Returns a C-style character string describing the general cause of
|
||||
* the current error (the same string passed to the ctor). */
|
||||
virtual const char*
|
||||
what() const throw();
|
||||
};
|
||||
|
||||
/** Thrown by the library, or by you, to report domain errors (domain in
|
||||
* the mathmatical sense). */
|
||||
class domain_error : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit domain_error(const string& __arg);
|
||||
};
|
||||
|
||||
/** Thrown to report invalid arguments to functions. */
|
||||
class invalid_argument : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit invalid_argument(const string& __arg);
|
||||
};
|
||||
|
||||
/** Thrown when an object is constructed that would exceed its maximum
|
||||
* permitted size (e.g., a basic_string instance). */
|
||||
class length_error : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit length_error(const string& __arg);
|
||||
};
|
||||
|
||||
/** This represents an argument whose value is not within the expected
|
||||
* range (e.g., boundary checks in basic_string). */
|
||||
class out_of_range : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit out_of_range(const string& __arg);
|
||||
};
|
||||
|
||||
/** Runtime errors represent problems outside the scope of a program;
|
||||
* they cannot be easily predicted and can generally only be caught as
|
||||
* the program executes.
|
||||
* @brief One of two subclasses of exception.
|
||||
*/
|
||||
class runtime_error : public exception
|
||||
{
|
||||
string _M_msg;
|
||||
|
||||
public:
|
||||
/** Takes a character string describing the error. */
|
||||
explicit
|
||||
runtime_error(const string& __arg);
|
||||
|
||||
virtual
|
||||
~runtime_error() throw();
|
||||
|
||||
/** Returns a C-style character string describing the general cause of
|
||||
* the current error (the same string passed to the ctor). */
|
||||
virtual const char*
|
||||
what() const throw();
|
||||
};
|
||||
|
||||
/** Thrown to indicate range errors in internal computations. */
|
||||
class range_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit range_error(const string& __arg);
|
||||
};
|
||||
|
||||
/** Thrown to indicate arithmetic overflow. */
|
||||
class overflow_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit overflow_error(const string& __arg);
|
||||
};
|
||||
|
||||
/** Thrown to indicate arithmetic underflow. */
|
||||
class underflow_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit underflow_error(const string& __arg);
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_STDEXCEPT
|
|
@ -1,540 +0,0 @@
|
|||
// Stream buffer classes -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 27.5 Stream buffers
|
||||
//
|
||||
|
||||
/** @file std_streambuf.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_STREAMBUF
|
||||
#define _CPP_STREAMBUF 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_iosfwd.h>
|
||||
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
|
||||
#include <bits/localefwd.h>
|
||||
#include <bits/ios_base.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<typename _CharT, typename _Traits>
|
||||
streamsize
|
||||
__copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
|
||||
basic_streambuf<_CharT, _Traits>* __sbin,
|
||||
basic_streambuf<_CharT, _Traits>* __sbout);
|
||||
|
||||
// 27.5.2 Template class basic_streambuf<_CharT, _Traits>
|
||||
template<typename _CharT, typename _Traits>
|
||||
class basic_streambuf
|
||||
{
|
||||
public:
|
||||
// Types:
|
||||
typedef _CharT char_type;
|
||||
typedef _Traits traits_type;
|
||||
typedef typename traits_type::int_type int_type;
|
||||
typedef typename traits_type::pos_type pos_type;
|
||||
typedef typename traits_type::off_type off_type;
|
||||
|
||||
// Non-standard Types:
|
||||
typedef ctype<char_type> __ctype_type;
|
||||
typedef basic_streambuf<char_type, traits_type> __streambuf_type;
|
||||
|
||||
friend class basic_ios<char_type, traits_type>;
|
||||
friend class basic_istream<char_type, traits_type>;
|
||||
friend class basic_ostream<char_type, traits_type>;
|
||||
friend class istreambuf_iterator<char_type, traits_type>;
|
||||
friend class ostreambuf_iterator<char_type, traits_type>;
|
||||
|
||||
friend streamsize
|
||||
__copy_streambufs<>(basic_ios<char_type, traits_type>& __ios,
|
||||
__streambuf_type* __sbin,__streambuf_type* __sbout);
|
||||
|
||||
protected:
|
||||
|
||||
// Pointer to the beginning of internally-allocated
|
||||
// space. Filebuf manually allocates/deallocates this, whereas
|
||||
// stringstreams attempt to use the built-in intelligence of the
|
||||
// string class. If you are managing memory, set this. If not,
|
||||
// leave it NULL.
|
||||
char_type* _M_buf;
|
||||
|
||||
// Actual size of allocated internal buffer, in bytes.
|
||||
int_type _M_buf_size;
|
||||
|
||||
// Optimal or preferred size of internal buffer, in bytes.
|
||||
int_type _M_buf_size_opt;
|
||||
|
||||
// True iff _M_in_* and _M_out_* buffers should always point to
|
||||
// the same place. True for fstreams, false for sstreams.
|
||||
bool _M_buf_unified;
|
||||
|
||||
// This is based on _IO_FILE, just reordered to be more
|
||||
// consistent, and is intended to be the most minimal abstraction
|
||||
// for an internal buffer.
|
||||
// get == input == read
|
||||
// put == output == write
|
||||
char_type* _M_in_beg; // Start of get area.
|
||||
char_type* _M_in_cur; // Current read area.
|
||||
char_type* _M_in_end; // End of get area.
|
||||
char_type* _M_out_beg; // Start of put area.
|
||||
char_type* _M_out_cur; // Current put area.
|
||||
char_type* _M_out_end; // End of put area.
|
||||
|
||||
// Place to stash in || out || in | out settings for current streambuf.
|
||||
ios_base::openmode _M_mode;
|
||||
|
||||
// Current locale setting.
|
||||
locale _M_buf_locale;
|
||||
|
||||
// True iff locale is initialized.
|
||||
bool _M_buf_locale_init;
|
||||
|
||||
// Necessary bits for putback buffer management. Only used in
|
||||
// the basic_filebuf class, as necessary for the standard
|
||||
// requirements. The only basic_streambuf member function that
|
||||
// needs access to these data members is in_avail...
|
||||
// NB: pbacks of over one character are not currently supported.
|
||||
int_type _M_pback_size;
|
||||
char_type* _M_pback;
|
||||
char_type* _M_pback_cur_save;
|
||||
char_type* _M_pback_end_save;
|
||||
bool _M_pback_init;
|
||||
|
||||
// Initializes pback buffers, and moves normal buffers to safety.
|
||||
// Assumptions:
|
||||
// _M_in_cur has already been moved back
|
||||
void
|
||||
_M_pback_create()
|
||||
{
|
||||
if (!_M_pback_init)
|
||||
{
|
||||
int_type __dist = _M_in_end - _M_in_cur;
|
||||
int_type __len = min(_M_pback_size, __dist);
|
||||
traits_type::copy(_M_pback, _M_in_cur, __len);
|
||||
_M_pback_cur_save = _M_in_cur;
|
||||
_M_pback_end_save = _M_in_end;
|
||||
this->setg(_M_pback, _M_pback, _M_pback + __len);
|
||||
_M_pback_init = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Deactivates pback buffer contents, and restores normal buffer.
|
||||
// Assumptions:
|
||||
// The pback buffer has only moved forward.
|
||||
void
|
||||
_M_pback_destroy()
|
||||
{
|
||||
if (_M_pback_init)
|
||||
{
|
||||
// Length _M_in_cur moved in the pback buffer.
|
||||
int_type __off_cur = _M_in_cur - _M_pback;
|
||||
|
||||
// For in | out buffers, the end can be pushed back...
|
||||
int_type __off_end = 0;
|
||||
int_type __pback_len = _M_in_end - _M_pback;
|
||||
int_type __save_len = _M_pback_end_save - _M_buf;
|
||||
if (__pback_len > __save_len)
|
||||
__off_end = __pback_len - __save_len;
|
||||
|
||||
this->setg(_M_buf, _M_pback_cur_save + __off_cur,
|
||||
_M_pback_end_save + __off_end);
|
||||
_M_pback_cur_save = NULL;
|
||||
_M_pback_end_save = NULL;
|
||||
_M_pback_init = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Correctly sets the _M_in_cur pointer, and bumps the
|
||||
// _M_out_cur pointer as well if necessary.
|
||||
void
|
||||
_M_in_cur_move(off_type __n) // argument needs to be +-
|
||||
{
|
||||
bool __testout = _M_out_cur;
|
||||
_M_in_cur += __n;
|
||||
if (__testout && _M_buf_unified)
|
||||
_M_out_cur += __n;
|
||||
}
|
||||
|
||||
// Correctly sets the _M_out_cur pointer, and bumps the
|
||||
// appropriate _M_*_end pointers as well. Necessary for the
|
||||
// un-tied stringbufs, in in|out mode.
|
||||
// Invariant:
|
||||
// __n + _M_out_[cur, end] <= _M_buf + _M_buf_size
|
||||
// Assuming all _M_*_[beg, cur, end] pointers are operating on
|
||||
// the same range:
|
||||
// _M_buf <= _M_*_ <= _M_buf + _M_buf_size
|
||||
void
|
||||
_M_out_cur_move(off_type __n) // argument needs to be +-
|
||||
{
|
||||
bool __testin = _M_in_cur;
|
||||
|
||||
_M_out_cur += __n;
|
||||
if (__testin && _M_buf_unified)
|
||||
_M_in_cur += __n;
|
||||
if (_M_out_cur > _M_out_end)
|
||||
{
|
||||
_M_out_end = _M_out_cur;
|
||||
// NB: in | out buffers drag the _M_in_end pointer along...
|
||||
if (__testin)
|
||||
_M_in_end += __n;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the size of the output buffer. This depends on the
|
||||
// buffer in use: allocated buffers have a stored size in
|
||||
// _M_buf_size and setbuf() buffers don't.
|
||||
off_type
|
||||
_M_out_buf_size()
|
||||
{
|
||||
off_type __ret = 0;
|
||||
if (_M_out_cur)
|
||||
{
|
||||
// Using allocated buffer.
|
||||
if (_M_out_beg == _M_buf)
|
||||
__ret = _M_out_beg + _M_buf_size - _M_out_cur;
|
||||
// Using non-allocated buffer.
|
||||
else
|
||||
__ret = _M_out_end - _M_out_cur;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
// These three functions are used to clarify internal buffer
|
||||
// maintenance. After an overflow, or after a seekoff call that
|
||||
// started at beg or end, or possibly when the stream becomes
|
||||
// unbuffered, and a myrid other obscure corner cases, the
|
||||
// internal buffer does not truly reflect the contents of the
|
||||
// external buffer. At this point, for whatever reason, it is in
|
||||
// an indeterminate state.
|
||||
void
|
||||
_M_set_indeterminate(void)
|
||||
{
|
||||
if (_M_mode & ios_base::in)
|
||||
this->setg(_M_buf, _M_buf, _M_buf);
|
||||
if (_M_mode & ios_base::out)
|
||||
this->setp(_M_buf, _M_buf);
|
||||
}
|
||||
|
||||
void
|
||||
_M_set_determinate(off_type __off)
|
||||
{
|
||||
bool __testin = _M_mode & ios_base::in;
|
||||
bool __testout = _M_mode & ios_base::out;
|
||||
if (__testin)
|
||||
this->setg(_M_buf, _M_buf, _M_buf + __off);
|
||||
if (__testout)
|
||||
this->setp(_M_buf, _M_buf + __off);
|
||||
}
|
||||
|
||||
bool
|
||||
_M_is_indeterminate(void)
|
||||
{
|
||||
bool __ret = false;
|
||||
// Don't return true if unbuffered.
|
||||
if (_M_buf)
|
||||
{
|
||||
if (_M_mode & ios_base::in)
|
||||
__ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
|
||||
if (_M_mode & ios_base::out)
|
||||
__ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual
|
||||
~basic_streambuf()
|
||||
{
|
||||
_M_buf_unified = false;
|
||||
_M_buf_size = 0;
|
||||
_M_buf_size_opt = 0;
|
||||
_M_mode = ios_base::openmode(0);
|
||||
_M_buf_locale_init = false;
|
||||
}
|
||||
|
||||
// Locales:
|
||||
locale
|
||||
pubimbue(const locale &__loc)
|
||||
{
|
||||
locale __tmp(this->getloc());
|
||||
this->imbue(__loc);
|
||||
return __tmp;
|
||||
}
|
||||
|
||||
locale
|
||||
getloc() const
|
||||
{
|
||||
if (_M_buf_locale_init)
|
||||
return _M_buf_locale;
|
||||
else
|
||||
return locale();
|
||||
}
|
||||
|
||||
// Buffer and positioning:
|
||||
__streambuf_type*
|
||||
pubsetbuf(char_type* __s, streamsize __n)
|
||||
{ return this->setbuf(__s, __n); }
|
||||
|
||||
pos_type
|
||||
pubseekoff(off_type __off, ios_base::seekdir __way,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
{ return this->seekoff(__off, __way, __mode); }
|
||||
|
||||
pos_type
|
||||
pubseekpos(pos_type __sp,
|
||||
ios_base::openmode __mode = ios_base::in | ios_base::out)
|
||||
{ return this->seekpos(__sp, __mode); }
|
||||
|
||||
int
|
||||
pubsync() { return this->sync(); }
|
||||
|
||||
// Get and put areas:
|
||||
// Get area:
|
||||
streamsize
|
||||
in_avail()
|
||||
{
|
||||
streamsize __ret;
|
||||
if (_M_in_cur && _M_in_cur < _M_in_end)
|
||||
{
|
||||
if (_M_pback_init)
|
||||
{
|
||||
int_type __save_len = _M_pback_end_save - _M_pback_cur_save;
|
||||
int_type __pback_len = _M_in_cur - _M_pback;
|
||||
__ret = __save_len - __pback_len;
|
||||
}
|
||||
else
|
||||
__ret = this->egptr() - this->gptr();
|
||||
}
|
||||
else
|
||||
__ret = this->showmanyc();
|
||||
return __ret;
|
||||
}
|
||||
|
||||
int_type
|
||||
snextc()
|
||||
{
|
||||
int_type __eof = traits_type::eof();
|
||||
return (this->sbumpc() == __eof ? __eof : this->sgetc());
|
||||
}
|
||||
|
||||
int_type
|
||||
sbumpc();
|
||||
|
||||
int_type
|
||||
sgetc()
|
||||
{
|
||||
int_type __ret;
|
||||
if (_M_in_cur && _M_in_cur < _M_in_end)
|
||||
__ret = traits_type::to_int_type(*(this->gptr()));
|
||||
else
|
||||
__ret = this->underflow();
|
||||
return __ret;
|
||||
}
|
||||
|
||||
streamsize
|
||||
sgetn(char_type* __s, streamsize __n)
|
||||
{ return this->xsgetn(__s, __n); }
|
||||
|
||||
// Putback:
|
||||
int_type
|
||||
sputbackc(char_type __c);
|
||||
|
||||
int_type
|
||||
sungetc();
|
||||
|
||||
// Put area:
|
||||
int_type
|
||||
sputc(char_type __c);
|
||||
|
||||
streamsize
|
||||
sputn(const char_type* __s, streamsize __n)
|
||||
{ return this->xsputn(__s, __n); }
|
||||
|
||||
protected:
|
||||
basic_streambuf()
|
||||
: _M_buf(NULL), _M_buf_size(0),
|
||||
_M_buf_size_opt(static_cast<int_type>(BUFSIZ)), _M_buf_unified(false),
|
||||
_M_in_beg(0), _M_in_cur(0), _M_in_end(0), _M_out_beg(0), _M_out_cur(0),
|
||||
_M_out_end(0), _M_mode(ios_base::openmode(0)), _M_buf_locale(locale()),
|
||||
_M_buf_locale_init(false), _M_pback_size(1), _M_pback(NULL),
|
||||
_M_pback_cur_save(NULL), _M_pback_end_save(NULL), _M_pback_init(false)
|
||||
{ }
|
||||
|
||||
// Get area:
|
||||
char_type*
|
||||
eback() const { return _M_in_beg; }
|
||||
|
||||
char_type*
|
||||
gptr() const { return _M_in_cur; }
|
||||
|
||||
char_type*
|
||||
egptr() const { return _M_in_end; }
|
||||
|
||||
void
|
||||
gbump(int __n) { _M_in_cur += __n; }
|
||||
|
||||
void
|
||||
setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
|
||||
{
|
||||
_M_in_beg = __gbeg;
|
||||
_M_in_cur = __gnext;
|
||||
_M_in_end = __gend;
|
||||
if (!(_M_mode & ios_base::in) && __gbeg && __gnext && __gend)
|
||||
_M_mode = _M_mode | ios_base::in;
|
||||
}
|
||||
|
||||
// Put area:
|
||||
char_type*
|
||||
pbase() const { return _M_out_beg; }
|
||||
|
||||
char_type*
|
||||
pptr() const { return _M_out_cur; }
|
||||
|
||||
char_type*
|
||||
epptr() const { return _M_out_end; }
|
||||
|
||||
void
|
||||
pbump(int __n) { _M_out_cur += __n; }
|
||||
|
||||
void
|
||||
setp(char_type* __pbeg, char_type* __pend)
|
||||
{
|
||||
_M_out_beg = _M_out_cur = __pbeg;
|
||||
_M_out_end = __pend;
|
||||
if (!(_M_mode & ios_base::out) && __pbeg && __pend)
|
||||
_M_mode = _M_mode | ios_base::out;
|
||||
}
|
||||
|
||||
// Virtual functions:
|
||||
// Locales:
|
||||
virtual void
|
||||
imbue(const locale& __loc)
|
||||
{
|
||||
_M_buf_locale_init = true;
|
||||
if (_M_buf_locale != __loc)
|
||||
_M_buf_locale = __loc;
|
||||
}
|
||||
|
||||
// Buffer management and positioning:
|
||||
virtual basic_streambuf<char_type,_Traits>*
|
||||
setbuf(char_type*, streamsize)
|
||||
{ return this; }
|
||||
|
||||
virtual pos_type
|
||||
seekoff(off_type, ios_base::seekdir,
|
||||
ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
|
||||
{ return pos_type(off_type(-1)); }
|
||||
|
||||
virtual pos_type
|
||||
seekpos(pos_type,
|
||||
ios_base::openmode /*__mode*/ = ios_base::in | ios_base::out)
|
||||
{ return pos_type(off_type(-1)); }
|
||||
|
||||
virtual int
|
||||
sync() { return 0; }
|
||||
|
||||
// Get area:
|
||||
virtual streamsize
|
||||
showmanyc() { return 0; }
|
||||
|
||||
virtual streamsize
|
||||
xsgetn(char_type* __s, streamsize __n);
|
||||
|
||||
virtual int_type
|
||||
underflow()
|
||||
{ return traits_type::eof(); }
|
||||
|
||||
virtual int_type
|
||||
uflow()
|
||||
{
|
||||
int_type __ret = traits_type::eof();
|
||||
bool __testeof = this->underflow() == __ret;
|
||||
bool __testpending = _M_in_cur && _M_in_cur < _M_in_end;
|
||||
if (!__testeof && __testpending)
|
||||
{
|
||||
__ret = traits_type::to_int_type(*_M_in_cur);
|
||||
++_M_in_cur;
|
||||
if (_M_buf_unified && _M_mode & ios_base::out)
|
||||
++_M_out_cur;
|
||||
}
|
||||
return __ret;
|
||||
}
|
||||
|
||||
// Putback:
|
||||
virtual int_type
|
||||
pbackfail(int_type /* __c */ = traits_type::eof())
|
||||
{ return traits_type::eof(); }
|
||||
|
||||
// Put area:
|
||||
virtual streamsize
|
||||
xsputn(const char_type* __s, streamsize __n);
|
||||
|
||||
virtual int_type
|
||||
overflow(int_type /* __c */ = traits_type::eof())
|
||||
{ return traits_type::eof(); }
|
||||
|
||||
#ifdef _GLIBCPP_DEPRECATED
|
||||
public:
|
||||
void
|
||||
stossc()
|
||||
{
|
||||
if (_M_in_cur < _M_in_end)
|
||||
++_M_in_cur;
|
||||
else
|
||||
this->uflow();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// Side effect of DR 50.
|
||||
private:
|
||||
basic_streambuf(const __streambuf_type&);
|
||||
|
||||
__streambuf_type&
|
||||
operator=(const __streambuf_type&);
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
|
||||
#include <bits/streambuf.tcc>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _CPP_STREAMBUF */
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
// Components for manipulating sequences of characters -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 21 Strings library
|
||||
//
|
||||
|
||||
/** @file std_string.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_STRING
|
||||
#define _CPP_STRING 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/stringfwd.h>
|
||||
#include <bits/char_traits.h>
|
||||
#include <bits/std_memory.h> // For allocator.
|
||||
#include <bits/type_traits.h>
|
||||
#include <bits/std_iosfwd.h> // For operators >>, <<, and getline decls.
|
||||
#include <bits/stl_iterator.h>
|
||||
#include <bits/stl_function.h> // For less
|
||||
#include <bits/basic_string.h>
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# include <bits/std_algorithm.h> // for find_if
|
||||
# include <bits/basic_string.tcc>
|
||||
#endif
|
||||
|
||||
#endif /* _CPP_STRING */
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
// <utility> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996,1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_utility.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_UTILITY
|
||||
#define _CPP_UTILITY 1
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/stl_relops.h>
|
||||
#include <bits/stl_pair.h>
|
||||
|
||||
#endif /* _CPP_UTILITY */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,742 +0,0 @@
|
|||
// The template and inlines for the -*- C++ -*- valarray class.
|
||||
|
||||
// Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
|
||||
|
||||
/** @file std_valarray.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_VALARRAY
|
||||
#define _CPP_VALARRAY 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <bits/std_cmath.h>
|
||||
#include <bits/std_cstdlib.h>
|
||||
#include <bits/std_numeric.h>
|
||||
#include <bits/std_functional.h>
|
||||
#include <bits/std_algorithm.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<class _Clos, typename _Tp> class _Expr;
|
||||
|
||||
template<typename _Tp1, typename _Tp2> class _ValArray;
|
||||
|
||||
template<template<class> class _Oper,
|
||||
template<class, class> class _Meta, class _Dom> struct _UnClos;
|
||||
|
||||
template<template<class> class _Oper,
|
||||
template<class, class> class _Meta1,
|
||||
template<class, class> class _Meta2,
|
||||
class _Dom1, class _Dom2> class _BinClos;
|
||||
|
||||
template<template<class, class> class _Meta, class _Dom> class _SClos;
|
||||
|
||||
template<template<class, class> class _Meta, class _Dom> class _GClos;
|
||||
|
||||
template<template<class, class> class _Meta, class _Dom> class _IClos;
|
||||
|
||||
template<template<class, class> class _Meta, class _Dom> class _ValFunClos;
|
||||
|
||||
template<template<class, class> class _Meta, class _Dom> class _RefFunClos;
|
||||
|
||||
template<class _Tp> struct _Unary_plus;
|
||||
template<class _Tp> struct _Bitwise_and;
|
||||
template<class _Tp> struct _Bitwise_or;
|
||||
template<class _Tp> struct _Bitwise_xor;
|
||||
template<class _Tp> struct _Bitwise_not;
|
||||
template<class _Tp> struct _Shift_left;
|
||||
template<class _Tp> struct _Shift_right;
|
||||
|
||||
template<class _Tp> class valarray; // An array of type _Tp
|
||||
class slice; // BLAS-like slice out of an array
|
||||
template<class _Tp> class slice_array;
|
||||
class gslice; // generalized slice out of an array
|
||||
template<class _Tp> class gslice_array;
|
||||
template<class _Tp> class mask_array; // masked array
|
||||
template<class _Tp> class indirect_array; // indirected array
|
||||
|
||||
} // namespace std
|
||||
|
||||
#include <bits/valarray_array.h>
|
||||
#include <bits/valarray_meta.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<class _Tp> class valarray
|
||||
{
|
||||
public:
|
||||
typedef _Tp value_type;
|
||||
|
||||
// _lib.valarray.cons_ construct/destroy:
|
||||
valarray();
|
||||
explicit valarray(size_t);
|
||||
valarray(const _Tp&, size_t);
|
||||
valarray(const _Tp* __restrict__, size_t);
|
||||
valarray(const valarray&);
|
||||
valarray(const slice_array<_Tp>&);
|
||||
valarray(const gslice_array<_Tp>&);
|
||||
valarray(const mask_array<_Tp>&);
|
||||
valarray(const indirect_array<_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray(const _Expr<_Dom,_Tp>& __e);
|
||||
~valarray();
|
||||
|
||||
// _lib.valarray.assign_ assignment:
|
||||
valarray<_Tp>& operator=(const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator=(const _Tp&);
|
||||
valarray<_Tp>& operator=(const slice_array<_Tp>&);
|
||||
valarray<_Tp>& operator=(const gslice_array<_Tp>&);
|
||||
valarray<_Tp>& operator=(const mask_array<_Tp>&);
|
||||
valarray<_Tp>& operator=(const indirect_array<_Tp>&);
|
||||
|
||||
template<class _Dom> valarray<_Tp>&
|
||||
operator= (const _Expr<_Dom,_Tp>&);
|
||||
|
||||
// _lib.valarray.access_ element access:
|
||||
// XXX: LWG to be resolved.
|
||||
const _Tp& operator[](size_t) const;
|
||||
_Tp& operator[](size_t);
|
||||
// _lib.valarray.sub_ subset operations:
|
||||
_Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const;
|
||||
slice_array<_Tp> operator[](slice);
|
||||
_Expr<_GClos<_ValArray,_Tp>, _Tp> operator[](const gslice&) const;
|
||||
gslice_array<_Tp> operator[](const gslice&);
|
||||
valarray<_Tp> operator[](const valarray<bool>&) const;
|
||||
mask_array<_Tp> operator[](const valarray<bool>&);
|
||||
_Expr<_IClos<_ValArray, _Tp>, _Tp>
|
||||
operator[](const valarray<size_t>&) const;
|
||||
indirect_array<_Tp> operator[](const valarray<size_t>&);
|
||||
|
||||
// _lib.valarray.unary_ unary operators:
|
||||
_Expr<_UnClos<_Unary_plus,_ValArray,_Tp>,_Tp> operator+ () const;
|
||||
_Expr<_UnClos<negate,_ValArray,_Tp>,_Tp> operator- () const;
|
||||
_Expr<_UnClos<_Bitwise_not,_ValArray,_Tp>,_Tp> operator~ () const;
|
||||
_Expr<_UnClos<logical_not,_ValArray,_Tp>,bool> operator! () const;
|
||||
|
||||
// _lib.valarray.cassign_ computed assignment:
|
||||
valarray<_Tp>& operator*= (const _Tp&);
|
||||
valarray<_Tp>& operator/= (const _Tp&);
|
||||
valarray<_Tp>& operator%= (const _Tp&);
|
||||
valarray<_Tp>& operator+= (const _Tp&);
|
||||
valarray<_Tp>& operator-= (const _Tp&);
|
||||
valarray<_Tp>& operator^= (const _Tp&);
|
||||
valarray<_Tp>& operator&= (const _Tp&);
|
||||
valarray<_Tp>& operator|= (const _Tp&);
|
||||
valarray<_Tp>& operator<<=(const _Tp&);
|
||||
valarray<_Tp>& operator>>=(const _Tp&);
|
||||
valarray<_Tp>& operator*= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator/= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator%= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator+= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator-= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator^= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator|= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator&= (const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator<<=(const valarray<_Tp>&);
|
||||
valarray<_Tp>& operator>>=(const valarray<_Tp>&);
|
||||
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator*= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator/= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator%= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator+= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator-= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator^= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator|= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator&= (const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator<<=(const _Expr<_Dom,_Tp>&);
|
||||
template<class _Dom>
|
||||
valarray<_Tp>& operator>>=(const _Expr<_Dom,_Tp>&);
|
||||
|
||||
|
||||
// _lib.valarray.members_ member functions:
|
||||
size_t size() const;
|
||||
_Tp sum() const;
|
||||
_Tp min() const;
|
||||
_Tp max() const;
|
||||
|
||||
// // FIXME: Extension
|
||||
// _Tp product () const;
|
||||
|
||||
valarray<_Tp> shift (int) const;
|
||||
valarray<_Tp> cshift(int) const;
|
||||
_Expr<_ValFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(_Tp)) const;
|
||||
_Expr<_RefFunClos<_ValArray,_Tp>,_Tp> apply(_Tp func(const _Tp&)) const;
|
||||
void resize(size_t __size, _Tp __c = _Tp());
|
||||
|
||||
private:
|
||||
size_t _M_size;
|
||||
_Tp* __restrict__ _M_data;
|
||||
|
||||
friend class _Array<_Tp>;
|
||||
};
|
||||
|
||||
|
||||
template<typename _Tp> struct _Unary_plus : unary_function<_Tp,_Tp> {
|
||||
_Tp operator() (const _Tp& __t) const { return __t; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Bitwise_and : binary_function<_Tp,_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __x, _Tp __y) const { return __x & __y; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Bitwise_or : binary_function<_Tp,_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __x, _Tp __y) const { return __x | __y; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Bitwise_xor : binary_function<_Tp,_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __x, _Tp __y) const { return __x ^ __y; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Bitwise_not : unary_function<_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __t) const { return ~__t; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Shift_left : unary_function<_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __x, _Tp __y) const { return __x << __y; }
|
||||
};
|
||||
|
||||
template<typename _Tp> struct _Shift_right : unary_function<_Tp,_Tp> {
|
||||
_Tp operator() (_Tp __x, _Tp __y) const { return __x >> __y; }
|
||||
};
|
||||
|
||||
|
||||
template<typename _Tp>
|
||||
inline const _Tp&
|
||||
valarray<_Tp>::operator[] (size_t __i) const
|
||||
{ return _M_data[__i]; }
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Tp&
|
||||
valarray<_Tp>::operator[] (size_t __i)
|
||||
{ return _M_data[__i]; }
|
||||
|
||||
} // std::
|
||||
|
||||
#include <bits/slice.h>
|
||||
#include <bits/slice_array.h>
|
||||
#include <bits/gslice.h>
|
||||
#include <bits/gslice_array.h>
|
||||
#include <bits/mask_array.h>
|
||||
#include <bits/indirect_array.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (size_t __n)
|
||||
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
|
||||
{ __valarray_default_construct(_M_data, _M_data + __n); }
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const _Tp& __t, size_t __n)
|
||||
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
|
||||
{ __valarray_fill_construct (_M_data, _M_data + __n, __t); }
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const _Tp* __restrict__ __p, size_t __n)
|
||||
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
|
||||
{ __valarray_copy_construct (__p, __p + __n, _M_data); }
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
|
||||
: _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
|
||||
{ __valarray_copy_construct (__v._M_data, __v._M_data + _M_size, _M_data); }
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const slice_array<_Tp>& __sa)
|
||||
: _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz))
|
||||
{
|
||||
__valarray_copy
|
||||
(__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const gslice_array<_Tp>& __ga)
|
||||
: _M_size(__ga._M_index.size()),
|
||||
_M_data(__valarray_get_storage<_Tp>(_M_size))
|
||||
{
|
||||
__valarray_copy
|
||||
(__ga._M_array, _Array<size_t>(__ga._M_index),
|
||||
_Array<_Tp>(_M_data), _M_size);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const mask_array<_Tp>& __ma)
|
||||
: _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz))
|
||||
{
|
||||
__valarray_copy
|
||||
(__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::valarray (const indirect_array<_Tp>& __ia)
|
||||
: _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz))
|
||||
{
|
||||
__valarray_copy
|
||||
(__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
|
||||
}
|
||||
|
||||
template<typename _Tp> template<class _Dom>
|
||||
inline valarray<_Tp>::valarray (const _Expr<_Dom, _Tp>& __e)
|
||||
: _M_size(__e.size ()), _M_data(__valarray_get_storage<_Tp>(_M_size))
|
||||
{ __valarray_copy (__e, _M_size, _Array<_Tp>(_M_data)); }
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>::~valarray ()
|
||||
{
|
||||
__valarray_destroy_elements(_M_data, _M_data + _M_size);
|
||||
__valarray_release_memory(_M_data);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const valarray<_Tp>& __v)
|
||||
{
|
||||
__valarray_copy(__v._M_data, _M_size, _M_data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const _Tp& __t)
|
||||
{
|
||||
__valarray_fill (_M_data, _M_size, __t);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const slice_array<_Tp>& __sa)
|
||||
{
|
||||
__valarray_copy (__sa._M_array, __sa._M_sz,
|
||||
__sa._M_stride, _Array<_Tp>(_M_data));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const gslice_array<_Tp>& __ga)
|
||||
{
|
||||
__valarray_copy (__ga._M_array, _Array<size_t>(__ga._M_index),
|
||||
_Array<_Tp>(_M_data), _M_size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const mask_array<_Tp>& __ma)
|
||||
{
|
||||
__valarray_copy (__ma._M_array, __ma._M_mask,
|
||||
_Array<_Tp>(_M_data), _M_size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const indirect_array<_Tp>& __ia)
|
||||
{
|
||||
__valarray_copy (__ia._M_array, __ia._M_index,
|
||||
_Array<_Tp>(_M_data), _M_size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> template<class _Dom>
|
||||
inline valarray<_Tp>&
|
||||
valarray<_Tp>::operator= (const _Expr<_Dom, _Tp>& __e)
|
||||
{
|
||||
__valarray_copy (__e, _M_size, _Array<_Tp>(_M_data));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Expr<_SClos<_ValArray,_Tp>, _Tp>
|
||||
valarray<_Tp>::operator[] (slice __s) const
|
||||
{
|
||||
typedef _SClos<_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure, _Tp> (_Closure (_Array<_Tp>(_M_data), __s));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline slice_array<_Tp>
|
||||
valarray<_Tp>::operator[] (slice __s)
|
||||
{
|
||||
return slice_array<_Tp> (_Array<_Tp>(_M_data), __s);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Expr<_GClos<_ValArray,_Tp>, _Tp>
|
||||
valarray<_Tp>::operator[] (const gslice& __gs) const
|
||||
{
|
||||
typedef _GClos<_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure, _Tp>
|
||||
(_Closure (_Array<_Tp>(_M_data), __gs._M_index->_M_index));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline gslice_array<_Tp>
|
||||
valarray<_Tp>::operator[] (const gslice& __gs)
|
||||
{
|
||||
return gslice_array<_Tp>
|
||||
(_Array<_Tp>(_M_data), __gs._M_index->_M_index);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline valarray<_Tp>
|
||||
valarray<_Tp>::operator[] (const valarray<bool>& __m) const
|
||||
{
|
||||
size_t __s (0);
|
||||
size_t __e (__m.size ());
|
||||
for (size_t __i=0; __i<__e; ++__i)
|
||||
if (__m[__i]) ++__s;
|
||||
return valarray<_Tp> (mask_array<_Tp> (_Array<_Tp>(_M_data), __s,
|
||||
_Array<bool> (__m)));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline mask_array<_Tp>
|
||||
valarray<_Tp>::operator[] (const valarray<bool>& __m)
|
||||
{
|
||||
size_t __s (0);
|
||||
size_t __e (__m.size ());
|
||||
for (size_t __i=0; __i<__e; ++__i)
|
||||
if (__m[__i]) ++__s;
|
||||
return mask_array<_Tp> (_Array<_Tp>(_M_data), __s, _Array<bool> (__m));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Expr<_IClos<_ValArray,_Tp>, _Tp>
|
||||
valarray<_Tp>::operator[] (const valarray<size_t>& __i) const
|
||||
{
|
||||
typedef _IClos<_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure, _Tp> (_Closure (*this, __i));
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline indirect_array<_Tp>
|
||||
valarray<_Tp>::operator[] (const valarray<size_t>& __i)
|
||||
{
|
||||
return indirect_array<_Tp> (_Array<_Tp>(_M_data), __i.size(),
|
||||
_Array<size_t> (__i));
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
inline size_t valarray<_Tp>::size () const { return _M_size; }
|
||||
|
||||
template<class _Tp>
|
||||
inline _Tp
|
||||
valarray<_Tp>::sum () const
|
||||
{
|
||||
return __valarray_sum(_M_data, _M_data + _M_size);
|
||||
}
|
||||
|
||||
// template<typename _Tp>
|
||||
// inline _Tp
|
||||
// valarray<_Tp>::product () const
|
||||
// {
|
||||
// return __valarray_product(_M_data, _M_data + _M_size);
|
||||
// }
|
||||
|
||||
template <class _Tp>
|
||||
inline valarray<_Tp>
|
||||
valarray<_Tp>::shift(int __n) const
|
||||
{
|
||||
_Tp* const __a = static_cast<_Tp*>
|
||||
(__builtin_alloca(sizeof(_Tp) * _M_size));
|
||||
if (__n == 0) // no shift
|
||||
__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
|
||||
else if (__n > 0) // __n > 0: shift left
|
||||
{
|
||||
if (size_t(__n) > _M_size)
|
||||
__valarray_default_construct(__a, __a + __n);
|
||||
else
|
||||
{
|
||||
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
|
||||
__valarray_default_construct(__a+_M_size-__n, __a + _M_size);
|
||||
}
|
||||
}
|
||||
else // __n < 0: shift right
|
||||
{
|
||||
__valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n);
|
||||
__valarray_default_construct(__a, __a - __n);
|
||||
}
|
||||
return valarray<_Tp> (__a, _M_size);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline valarray<_Tp>
|
||||
valarray<_Tp>::cshift (int __n) const
|
||||
{
|
||||
_Tp* const __a = static_cast<_Tp*>
|
||||
(__builtin_alloca (sizeof(_Tp) * _M_size));
|
||||
if (__n == 0) // no cshift
|
||||
__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
|
||||
else if (__n > 0) // cshift left
|
||||
{
|
||||
__valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n);
|
||||
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
|
||||
}
|
||||
else // cshift right
|
||||
{
|
||||
__valarray_copy_construct
|
||||
(_M_data + _M_size+__n, _M_data + _M_size, __a);
|
||||
__valarray_copy_construct
|
||||
(_M_data, _M_data + _M_size+__n, __a - __n);
|
||||
}
|
||||
return valarray<_Tp>(__a, _M_size);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline void
|
||||
valarray<_Tp>::resize (size_t __n, _Tp __c)
|
||||
{
|
||||
// This complication is so to make valarray<valarray<T> > work
|
||||
// even though it is not required by the standard. Nobody should
|
||||
// be saying valarray<valarray<T> > anyway. See the specs.
|
||||
__valarray_destroy_elements(_M_data, _M_data + _M_size);
|
||||
if (_M_size != __n)
|
||||
{
|
||||
__valarray_release_memory(_M_data);
|
||||
_M_size = __n;
|
||||
_M_data = __valarray_get_storage<_Tp>(__n);
|
||||
}
|
||||
__valarray_fill_construct(_M_data, _M_data + __n, __c);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Tp
|
||||
valarray<_Tp>::min() const
|
||||
{
|
||||
return *min_element (_M_data, _M_data+_M_size);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Tp
|
||||
valarray<_Tp>::max() const
|
||||
{
|
||||
return *max_element (_M_data, _M_data+_M_size);
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
inline _Expr<_ValFunClos<_ValArray,_Tp>,_Tp>
|
||||
valarray<_Tp>::apply (_Tp func (_Tp)) const
|
||||
{
|
||||
typedef _ValFunClos<_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure,_Tp> (_Closure (*this, func));
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
inline _Expr<_RefFunClos<_ValArray,_Tp>,_Tp>
|
||||
valarray<_Tp>::apply (_Tp func (const _Tp &)) const
|
||||
{
|
||||
typedef _RefFunClos<_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure,_Tp> (_Closure (*this, func));
|
||||
}
|
||||
|
||||
#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
|
||||
template<typename _Tp> \
|
||||
inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \
|
||||
valarray<_Tp>::operator _Op() const \
|
||||
{ \
|
||||
typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \
|
||||
return _Expr<_Closure, _Tp> (_Closure (*this)); \
|
||||
}
|
||||
|
||||
_DEFINE_VALARRAY_UNARY_OPERATOR(+, _Unary_plus)
|
||||
_DEFINE_VALARRAY_UNARY_OPERATOR(-, negate)
|
||||
_DEFINE_VALARRAY_UNARY_OPERATOR(~, _Bitwise_not)
|
||||
|
||||
#undef _DEFINE_VALARRAY_UNARY_OPERATOR
|
||||
|
||||
template<typename _Tp>
|
||||
inline _Expr<_UnClos<logical_not,_ValArray,_Tp>, bool>
|
||||
valarray<_Tp>::operator!() const
|
||||
{
|
||||
typedef _UnClos<logical_not,_ValArray,_Tp> _Closure;
|
||||
return _Expr<_Closure, bool> (_Closure (*this));
|
||||
}
|
||||
|
||||
#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
|
||||
template<class _Tp> \
|
||||
inline valarray<_Tp> & \
|
||||
valarray<_Tp>::operator _Op##= (const _Tp &__t) \
|
||||
{ \
|
||||
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
template<class _Tp> \
|
||||
inline valarray<_Tp> & \
|
||||
valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v) \
|
||||
{ \
|
||||
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \
|
||||
_Array<_Tp>(__v._M_data)); \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(+, plus)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(-, minus)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(*, multiplies)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(/, divides)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(%, modulus)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(^, xor)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(&, and)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(|, or)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(<<, shift_left)
|
||||
_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
|
||||
|
||||
#undef _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT
|
||||
|
||||
|
||||
} // std::
|
||||
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
|
||||
template<class _Tp> template<class _Dom> \
|
||||
inline valarray<_Tp> & \
|
||||
valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e) \
|
||||
{ \
|
||||
_Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(+, plus)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(-, minus)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(*, multiplies)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(/, divides)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(%, modulus)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(^, xor)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(&, and)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(|, or)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(<<, shift_left)
|
||||
_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
|
||||
|
||||
#undef _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT
|
||||
|
||||
|
||||
#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
|
||||
template<typename _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
|
||||
operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \
|
||||
} \
|
||||
\
|
||||
template<typename _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \
|
||||
operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \
|
||||
} \
|
||||
\
|
||||
template<typename _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \
|
||||
operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \
|
||||
}
|
||||
|
||||
_DEFINE_BINARY_OPERATOR(+, plus)
|
||||
_DEFINE_BINARY_OPERATOR(-, minus)
|
||||
_DEFINE_BINARY_OPERATOR(*, multiplies)
|
||||
_DEFINE_BINARY_OPERATOR(/, divides)
|
||||
_DEFINE_BINARY_OPERATOR(%, modulus)
|
||||
_DEFINE_BINARY_OPERATOR(^, _Bitwise_xor)
|
||||
_DEFINE_BINARY_OPERATOR(&, _Bitwise_and)
|
||||
_DEFINE_BINARY_OPERATOR(|, _Bitwise_or)
|
||||
_DEFINE_BINARY_OPERATOR(<<, _Shift_left)
|
||||
_DEFINE_BINARY_OPERATOR(>>, _Shift_right)
|
||||
|
||||
#undef _DEFINE_BINARY_OPERATOR
|
||||
|
||||
#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \
|
||||
template<typename _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \
|
||||
operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, bool> (_Closure (__v, __w)); \
|
||||
} \
|
||||
\
|
||||
template<class _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \
|
||||
operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, bool> (_Closure (__v, __t)); \
|
||||
} \
|
||||
\
|
||||
template<class _Tp> \
|
||||
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \
|
||||
operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
|
||||
{ \
|
||||
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
|
||||
return _Expr<_Closure, bool> (_Closure (__t, __v)); \
|
||||
}
|
||||
|
||||
_DEFINE_LOGICAL_OPERATOR(&&, logical_and)
|
||||
_DEFINE_LOGICAL_OPERATOR(||, logical_or)
|
||||
_DEFINE_LOGICAL_OPERATOR(==, equal_to)
|
||||
_DEFINE_LOGICAL_OPERATOR(!=, not_equal_to)
|
||||
_DEFINE_LOGICAL_OPERATOR(<, less)
|
||||
_DEFINE_LOGICAL_OPERATOR(>, greater)
|
||||
_DEFINE_LOGICAL_OPERATOR(<=, less_equal)
|
||||
_DEFINE_LOGICAL_OPERATOR(>=, greater_equal)
|
||||
|
||||
#undef _DEFINE_LOGICAL_OPERATOR
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_VALARRAY
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
|
@ -1,78 +0,0 @@
|
|||
// <vector> -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1994
|
||||
* Hewlett-Packard Company
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Hewlett-Packard Company makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1996
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
/** @file std_vector.h
|
||||
* This is an internal header file, included by other library headers.
|
||||
* You should not attempt to use it directly.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_VECTOR
|
||||
#define _CPP_VECTOR 1
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <bits/functexcept.h>
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/stl_construct.h>
|
||||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_vector.h>
|
||||
#include <bits/stl_bvector.h>
|
||||
|
||||
#endif /* _CPP_VECTOR */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
|
@ -1,6 +1,6 @@
|
|||
// Bits and pieces used in algorithms -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -62,15 +62,14 @@
|
|||
#define __GLIBCPP_INTERNAL_ALGOBASE_H
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <cstring>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <new>
|
||||
#include <iosfwd>
|
||||
#include <bits/stl_pair.h>
|
||||
#include <bits/type_traits.h>
|
||||
#include <bits/std_cstring.h>
|
||||
#include <bits/std_climits.h>
|
||||
#include <bits/std_cstdlib.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <new>
|
||||
|
||||
#include <bits/std_iosfwd.h>
|
||||
#include <bits/stl_iterator_base_types.h>
|
||||
#include <bits/stl_iterator_base_funcs.h>
|
||||
#include <bits/stl_iterator.h>
|
||||
|
@ -78,7 +77,6 @@
|
|||
|
||||
namespace std
|
||||
{
|
||||
|
||||
// swap and iter_swap
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,12 +78,11 @@
|
|||
* or online at http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#3
|
||||
*/
|
||||
|
||||
|
||||
#include <bits/functexcept.h> // for __throw_bad_alloc
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <bits/std_cstdlib.h>
|
||||
#include <bits/std_cstring.h>
|
||||
#include <bits/std_cassert.h>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <bits/functexcept.h> // For __throw_bad_alloc
|
||||
#include <bits/stl_threads.h>
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
#ifndef _CPP_BITS_STL_UNINITIALIZED_H
|
||||
#define _CPP_BITS_STL_UNINITIALIZED_H 1
|
||||
|
||||
#include <bits/std_cstring.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/cpp_type_traits.h>
|
||||
#include <bits/std_cstdlib.h>
|
||||
#include <bits/std_cstring.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <new>
|
||||
|
||||
namespace std
|
||||
|
|
|
@ -27,15 +27,12 @@
|
|||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
/** @file ctime
|
||||
/** @file ciso646
|
||||
* This is a Standard C++ Library file. You should @c #include this file
|
||||
* in your programs, rather than any of the "st[dl]_*.h" implementation files.
|
||||
*
|
||||
* This is the C++ version of the Standard C Library header @c time.h,
|
||||
* This is the C++ version of the Standard C Library header @c iso646.h,
|
||||
* and its contents are (mostly) the same as that header, but are all
|
||||
* contained in the namespace @c std.
|
||||
*/
|
||||
|
||||
#ifndef _CPP_CTIME
|
||||
#include <bits/std_ctime.h>
|
||||
#endif
|
|
@ -647,7 +647,7 @@ namespace std
|
|||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
# include <bits/cmath.tcc>
|
||||
# include <cmath.tcc>
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -35,7 +35,7 @@
|
|||
#define _CPP_CSTDIO 1
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <stdio.h>
|
|
@ -35,7 +35,7 @@
|
|||
#define _CPP_CSTDLIB 1
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <stdlib.h>
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef _CPP_CSTRING
|
||||
#define _CPP_CSTRING 1
|
||||
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <string.h>
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef _CPP_CTIME
|
||||
#define _CPP_CTIME 1
|
||||
|
||||
#include <bits/std_cstddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#pragma GCC system_header
|
||||
#include <time.h>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue