re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x)

2007-05-31  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/31426
	* include/bits/c++config: Remove namespace association bits
	from tr1 to std.

	* include/ext/type_traits.h (__promote, __promote2,
	__promote3, __promote4): Add.

	* include/bits/hashtable.h: New.
	* include/bits/functional_hash.h: Likewise.
	* include/tr1/hashtable.h: Likewise.

	* include/tr1_impl/random: New.
	* include/tr1_impl/cinttypes: Likewise.
	* include/tr1_impl/cstdlib: Likewise.
	* include/tr1_impl/unordered_map: Likewise.
	* include/tr1_impl/cstdio: Likewise.
	* include/tr1_impl/boost_shared_ptr.h: Likewise.
	* include/tr1_impl/cctype: Likewise.
	* include/tr1_impl/random.tcc: Likewise.
	* include/tr1_impl/tuple: Likewise.
	* include/tr1_impl/functional_hash.h: Likewise.
	* include/tr1_impl/hashtable: Likewise.
	* include/tr1_impl/cmath: Likewise.
	* include/tr1_impl/type_traitsfwd.h: Likewise.
	* include/tr1_impl/hashtable_policy.h: Likewise.
	* include/tr1_impl/cfenv: Likewise.
	* include/tr1_impl/unordered_set: Likewise.
	* include/tr1_impl/functional: Likewise.
	* include/tr1_impl/utility: Likewise.
	* include/tr1_impl/complex: Likewise.
	* include/tr1_impl/type_traits: Likewise.
	* include/tr1_impl/cwchar: Likewise.
	* include/tr1_impl/cstdint: Likewise.
	* include/tr1_impl/regex: Likewise.
	* include/tr1_impl/array: Likewise.
	* include/tr1_impl/cwctype: Likewise.

	* include/tr1/type_traitsfwd.h: Remove.
	* include/tr1/boost_shared_ptr.h: Likewise.
	* include/tr1/common.h: Likewise.
	* include/tr1/hashtable: Likewise.
	* include/tr1/hashtable_policy.h: Likewise.
	* include/tr1/random.tcc: Likewise.

	* include/c_global/cinttypes: Include tr1_impl/cinttypes.
	* include/c_global/cstdlib: Likewise for cstdlib.
	* include/c_global/cstdio: Likewise for cstdio.
	* include/c_global/cctype: Likewise for cctype.
	* include/c_global/cmath: Likewise for cmath.
	* include/c_global/cfenv: Likewise for cfenv.
	* include/c_global/cwchar: Likewise for cwchar.
	* include/c_global/cstdint: Likewise for cstdint.
	* include/c_global/cwctype: Likewise for cwctype.
	* include/tr1/cinttypes: Likewise for cinttypes.
	* include/tr1/cstdlib: Likewise for cstdlib.
	* include/tr1/cstdio: Likewise for cstdio.
	* include/tr1/cctype: Likewise for cctype.
	* include/tr1/cmath: Likewise for cmath.
	* include/tr1/cfenv: Likewise for cfenv.
	* include/tr1/cwchar: Likewise for cwchar.
	* include/tr1/cstdint: Likewise for cstdint.
	* include/tr1/cwctype: Likewise for cwctype.
	* include/tr1/functional_hash.h: Likewise for functional_hash.

	* include/std/tuple: Include tr1_impl/tuple.
	* include/std/utility: Likewise for utility.
	* include/std/type_traits: Likewise for type_traits.
	(is_pod): Just forward to __is_pod.
	(has_trivial_default_constructor): Just forward to
	__has_trivial_constructor.
	(has_trivial_copy_constructor): Just forward to __has_trivial_copy.
	(has_trivial_assign): Just forward to __has_trivial_assign.
	(has_trivial_destructor): Just forward to __has_trivial_destructor.
	(has_nothrow_default_constructor): Just forward to
	__has_nothrow_constructor.
	(has_nothrow_copy_constructor): Just forward to __has_nothrow_copy.
	(has_nothrow_assign): Just forward to __has_nothrow_assign.
	(is_base_of): Just forward to __is_base_of.
	(is_signed, is_unsigned): Implement according to the C++0x
	specifications.
	* include/std/memory: Likewise for memory.
	* include/std/regex: Likewise for regex.
	* include/std/random: Likewise for random.
	* include/std/unordered_map: Likewise for unordered_map.
	* include/std/unordered_set: Likewise for unordered_set.
	* include/std/functional: Likewise for functional.
	* include/std/complex: Likewise for complex.
	* include/std/array: Likewise for array.
	* include/tr1/tuple: Likewise for tuple.
	* include/tr1/utility: Likewise for utility.
	* include/tr1/type_traits: Likewise for type_traits
	* include/tr1/memory: Likewise for memory.
	* include/tr1/regex: Likewise for regex.
	* include/tr1/random: Likewise for random.
	* include/tr1/unordered_map: Likewise for unordered_map.
	* include/tr1/unordered_set: Likewise for unordered_set.
	* include/tr1/functional: Likewise for functional.
	* include/tr1/complex: Likewise for complex.
	* include/tr1/array: Likewise for array.

	* include/c_global/ctgmath: Tweak.
	* include/c_global/cstdarg: Likewise.
	* include/c_global/ctime: Likewise.
	* include/c_global/climits: Likewise.
	* include/c_global/cfloat: Likewise.	
	* include/c_global/ccomplex: Likewise.
	* include/c_global/cstdbool: Likewise.

	* include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1.
	* include/tr1/riemann_zeta.tcc: Likewise.
	* include/tr1/beta_function.tcc: Likewise.
	* include/tr1/exp_integral.tcc: Likewise.
	* include/tr1/hypergeometric.tcc: Likewise.
	* include/tr1/modified_bessel_func.tcc: Likewise.
	* include/tr1/legendre_function.tcc: Likewise.
	* include/tr1/special_function_util.h: Likewise.
	* include/tr1/bessel_function.tcc: Likewise.
	* include/tr1/poly_hermite.tcc: Likewise.
	* include/tr1/ell_integral.tcc: Likewise.
	* include/tr1/gamma.tcc: Likewise.
	* include/tr1/stdlib.h: Likewise.
	* include/tr1/math.h: Likewise.

	* include/tr1/complex.h: Minor tweaks.
	* include/tr1/wctype.h: Likewise.
	* include/tr1/wchar.h: Likewise.
	* include/tr1/inttypes.h: Likewise.
	* include/tr1/tgmath.h: Likewise.
	* include/tr1/cstdbool: Likewise.
	* include/tr1/cfloat: Likewise.
	* include/tr1/ccomplex: Likewise.
	* include/tr1/ctime: Likewise.
	* include/tr1/climits: Likewise.
	* include/tr1/ctgmath: Likewise.
	* include/tr1/cstdarg: Likewise.

	* testsuite/tr1/headers.cc: Move...
	* testsuite/tr1/headers/all.cc: ... here.
	* testsuite/tr1/using_namespace_std_tr1.cc: Move...
	* testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here.
	* testsuite/tr1/headers/using_namespace_std_tr1.cc ... here.
	* testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New.

	* testsuite/20_util/tuple/requirements/explicit_instantiation.cc:
	Adjust namespace.
	* testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to
	the C++0x requirements.
	* testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise.

	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
	dg-error lines.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
	Un-xfail.

	* testsuite/20_util/is_signed/value.cc: New.
	* testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/is_signed/requirements/explicit_instantiation.cc:
	Likewise.
	* testsuite/20_util/is_unsigned/value.cc: Likewise..
	* testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc:
	Likewise.

	* include/Makefile.am: Adjust.	
	* include/Makefile.in: Regenerate.

From-SVN: r125244
This commit is contained in:
Paolo Carlini 2007-05-31 23:37:56 +00:00 committed by Paolo Carlini
parent 9cbff7e7d9
commit e133ace8d9
125 changed files with 13170 additions and 10964 deletions

View file

@ -1,3 +1,175 @@
2007-05-31 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/31426
* include/bits/c++config: Remove namespace association bits
from tr1 to std.
* include/ext/type_traits.h (__promote, __promote2,
__promote3, __promote4): Add.
* include/bits/hashtable.h: New.
* include/bits/functional_hash.h: Likewise.
* include/tr1/hashtable.h: Likewise.
* include/tr1_impl/random: New.
* include/tr1_impl/cinttypes: Likewise.
* include/tr1_impl/cstdlib: Likewise.
* include/tr1_impl/unordered_map: Likewise.
* include/tr1_impl/cstdio: Likewise.
* include/tr1_impl/boost_shared_ptr.h: Likewise.
* include/tr1_impl/cctype: Likewise.
* include/tr1_impl/random.tcc: Likewise.
* include/tr1_impl/tuple: Likewise.
* include/tr1_impl/functional_hash.h: Likewise.
* include/tr1_impl/hashtable: Likewise.
* include/tr1_impl/cmath: Likewise.
* include/tr1_impl/type_traitsfwd.h: Likewise.
* include/tr1_impl/hashtable_policy.h: Likewise.
* include/tr1_impl/cfenv: Likewise.
* include/tr1_impl/unordered_set: Likewise.
* include/tr1_impl/functional: Likewise.
* include/tr1_impl/utility: Likewise.
* include/tr1_impl/complex: Likewise.
* include/tr1_impl/type_traits: Likewise.
* include/tr1_impl/cwchar: Likewise.
* include/tr1_impl/cstdint: Likewise.
* include/tr1_impl/regex: Likewise.
* include/tr1_impl/array: Likewise.
* include/tr1_impl/cwctype: Likewise.
* include/tr1/type_traitsfwd.h: Remove.
* include/tr1/boost_shared_ptr.h: Likewise.
* include/tr1/common.h: Likewise.
* include/tr1/hashtable: Likewise.
* include/tr1/hashtable_policy.h: Likewise.
* include/tr1/random.tcc: Likewise.
* include/c_global/cinttypes: Include tr1_impl/cinttypes.
* include/c_global/cstdlib: Likewise for cstdlib.
* include/c_global/cstdio: Likewise for cstdio.
* include/c_global/cctype: Likewise for cctype.
* include/c_global/cmath: Likewise for cmath.
* include/c_global/cfenv: Likewise for cfenv.
* include/c_global/cwchar: Likewise for cwchar.
* include/c_global/cstdint: Likewise for cstdint.
* include/c_global/cwctype: Likewise for cwctype.
* include/tr1/cinttypes: Likewise for cinttypes.
* include/tr1/cstdlib: Likewise for cstdlib.
* include/tr1/cstdio: Likewise for cstdio.
* include/tr1/cctype: Likewise for cctype.
* include/tr1/cmath: Likewise for cmath.
* include/tr1/cfenv: Likewise for cfenv.
* include/tr1/cwchar: Likewise for cwchar.
* include/tr1/cstdint: Likewise for cstdint.
* include/tr1/cwctype: Likewise for cwctype.
* include/tr1/functional_hash.h: Likewise for functional_hash.
* include/std/tuple: Include tr1_impl/tuple.
* include/std/utility: Likewise for utility.
* include/std/type_traits: Likewise for type_traits.
(is_pod): Just forward to __is_pod.
(has_trivial_default_constructor): Just forward to
__has_trivial_constructor.
(has_trivial_copy_constructor): Just forward to __has_trivial_copy.
(has_trivial_assign): Just forward to __has_trivial_assign.
(has_trivial_destructor): Just forward to __has_trivial_destructor.
(has_nothrow_default_constructor): Just forward to
__has_nothrow_constructor.
(has_nothrow_copy_constructor): Just forward to __has_nothrow_copy.
(has_nothrow_assign): Just forward to __has_nothrow_assign.
(is_base_of): Just forward to __is_base_of.
(is_signed, is_unsigned): Implement according to the C++0x
specifications.
* include/std/memory: Likewise for memory.
* include/std/regex: Likewise for regex.
* include/std/random: Likewise for random.
* include/std/unordered_map: Likewise for unordered_map.
* include/std/unordered_set: Likewise for unordered_set.
* include/std/functional: Likewise for functional.
* include/std/complex: Likewise for complex.
* include/std/array: Likewise for array.
* include/tr1/tuple: Likewise for tuple.
* include/tr1/utility: Likewise for utility.
* include/tr1/type_traits: Likewise for type_traits
* include/tr1/memory: Likewise for memory.
* include/tr1/regex: Likewise for regex.
* include/tr1/random: Likewise for random.
* include/tr1/unordered_map: Likewise for unordered_map.
* include/tr1/unordered_set: Likewise for unordered_set.
* include/tr1/functional: Likewise for functional.
* include/tr1/complex: Likewise for complex.
* include/tr1/array: Likewise for array.
* include/c_global/ctgmath: Tweak.
* include/c_global/cstdarg: Likewise.
* include/c_global/ctime: Likewise.
* include/c_global/climits: Likewise.
* include/c_global/cfloat: Likewise.
* include/c_global/ccomplex: Likewise.
* include/c_global/cstdbool: Likewise.
* include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1.
* include/tr1/riemann_zeta.tcc: Likewise.
* include/tr1/beta_function.tcc: Likewise.
* include/tr1/exp_integral.tcc: Likewise.
* include/tr1/hypergeometric.tcc: Likewise.
* include/tr1/modified_bessel_func.tcc: Likewise.
* include/tr1/legendre_function.tcc: Likewise.
* include/tr1/special_function_util.h: Likewise.
* include/tr1/bessel_function.tcc: Likewise.
* include/tr1/poly_hermite.tcc: Likewise.
* include/tr1/ell_integral.tcc: Likewise.
* include/tr1/gamma.tcc: Likewise.
* include/tr1/stdlib.h: Likewise.
* include/tr1/math.h: Likewise.
* include/tr1/complex.h: Minor tweaks.
* include/tr1/wctype.h: Likewise.
* include/tr1/wchar.h: Likewise.
* include/tr1/inttypes.h: Likewise.
* include/tr1/tgmath.h: Likewise.
* include/tr1/cstdbool: Likewise.
* include/tr1/cfloat: Likewise.
* include/tr1/ccomplex: Likewise.
* include/tr1/ctime: Likewise.
* include/tr1/climits: Likewise.
* include/tr1/ctgmath: Likewise.
* include/tr1/cstdarg: Likewise.
* testsuite/tr1/headers.cc: Move...
* testsuite/tr1/headers/all.cc: ... here.
* testsuite/tr1/using_namespace_std_tr1.cc: Move...
* testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here.
* testsuite/tr1/headers/using_namespace_std_tr1.cc ... here.
* testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New.
* testsuite/20_util/tuple/requirements/explicit_instantiation.cc:
Adjust namespace.
* testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to
the C++0x requirements.
* testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise.
* testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise.
* testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
dg-error lines.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
Likewise.
* testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
Un-xfail.
* testsuite/20_util/is_signed/value.cc: New.
* testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_signed/requirements/explicit_instantiation.cc:
Likewise.
* testsuite/20_util/is_unsigned/value.cc: Likewise..
* testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc:
Likewise.
* include/Makefile.am: Adjust.
* include/Makefile.in: Regenerate.
2007-05-31 Paolo Carlini <pcarlini@suse.de>
PR c++/32158 (libstdc++ bits)

View file

@ -82,8 +82,10 @@ bits_headers = \
${bits_srcdir}/deque.tcc \
${bits_srcdir}/fstream.tcc \
${bits_srcdir}/functexcept.h \
${bits_srcdir}/functional_hash.h \
${bits_srcdir}/gslice.h \
${bits_srcdir}/gslice_array.h \
${bits_srcdir}/hashtable.h \
${bits_srcdir}/indirect_array.h \
${bits_srcdir}/ios_base.h \
${bits_srcdir}/istream.tcc \
@ -540,7 +542,6 @@ tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/bessel_function.tcc \
${tr1_srcdir}/beta_function.tcc \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/ccomplex \
${tr1_srcdir}/cctype \
${tr1_srcdir}/cfenv \
@ -548,7 +549,6 @@ tr1_headers = \
${tr1_srcdir}/cinttypes \
${tr1_srcdir}/climits \
${tr1_srcdir}/cmath \
${tr1_srcdir}/common.h \
${tr1_srcdir}/complex \
${tr1_srcdir}/complex.h \
${tr1_srcdir}/cstdarg \
@ -568,9 +568,8 @@ tr1_headers = \
${tr1_srcdir}/functional \
${tr1_srcdir}/functional_hash.h \
${tr1_srcdir}/gamma.tcc \
${tr1_srcdir}/hashtable \
${tr1_srcdir}/hypergeometric.tcc \
${tr1_srcdir}/hashtable_policy.h \
${tr1_srcdir}/hashtable.h \
${tr1_srcdir}/inttypes.h \
${tr1_srcdir}/limits.h \
${tr1_srcdir}/math.h \
@ -580,7 +579,6 @@ tr1_headers = \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/special_function_util.h \
@ -592,7 +590,6 @@ tr1_headers = \
${tr1_srcdir}/tgmath.h \
${tr1_srcdir}/tuple \
${tr1_srcdir}/type_traits \
${tr1_srcdir}/type_traitsfwd.h \
${tr1_srcdir}/unordered_set \
${tr1_srcdir}/unordered_map \
${tr1_srcdir}/utility \
@ -600,6 +597,36 @@ tr1_headers = \
${tr1_srcdir}/wctype.h
tr1_impl_srcdir = ${glibcxx_srcdir}/include/tr1_impl
tr1_impl_builddir = ./tr1_impl
tr1_impl_headers = \
${tr1_impl_srcdir}/array \
${tr1_impl_srcdir}/boost_shared_ptr.h \
${tr1_impl_srcdir}/cctype \
${tr1_impl_srcdir}/cfenv \
${tr1_impl_srcdir}/cinttypes \
${tr1_impl_srcdir}/cmath \
${tr1_impl_srcdir}/complex \
${tr1_impl_srcdir}/cstdint \
${tr1_impl_srcdir}/cstdio \
${tr1_impl_srcdir}/cstdlib \
${tr1_impl_srcdir}/cwchar \
${tr1_impl_srcdir}/cwctype \
${tr1_impl_srcdir}/functional \
${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/random \
${tr1_impl_srcdir}/random.tcc \
${tr1_impl_srcdir}/regex \
${tr1_impl_srcdir}/tuple \
${tr1_impl_srcdir}/type_traits \
${tr1_impl_srcdir}/type_traitsfwd.h \
${tr1_impl_srcdir}/unordered_map \
${tr1_impl_srcdir}/unordered_set \
${tr1_impl_srcdir}/utility
# This is the common subset of C++ files that all three "C" header models use.
c_base_srcdir = $(C_INCLUDE_DIR)
c_base_builddir = .
@ -793,7 +820,7 @@ endif
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_base_extra \
stamp-c_compatibility stamp-backward stamp-ext stamp-pb \
stamp-tr1 stamp-debug stamp-host
stamp-tr1 stamp-tr1-impl stamp-debug stamp-host
# List of all files that are created by explicit building, editing, or
# catenation.
@ -932,6 +959,15 @@ stamp-tr1: ${tr1_headers}
fi ;\
$(STAMP) stamp-tr1
stamp-tr1-impl: ${tr1_impl_headers}
@if [ ! -d "${tr1_impl_builddir}" ]; then \
mkdir -p ${tr1_impl_builddir} ;\
fi ;\
if [ ! -f stamp-tr1-impl ]; then \
(cd ${tr1_impl_builddir} && $(LN_S) $? . || true) ;\
fi ;\
$(STAMP) stamp-tr1-impl
stamp-debug: ${debug_headers}
@if [ ! -d "${debug_builddir}" ]; then \
mkdir -p ${debug_builddir} ;\
@ -1158,6 +1194,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
for file in ${tr1_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}
for file in ${tr1_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
@ -1200,8 +1239,10 @@ clean-local:
# developer tries to create them via make in the include build
# directory. (This is more of an example of how this kind of rule can
# be made.)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(ext_headers)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
$(ext_headers)
$(std_headers): ; @:
$(c_base_headers): ; @:
$(tr1_headers): ; @:
$(tr1_impl_headers): ; @:
$(ext_headers): ; @:

View file

@ -327,8 +327,10 @@ bits_headers = \
${bits_srcdir}/deque.tcc \
${bits_srcdir}/fstream.tcc \
${bits_srcdir}/functexcept.h \
${bits_srcdir}/functional_hash.h \
${bits_srcdir}/gslice.h \
${bits_srcdir}/gslice_array.h \
${bits_srcdir}/hashtable.h \
${bits_srcdir}/indirect_array.h \
${bits_srcdir}/ios_base.h \
${bits_srcdir}/istream.tcc \
@ -781,7 +783,6 @@ tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/bessel_function.tcc \
${tr1_srcdir}/beta_function.tcc \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/ccomplex \
${tr1_srcdir}/cctype \
${tr1_srcdir}/cfenv \
@ -789,7 +790,6 @@ tr1_headers = \
${tr1_srcdir}/cinttypes \
${tr1_srcdir}/climits \
${tr1_srcdir}/cmath \
${tr1_srcdir}/common.h \
${tr1_srcdir}/complex \
${tr1_srcdir}/complex.h \
${tr1_srcdir}/cstdarg \
@ -809,9 +809,8 @@ tr1_headers = \
${tr1_srcdir}/functional \
${tr1_srcdir}/functional_hash.h \
${tr1_srcdir}/gamma.tcc \
${tr1_srcdir}/hashtable \
${tr1_srcdir}/hypergeometric.tcc \
${tr1_srcdir}/hashtable_policy.h \
${tr1_srcdir}/hashtable.h \
${tr1_srcdir}/inttypes.h \
${tr1_srcdir}/limits.h \
${tr1_srcdir}/math.h \
@ -821,7 +820,6 @@ tr1_headers = \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/special_function_util.h \
@ -833,13 +831,41 @@ tr1_headers = \
${tr1_srcdir}/tgmath.h \
${tr1_srcdir}/tuple \
${tr1_srcdir}/type_traits \
${tr1_srcdir}/type_traitsfwd.h \
${tr1_srcdir}/unordered_set \
${tr1_srcdir}/unordered_map \
${tr1_srcdir}/utility \
${tr1_srcdir}/wchar.h \
${tr1_srcdir}/wctype.h
tr1_impl_srcdir = ${glibcxx_srcdir}/include/tr1_impl
tr1_impl_builddir = ./tr1_impl
tr1_impl_headers = \
${tr1_impl_srcdir}/array \
${tr1_impl_srcdir}/boost_shared_ptr.h \
${tr1_impl_srcdir}/cctype \
${tr1_impl_srcdir}/cfenv \
${tr1_impl_srcdir}/cinttypes \
${tr1_impl_srcdir}/cmath \
${tr1_impl_srcdir}/complex \
${tr1_impl_srcdir}/cstdint \
${tr1_impl_srcdir}/cstdio \
${tr1_impl_srcdir}/cstdlib \
${tr1_impl_srcdir}/cwchar \
${tr1_impl_srcdir}/cwctype \
${tr1_impl_srcdir}/functional \
${tr1_impl_srcdir}/functional_hash.h \
${tr1_impl_srcdir}/hashtable \
${tr1_impl_srcdir}/hashtable_policy.h \
${tr1_impl_srcdir}/random \
${tr1_impl_srcdir}/random.tcc \
${tr1_impl_srcdir}/regex \
${tr1_impl_srcdir}/tuple \
${tr1_impl_srcdir}/type_traits \
${tr1_impl_srcdir}/type_traitsfwd.h \
${tr1_impl_srcdir}/unordered_map \
${tr1_impl_srcdir}/unordered_set \
${tr1_impl_srcdir}/utility
# This is the common subset of C++ files that all three "C" header models use.
c_base_srcdir = $(C_INCLUDE_DIR)
@ -1017,7 +1043,7 @@ PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_base_extra \
stamp-c_compatibility stamp-backward stamp-ext stamp-pb \
stamp-tr1 stamp-debug stamp-host
stamp-tr1 stamp-tr1-impl stamp-debug stamp-host
# List of all files that are created by explicit building, editing, or
@ -1326,6 +1352,15 @@ stamp-tr1: ${tr1_headers}
fi ;\
$(STAMP) stamp-tr1
stamp-tr1-impl: ${tr1_impl_headers}
@if [ ! -d "${tr1_impl_builddir}" ]; then \
mkdir -p ${tr1_impl_builddir} ;\
fi ;\
if [ ! -f stamp-tr1-impl ]; then \
(cd ${tr1_impl_builddir} && $(LN_S) $? . || true) ;\
fi ;\
$(STAMP) stamp-tr1-impl
stamp-debug: ${debug_headers}
@if [ ! -d "${debug_builddir}" ]; then \
mkdir -p ${debug_builddir} ;\
@ -1540,6 +1575,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
for file in ${tr1_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}
for file in ${tr1_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_impl_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
for file in ${c_base_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
@ -1579,10 +1617,12 @@ clean-local:
# developer tries to create them via make in the include build
# directory. (This is more of an example of how this kind of rule can
# be made.)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(ext_headers)
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
$(ext_headers)
$(std_headers): ; @:
$(c_base_headers): ; @:
$(tr1_headers): ; @:
$(tr1_impl_headers): ; @:
$(ext_headers): ; @:
# 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.

View file

@ -71,10 +71,6 @@
# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
#endif
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# define _GLIBCXX_NAMESPACE_ASSOCIATION_CXX0X 1
#endif
#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
// Macros for namespace scope.
@ -155,18 +151,6 @@ namespace __gnu_cxx
#endif
#endif
// Namespace associations for C++0x, TR1 in std.
#if _GLIBCXX_NAMESPACE_ASSOCIATION_CXX0X
namespace std
{
namespace __cxx200x { }
using namespace __cxx200x __attribute__ ((strong));
}
# define _GLIBCXX_TR1 __cxx200x
#else
# define _GLIBCXX_TR1 tr1
#endif
// Define if compatibility should be provided for -mlong-double-64.
#undef _GLIBCXX_LONG_DOUBLE_COMPAT

View file

@ -0,0 +1,63 @@
// functional_hash.h header -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file functional_hash.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _FUNCTIONAL_HASH_H
#define _FUNCTIONAL_HASH_H 1
#pragma GCC system_header
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/functional_hash.h>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/functional_hash.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _FUNCTIONAL_HASH_H

View file

@ -0,0 +1,63 @@
// hashtable.h header -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file hashtable.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _HASHTABLE_H
#define _HASHTABLE_H 1
#pragma GCC system_header
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/hashtable>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/hashtable>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _HASHTABLE_H

View file

@ -36,11 +36,14 @@
#ifndef _GLIBCXX_CCOMPLEX
#define _GLIBCXX_CCOMPLEX 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/ccomplex>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <complex>
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -84,7 +85,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cctype>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cctype>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cctype>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif

View file

@ -36,11 +36,28 @@
#ifndef _GLIBCXX_CFENV
#define _GLIBCXX_CFENV 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cfenv>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <bits/c++config.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cfenv>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cfenv>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif

View file

@ -50,7 +50,15 @@
#define _GLIBCXX_CFLOAT 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cfloat>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# ifndef DECIMAL_DIG
# define DECIMAL_DIG __DECIMAL_DIG__
# endif
# ifndef FLT_EVAL_METHOD
# define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
# endif
#endif
#endif

View file

@ -36,11 +36,28 @@
#ifndef _GLIBCXX_CINTTYPES
#define _GLIBCXX_CINTTYPES 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cinttypes>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <cstdint>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cinttypes>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cinttypes>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -49,8 +50,16 @@
#ifndef _GLIBCXX_CLIMITS
#define _GLIBCXX_CLIMITS 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/climits>
#ifndef LLONG_MIN
#define LLONG_MIN -__LONG_LONG_MAX__ - 1
#endif
#ifndef LLONG_MAX
#define LLONG_MAX __LONG_LONG_MAX__
#endif
#ifndef ULLONG_MAX
#define ULLONG_MAX __LONG_LONG_MAX__ * 2ULL + 1
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- C forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -82,7 +83,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Forward declaration of a helper function. This really should be
// an `exported' forward declaration.
template<typename _Tp> _Tp __cmath_power(_Tp, unsigned int);
template<typename _Tp>
_Tp __cmath_power(_Tp, unsigned int);
template<typename _Tp>
inline _Tp
__pow_helper(_Tp __x, int __n)
{
return __n < 0
? _Tp(1)/__cmath_power(__x, -__n)
: __cmath_power(__x, __n);
}
inline double
abs(double __x)
@ -123,8 +134,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __builtin_asinl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
asin(_Tp __x)
{ return __builtin_asin(__x); }
@ -139,8 +150,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __builtin_atanl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
double>::__type
atan(_Tp __x)
{ return __builtin_atan(__x); }
@ -155,11 +166,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __builtin_atan2l(__y, __x); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value
&& __is_integer<_Up>::__value,
double>::__type
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
atan2(_Tp __y, _Up __x)
{ return __builtin_atan2(__y, __x); }
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return atan2(__type(__y), __type(__x));
}
using ::ceil;
@ -341,15 +353,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
modf(long double __x, long double* __iptr)
{ return __builtin_modfl(__x, __iptr); }
template<typename _Tp>
inline _Tp
__pow_helper(_Tp __x, int __n)
{
return __n < 0
? _Tp(1)/__cmath_power(__x, -__n)
: __cmath_power(__x, __n);
}
using ::pow;
inline float
@ -360,6 +363,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
pow(long double __x, long double __y)
{ return __builtin_powl(__x, __y); }
// DR 550.
inline double
pow(double __x, int __i)
{ return __builtin_powi(__x, __i); }
@ -372,6 +376,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
pow(long double __x, int __n)
{ return __builtin_powil(__x, __n); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
pow(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return pow(__type(__x), __type(__y));
}
using ::sin;
inline float
@ -597,7 +609,23 @@ _GLIBCXX_END_NAMESPACE
#endif
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cmath>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# include <type_traits>
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cmath>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cmath>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif

View file

@ -61,8 +61,4 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cstdarg>
#endif
#endif

View file

@ -36,10 +36,13 @@
#ifndef _GLIBCXX_CSTDBOOL
#define _GLIBCXX_CSTDBOOL 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cstdbool>
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#else
# include <c++0x_warning.h>
# include <bits/c++config.h>
# if _GLIBCXX_HAVE_STDBOOL_H
# include_next <stdbool.h>
# endif
#endif
#endif

View file

@ -36,11 +36,28 @@
#ifndef _GLIBCXX_CSTDINT
#define _GLIBCXX_CSTDINT 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cstdint>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <bits/c++config.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cstdint>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cstdint>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -188,7 +189,22 @@ _GLIBCXX_END_NAMESPACE
#endif // _GLIBCXX_USE_C99
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cstdio>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cstdio>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cstdio>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -223,7 +224,22 @@ _GLIBCXX_END_NAMESPACE
#endif // _GLIBCXX_USE_C99
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cstdlib>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cstdlib>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cstdlib>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif // !_GLIBCXX_HOSTED

View file

@ -36,10 +36,10 @@
#ifndef _GLIBCXX_CTGMATH
#define _GLIBCXX_CTGMATH 1
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/ctgmath>
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#else
# include <c++0x_warning.h>
# include <cmath>
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -79,8 +80,4 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/ctime>
#endif
#endif

View file

@ -278,7 +278,22 @@ _GLIBCXX_END_NAMESPACE
#endif //_GLIBCXX_USE_WCHAR_T
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cwchar>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cwchar>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cwchar>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif

View file

@ -1,6 +1,7 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -109,7 +110,22 @@ _GLIBCXX_END_NAMESPACE
#endif //_GLIBCXX_USE_WCHAR_T
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/cwctype>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/cwctype>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/cwctype>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif

View file

@ -159,6 +159,52 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__is_null_pointer(_Type)
{ return false; }
// For complex and cmath
template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
struct __promote
{ typedef double __type; };
template<typename _Tp>
struct __promote<_Tp, false>
{ typedef _Tp __type; };
template<typename _Tp, typename _Up>
struct __promote_2
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
public:
typedef __typeof__(__type1() + __type2()) __type;
};
template<typename _Tp, typename _Up, typename _Vp>
struct __promote_3
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
typedef typename __promote<_Vp>::__type __type3;
public:
typedef __typeof__(__type1() + __type2() + __type3()) __type;
};
template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
struct __promote_4
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
typedef typename __promote<_Vp>::__type __type3;
typedef typename __promote<_Wp>::__type __type4;
public:
typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
};
_GLIBCXX_END_NAMESPACE
#endif

View file

@ -31,16 +31,33 @@
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_ARRAY
#define _GLIBCXX_ARRAY 1
#ifndef _GLIBCXX_CXX0X_ARRAY
#define _GLIBCXX_CXX0X_ARRAY 1
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/array>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <bits/stl_algobase.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/array>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/array>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_CXX0X_ARRAY

View file

@ -47,6 +47,7 @@
#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
#include <cmath>
#include <sstream>
@ -1508,8 +1509,50 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// See ext/type_traits.h for the primary template.
template<typename _Tp, typename _Up>
struct __promote_2<std::complex<_Tp>, _Up>
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
template<typename _Tp, typename _Up>
struct __promote_2<_Tp, std::complex<_Up> >
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
template<typename _Tp, typename _Up>
struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
_GLIBCXX_END_NAMESPACE
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/complex>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# include <type_traits>
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/complex>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/complex>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif /* _GLIBCXX_COMPLEX */

View file

@ -55,7 +55,29 @@
#include <bits/stl_function.h>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/functional>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# include <cmath>
# include <string>
# include <typeinfo>
# include <ext/type_traits.h>
# include <tuple>
# include <type_traits>
# include <bits/functional_hash.h>
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/functional>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/functional>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif /* _GLIBCXX_FUNCTIONAL */
#endif // _GLIBCXX_FUNCTIONAL

View file

@ -60,7 +60,33 @@
#include <bits/stl_raw_storage_iter.h>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/memory>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# include <exception> // std::exception
# include <new> // std::bad_alloc
# include <typeinfo> // std::type_info in get_deleter
# include <bits/stl_algobase.h> // std::swap
# include <iosfwd> // std::basic_ostream
# include <ext/atomicity.h>
# include <ext/concurrence.h>
# include <bits/functexcept.h>
# include <bits/stl_function.h> // std::less
# include <debug/debug.h>
# include <type_traits>
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/boost_shared_ptr.h>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/boost_shared_ptr.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif /* _GLIBCXX_MEMORY */

View file

@ -36,11 +36,38 @@
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/random>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iosfwd>
#include <limits>
#include <ext/type_traits.h>
#include <ext/numeric_traits.h>
#include <bits/concept_check.h>
#include <debug/debug.h>
#include <type_traits>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/random>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/random>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_RANDOM

View file

@ -31,16 +31,40 @@
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_REGEX
#define _GLIBCXX_REGEX 1
#ifndef _GLIBCXX_CXX0X_REGEX
#define _GLIBCXX_CXX0X_REGEX 1
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/regex>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <algorithm>
#include <bitset>
#include <iterator>
#include <locale>
#include <stdexcept>
#include <string>
#include <vector>
#include <utility>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/regex>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/regex>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_CXX0X_REGEX

View file

@ -31,16 +31,33 @@
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_TUPLE
#define _GLIBCXX_TUPLE 1
#ifndef _GLIBCXX_CXX0X_TUPLE
#define _GLIBCXX_CXX0X_TUPLE 1
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/tuple>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <utility>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/tuple>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/tuple>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_CXX0X_TUPLE

View file

@ -31,18 +31,159 @@
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_TYPE_TRAITS
#define _GLIBCXX_TYPE_TRAITS 1
#ifndef _GLIBCXX_CXX0X_TYPE_TRAITS
#define _GLIBCXX_CXX0X_TYPE_TRAITS 1
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/type_traits>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
_GLIBCXX_BEGIN_NAMESPACE(std)
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <cstddef>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/type_traits>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/type_traits>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
namespace std
{
template<typename _Tp,
bool = is_integral<_Tp>::value,
bool = is_floating_point<_Tp>::value>
struct __is_signed_helper
: public false_type { };
template<typename _Tp>
struct __is_signed_helper<_Tp, false, true>
: public true_type { };
template<typename _Tp>
struct __is_signed_helper<_Tp, true, false>
: public integral_constant<bool, _Tp(-1) < _Tp(0)>
{ };
template<typename _Tp>
struct is_signed
: public integral_constant<bool, __is_signed_helper<_Tp>::value>
{ };
template<typename _Tp>
struct is_unsigned
: public integral_constant<bool, (is_arithmetic<_Tp>::value
&& !is_signed<_Tp>::value)>
{ };
template<typename _Tp>
struct is_pod
: public integral_constant<bool, __is_pod(_Tp)>
{ };
template<typename _Tp>
struct has_trivial_default_constructor
: public integral_constant<bool, __has_trivial_constructor(_Tp)>
{ };
template<typename _Tp>
struct has_trivial_copy_constructor
: public integral_constant<bool, __has_trivial_copy(_Tp)>
{ };
template<typename _Tp>
struct has_trivial_assign
: public integral_constant<bool, __has_trivial_assign(_Tp)>
{ };
template<typename _Tp>
struct has_trivial_destructor
: public integral_constant<bool, __has_trivial_destructor(_Tp)>
{ };
template<typename _Tp>
struct has_nothrow_default_constructor
: public integral_constant<bool, __has_nothrow_constructor(_Tp)>
{ };
template<typename _Tp>
struct has_nothrow_copy_constructor
: public integral_constant<bool, __has_nothrow_copy(_Tp)>
{ };
template<typename _Tp>
struct has_nothrow_assign
: public integral_constant<bool, __has_nothrow_assign(_Tp)>
{ };
template<typename _Base, typename _Derived>
struct is_base_of
: public integral_constant<bool, __is_base_of(_Base, _Derived)>
{ };
// XXX FIXME
// The C++0x specifications are different, see N2255.
template<typename _From, typename _To>
struct __is_convertible_simple
: public __sfinae_types
{
private:
static __one __test(_To);
static __two __test(...);
static _From __makeFrom();
public:
static const bool __value = sizeof(__test(__makeFrom())) == 1;
};
template<typename _Tp>
struct __is_int_or_cref
{
typedef typename remove_reference<_Tp>::type __rr_Tp;
static const bool __value = (is_integral<_Tp>::value
|| (is_integral<__rr_Tp>::value
&& is_const<__rr_Tp>::value
&& !is_volatile<__rr_Tp>::value));
};
template<typename _From, typename _To,
bool = (is_void<_From>::value || is_void<_To>::value
|| is_function<_To>::value || is_array<_To>::value
// This special case is here only to avoid warnings.
|| (is_floating_point<typename
remove_reference<_From>::type>::value
&& __is_int_or_cref<_To>::__value))>
struct __is_convertible_helper
{
// "An imaginary lvalue of type From...".
static const bool __value = (__is_convertible_simple<typename
add_reference<_From>::type, _To>::__value);
};
template<typename _From, typename _To>
struct __is_convertible_helper<_From, _To, true>
{ static const bool __value = (is_void<_To>::value
|| (__is_int_or_cref<_To>::__value
&& !is_void<_From>::value)); };
template<typename _From, typename _To>
struct is_convertible
: public integral_constant<bool,
__is_convertible_helper<_From, _To>::__value>
{ };
// Define a nested type if some predicate holds.
template<bool, typename _Tp = void>
@ -131,7 +272,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Utility for finding the unsigned versions of signed integral types.
template<typename _Tp>
struct __make_unsigned;
struct __make_unsigned
{ typedef _Tp __type; };
template<>
struct __make_unsigned<char>
@ -165,16 +307,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Select between integral and enum: not possible to be both.
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
bool _IsUnsigned = is_unsigned<_Tp>::value,
bool _IsEnum = is_enum<_Tp>::value>
struct __make_unsigned_selector;
template<typename _Tp>
struct __make_unsigned_selector<_Tp, true, true, false>
{ typedef _Tp __type; };
template<typename _Tp>
struct __make_unsigned_selector<_Tp, true, false, false>
struct __make_unsigned_selector<_Tp, true, false>
{
private:
typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
@ -186,7 +323,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
template<typename _Tp>
struct __make_unsigned_selector<_Tp, false, false, true>
struct __make_unsigned_selector<_Tp, false, true>
{
private:
// GNU enums start with sizeof short.
@ -214,7 +351,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Utility for finding the signed versions of unsigned integral types.
template<typename _Tp>
struct __make_signed;
struct __make_signed
{ typedef _Tp __type; };
template<>
struct __make_signed<char>
@ -248,16 +386,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Select between integral and enum: not possible to be both.
template<typename _Tp,
bool _IsInt = is_integral<_Tp>::value,
bool _IsSigned = is_signed<_Tp>::value,
bool _IsEnum = is_enum<_Tp>::value>
struct __make_signed_selector;
template<typename _Tp>
struct __make_signed_selector<_Tp, true, true, false>
{ typedef _Tp __type; };
template<typename _Tp>
struct __make_signed_selector<_Tp, true, false, false>
struct __make_signed_selector<_Tp, true, false>
{
private:
typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
@ -269,7 +402,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
template<typename _Tp>
struct __make_signed_selector<_Tp, false, false, true>
struct __make_signed_selector<_Tp, false, true>
{
private:
// GNU enums start with sizeof short.
@ -293,25 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Integral, but don't define.
template<>
struct make_signed<bool>;
}
template<typename _Tp>
struct has_nothrow_default_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_nothrow_copy_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_trivial_default_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_trivial_copy_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
_GLIBCXX_END_NAMESPACE
#endif
#endif // _GLIBCXX_CXX0X_TYPE_TRAITS

View file

@ -36,11 +36,36 @@
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/unordered_map>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <cmath>
#include <string>
#include <utility>
#include <algorithm> // lower_bound
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <type_traits>
#include <bits/functional_hash.h>
#include <bits/hashtable.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/unordered_map>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/unordered_map>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_UNORDERED_MAP

View file

@ -36,11 +36,36 @@
#pragma GCC system_header
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/unordered_set>
#else
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#endif
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <cmath>
#include <string>
#include <utility>
#include <algorithm> // lower_bound
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <type_traits>
#include <bits/functional_hash.h>
#include <bits/hashtable.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/unordered_set>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/unordered_set>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#endif // _GLIBCXX_UNORDERED_SET

View file

@ -67,7 +67,22 @@
#include <bits/stl_pair.h>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <tr1/utility>
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
# endif
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/utility>
# else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/utility>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
#endif
#endif /* _GLIBCXX_UTILITY */

View file

@ -31,216 +31,29 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_ARRAY
#define _TR1_ARRAY 1
#ifndef _GLIBCXX_TR1_ARRAY
#define _GLIBCXX_TR1_ARRAY 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <bits/stl_algobase.h>
//namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/// @brief struct array [6.2.2].
/// NB: Requires complete type _Tp.
template<typename _Tp, std::size_t _Nm>
struct array
{
typedef _Tp value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// Support for zero-sized arrays mandatory.
value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__));
// No explicit construct/copy/destroy for aggregate type.
void
assign(const value_type& __u)
{ std::fill_n(begin(), size(), __u); }
void
swap(array& __other)
{ std::swap_ranges(begin(), end(), __other.begin()); }
// Iterators.
iterator
begin()
{ return iterator(&_M_instance[0]); }
const_iterator
begin() const
{ return const_iterator(&_M_instance[0]); }
iterator
end()
{ return iterator(&_M_instance[_Nm]); }
const_iterator
end() const
{ return const_iterator(&_M_instance[_Nm]); }
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
// Capacity.
size_type
size() const { return _Nm; }
size_type
max_size() const { return _Nm; }
bool
empty() const { return size() == 0; }
// Element access.
reference
operator[](size_type __n)
{ return _M_instance[__n]; }
const_reference
operator[](size_type __n) const
{ return _M_instance[__n]; }
reference
at(size_type __n)
{
_M_check<_Nm>(__n);
return _M_instance[__n];
}
const_reference
at(size_type __n) const
{
_M_check<_Nm>(__n);
return _M_instance[__n];
}
reference
front()
{ return *begin(); }
const_reference
front() const
{ return *begin(); }
reference
back()
{ return _Nm ? *(end() - 1) : *end(); }
const_reference
back() const
{ return _Nm ? *(end() - 1) : *end(); }
_Tp*
data()
{ return &_M_instance[0]; }
const _Tp*
data() const
{ return &_M_instance[0]; }
private:
template<std::size_t _Mm>
typename __gnu_cxx::__enable_if<_Mm, void>::__type
_M_check(size_type __n) const
{
if (__builtin_expect(__n >= _Mm, false))
std::__throw_out_of_range(__N("array::_M_check"));
}
// Avoid "unsigned comparison with zero" warnings.
template<std::size_t _Mm>
typename __gnu_cxx::__enable_if<!_Mm, void>::__type
_M_check(size_type) const
{ std::__throw_out_of_range(__N("array::_M_check")); }
};
// Array comparisons.
template<typename _Tp, std::size_t _Nm>
inline bool
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return std::equal(__one.begin(), __one.end(), __two.begin()); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one == __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
{
return std::lexicographical_compare(__a.begin(), __a.end(),
__b.begin(), __b.end());
}
template<typename _Tp, std::size_t _Nm>
inline bool
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return __two < __one; }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one > __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one < __two); }
// Specialized algorithms [6.2.2.2].
template<typename _Tp, std::size_t _Nm>
inline void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
{ std::swap_ranges(__one.begin(), __one.end(), __two.begin()); }
// Tuple interface to class template array [6.2.2.5].
template<typename _Tp> class tuple_size;
template<int _Int, typename _Tp> class tuple_element;
template<typename _Tp, std::size_t _Nm>
struct tuple_size<array<_Tp, _Nm> >
{ static const int value = _Nm; };
template<typename _Tp, std::size_t _Nm>
const int tuple_size<array<_Tp, _Nm> >::value;
template<int _Int, typename _Tp, std::size_t _Nm>
struct tuple_element<_Int, array<_Tp, _Nm> >
{ typedef _Tp type; };
template<int _Int, typename _Tp, std::size_t _Nm>
inline _Tp&
get(array<_Tp, _Nm>& __arr)
{ return __arr[_Int]; }
template<int _Int, typename _Tp, std::size_t _Nm>
inline const _Tp&
get(const array<_Tp, _Nm>& __arr)
{ return __arr[_Int]; }
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/array>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/array>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_ARRAY

View file

@ -49,14 +49,15 @@
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
// 2nd ed, pp. 240-245
#ifndef _TR1_BESSEL_FUNCTION_TCC
#define _TR1_BESSEL_FUNCTION_TCC 1
#ifndef _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
#define _GLIBCXX_TR1_BESSEL_FUNCTION_TCC 1
#include "special_function_util.h"
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -102,8 +103,8 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_Tp & __gam1, _Tp & __gam2, _Tp & __gampl, _Tp & __gammi)
{
#if _GLIBCXX_USE_C99_MATH_TR1
__gampl = _Tp(1) / std::_GLIBCXX_TR1::tgamma(_Tp(1) + __mu);
__gammi = _Tp(1) / std::_GLIBCXX_TR1::tgamma(_Tp(1) - __mu);
__gampl = _Tp(1) / std::tr1::tgamma(_Tp(1) + __mu);
__gammi = _Tp(1) / std::tr1::tgamma(_Tp(1) - __mu);
#else
__gampl = _Tp(1) / __gamma(_Tp(1) + __mu);
__gammi = _Tp(1) / __gamma(_Tp(1) - __mu);
@ -318,7 +319,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
const _Tp __gam = (__p - __f) / __q;
__Jmu = std::sqrt(__w / ((__p - __f) * __gam + __q));
#if _GLIBCXX_USE_C99_MATH_TR1
__Jmu = std::_GLIBCXX_TR1::copysign(__Jmu, __Jnul);
__Jmu = std::tr1::copysign(__Jmu, __Jnul);
#else
if (__Jmu * __Jnul < _Tp(0))
__Jmu = -__Jmu;
@ -425,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
const _Tp __x2 = __x / _Tp(2);
_Tp __fact = __nu * std::log(__x2);
#if _GLIBCXX_USE_C99_MATH_TR1
__fact -= std::_GLIBCXX_TR1::lgamma(__nu + _Tp(1));
__fact -= std::tr1::lgamma(__nu + _Tp(1));
#else
__fact -= __log_gamma(__nu + _Tp(1));
#endif
@ -635,7 +636,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_BESSEL_FUNCTION_TCC
#endif // _GLIBCXX_TR1_BESSEL_FUNCTION_TCC

View file

@ -49,12 +49,13 @@
// (4) Gamma, Exploring Euler's Constant, Julian Havil,
// Princeton, 2003.
#ifndef _TR1_BETA_FUNCTION_TCC
#define _TR1_BETA_FUNCTION_TCC 1
#ifndef _GLIBCXX_TR1_BETA_FUNCTION_TCC
#define _GLIBCXX_TR1_BETA_FUNCTION_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -90,15 +91,15 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if _GLIBCXX_USE_C99_MATH_TR1
if (__x > __y)
{
__bet = std::_GLIBCXX_TR1::tgamma(__x)
/ std::_GLIBCXX_TR1::tgamma(__x + __y);
__bet *= std::_GLIBCXX_TR1::tgamma(__y);
__bet = std::tr1::tgamma(__x)
/ std::tr1::tgamma(__x + __y);
__bet *= std::tr1::tgamma(__y);
}
else
{
__bet = std::_GLIBCXX_TR1::tgamma(__y)
/ std::_GLIBCXX_TR1::tgamma(__x + __y);
__bet *= std::_GLIBCXX_TR1::tgamma(__x);
__bet = std::tr1::tgamma(__y)
/ std::tr1::tgamma(__x + __y);
__bet *= std::tr1::tgamma(__x);
}
#else
if (__x > __y)
@ -134,9 +135,9 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__beta_lgamma(_Tp __x, _Tp __y)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bet = std::_GLIBCXX_TR1::lgamma(__x)
+ std::_GLIBCXX_TR1::lgamma(__y)
- std::_GLIBCXX_TR1::lgamma(__x + __y);
_Tp __bet = std::tr1::lgamma(__x)
+ std::tr1::lgamma(__y)
- std::tr1::lgamma(__x + __y);
#else
_Tp __bet = __log_gamma(__x)
+ __log_gamma(__y)
@ -205,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_BETA_FUNCTION_TCC
#endif // __GLIBCXX_TR1_BETA_FUNCTION_TCC

View file

@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CCOMPLEX
#define _TR1_CCOMPLEX 1
#ifndef _GLIBCXX_TR1_CCOMPLEX
#define _GLIBCXX_TR1_CCOMPLEX 1
#include <tr1/complex>
#endif
#endif // _GLIBCXX_TR1_CCOMPLEX

View file

@ -1,6 +1,6 @@
// TR1 cctype -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,26 +31,24 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CCTYPE
#define _TR1_CCTYPE 1
#ifndef _GLIBCXX_TR1_CCTYPE
#define _GLIBCXX_TR1_CCTYPE 1
#include <bits/c++config.h>
#include <cctype>
#if _GLIBCXX_USE_C99_CTYPE_TR1
#undef isblank
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
using ::isblank;
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cctype>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cctype>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif
#endif // _GLIBCXX_TR1_CCTYPE

View file

@ -1,6 +1,6 @@
// TR1 cctype -*- C++ -*-
// TR1 cfenv -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,54 +31,23 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CFENV
#define _TR1_CFENV 1
#ifndef _GLIBCXX_TR1_CFENV
#define _GLIBCXX_TR1_CFENV 1
#include <bits/c++config.h>
#if _GLIBCXX_USE_C99_FENV_TR1
#include_next <fenv.h>
#undef feclearexcept
#undef fegetexceptflag
#undef feraiseexcept
#undef fesetexceptflag
#undef fetestexcept
#undef fegetround
#undef fesetround
#undef fegetenv
#undef feholdexcept
#undef fesetenv
#undef feupdateenv
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// types
using ::fenv_t;
using ::fexcept_t;
// functions
using ::feclearexcept;
using ::fegetexceptflag;
using ::feraiseexcept;
using ::fesetexceptflag;
using ::fetestexcept;
using ::fegetround;
using ::fesetround;
using ::fegetenv;
using ::feholdexcept;
using ::fesetenv;
using ::feupdateenv;
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cfenv>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cfenv>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif
#endif // _GLIBCXX_TR1_CFENV

View file

@ -1,6 +1,6 @@
// TR1 cfloat -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,8 +31,8 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CFLOAT
#define _TR1_CFLOAT 1
#ifndef _GLIBCXX_TR1_CFLOAT
#define _GLIBCXX_TR1_CFLOAT 1
#include <cfloat>
@ -44,4 +44,4 @@
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#endif
#endif
#endif //_GLIBCXX_TR1_CFLOAT

View file

@ -31,51 +31,23 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CINTTYPES
#define _TR1_CINTTYPES 1
#ifndef _GLIBCXX_TR1_CINTTYPES
#define _GLIBCXX_TR1_CINTTYPES 1
#include <bits/c++config.h>
#include <tr1/cstdint>
#if _GLIBCXX_USE_C99_INTTYPES_TR1
// For 8.11.1/1 (see C99, Note 184)
#define __STDC_FORMAT_MACROS
#include_next <inttypes.h>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// types
using ::imaxdiv_t;
// functions
using ::imaxabs;
// May collide with _Longlong abs(_Longlong), and is not described
// anywhere outside the synopsis. Likely, a defect.
//
// intmax_t abs(intmax_t)
using ::imaxdiv;
// Likewise, with lldiv_t div(_Longlong, _Longlong).
//
// imaxdiv_t div(intmax_t, intmax_t)
using ::strtoimax;
using ::strtoumax;
#ifdef _GLIBCXX_USE_WCHAR_T
using ::wcstoimax;
using ::wcstoumax;
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cinttypes>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cinttypes>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
_GLIBCXX_END_NAMESPACE
}
#endif
#endif
#endif // _GLIBCXX_TR1_CINTTYPES

View file

@ -1,6 +1,6 @@
// TR1 climits -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,8 +31,8 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CLIMITS
#define _TR1_CLIMITS 1
#ifndef _GLIBCXX_TR1_CLIMITS
#define _GLIBCXX_TR1_CLIMITS 1
#include <climits>
@ -48,4 +48,4 @@
#define ULLONG_MAX __LONG_LONG_MAX__ * 2ULL + 1
#endif
#endif
#endif // _GLIBCXX_TR1_CLIMITS

File diff suppressed because it is too large Load diff

View file

@ -1,91 +0,0 @@
// Internal header for TR1 complex -*- C++ -*-
// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/common.h
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_COMMON_H
#define _TR1_COMMON_H 1
#include <tr1/type_traits>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
template<typename _Tp, bool = is_integral<_Tp>::value>
struct __promote
{ typedef double __type; };
template<typename _Tp>
struct __promote<_Tp, false>
{ typedef _Tp __type; };
template<typename _Tp, typename _Up>
struct __promote_2
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
public:
typedef __typeof__(__type1() + __type2()) __type;
};
template<typename _Tp, typename _Up, typename _Vp>
struct __promote_3
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
typedef typename __promote<_Vp>::__type __type3;
public:
typedef __typeof__(__type1() + __type2() + __type3()) __type;
};
template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
struct __promote_4
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
typedef typename __promote<_Vp>::__type __type3;
typedef typename __promote<_Wp>::__type __type4;
public:
typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
};
_GLIBCXX_END_NAMESPACE
} // namespace std
#endif

View file

@ -31,379 +31,46 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_COMPLEX
#define _TR1_COMPLEX 1
#ifndef _GLIBCXX_TR1_COMPLEX
#define _GLIBCXX_TR1_COMPLEX 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <complex>
#include <tr1/common.h>
#include <ext/type_traits.h>
#include <tr1/type_traits>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/complex>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/complex>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// Forward declarations.
template<typename _Tp> std::complex<_Tp> acos(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> asin(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> atan(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> acosh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> asinh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> atanh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&);
/// @brief acos(__z) [8.1.2].
// Effects: Behaves the same as C99 function cacos, defined
// in subclause 7.3.5.1.
template<typename _Tp>
inline std::complex<_Tp>
__complex_acos(const std::complex<_Tp>& __z)
{
const std::complex<_Tp> __t = std::_GLIBCXX_TR1::asin(__z);
const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag());
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_acos(__complex__ float __z)
{ return __builtin_cacosf(__z); }
inline __complex__ double
__complex_acos(__complex__ double __z)
{ return __builtin_cacos(__z); }
inline __complex__ long double
__complex_acos(const __complex__ long double& __z)
{ return __builtin_cacosl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
acos(const std::complex<_Tp>& __z)
{ return __complex_acos(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
acos(const std::complex<_Tp>& __z)
{ return __complex_acos(__z); }
#endif
/// @brief asin(__z) [8.1.3].
// Effects: Behaves the same as C99 function casin, defined
// in subclause 7.3.5.2.
template<typename _Tp>
inline std::complex<_Tp>
__complex_asin(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t(-__z.imag(), __z.real());
__t = std::_GLIBCXX_TR1::asinh(__t);
return std::complex<_Tp>(__t.imag(), -__t.real());
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_asin(__complex__ float __z)
{ return __builtin_casinf(__z); }
inline __complex__ double
__complex_asin(__complex__ double __z)
{ return __builtin_casin(__z); }
inline __complex__ long double
__complex_asin(const __complex__ long double& __z)
{ return __builtin_casinl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
asin(const std::complex<_Tp>& __z)
{ return __complex_asin(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
asin(const std::complex<_Tp>& __z)
{ return __complex_asin(__z); }
#endif
/// @brief atan(__z) [8.1.4].
// Effects: Behaves the same as C99 function catan, defined
// in subclause 7.3.5.3.
template<typename _Tp>
std::complex<_Tp>
__complex_atan(const std::complex<_Tp>& __z)
{
const _Tp __r2 = __z.real() * __z.real();
const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
_Tp __num = __z.imag() + _Tp(1.0);
_Tp __den = __z.imag() - _Tp(1.0);
__num = __r2 + __num * __num;
__den = __r2 + __den * __den;
return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
_Tp(0.25) * log(__num / __den));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_atan(__complex__ float __z)
{ return __builtin_catanf(__z); }
inline __complex__ double
__complex_atan(__complex__ double __z)
{ return __builtin_catan(__z); }
inline __complex__ long double
__complex_atan(const __complex__ long double& __z)
{ return __builtin_catanl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
atan(const std::complex<_Tp>& __z)
{ return __complex_atan(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
atan(const std::complex<_Tp>& __z)
{ return __complex_atan(__z); }
#endif
/// @brief acosh(__z) [8.1.5].
// Effects: Behaves the same as C99 function cacosh, defined
// in subclause 7.3.6.1.
template<typename _Tp>
std::complex<_Tp>
__complex_acosh(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t((__z.real() - __z.imag())
* (__z.real() + __z.imag()) - _Tp(1.0),
_Tp(2.0) * __z.real() * __z.imag());
__t = std::sqrt(__t);
return std::log(__t + __z);
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_acosh(__complex__ float __z)
{ return __builtin_cacoshf(__z); }
inline __complex__ double
__complex_acosh(__complex__ double __z)
{ return __builtin_cacosh(__z); }
inline __complex__ long double
__complex_acosh(const __complex__ long double& __z)
{ return __builtin_cacoshl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
acosh(const std::complex<_Tp>& __z)
{ return __complex_acosh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
acosh(const std::complex<_Tp>& __z)
{ return __complex_acosh(__z); }
#endif
/// @brief asinh(__z) [8.1.6].
// Effects: Behaves the same as C99 function casin, defined
// in subclause 7.3.6.2.
template<typename _Tp>
std::complex<_Tp>
__complex_asinh(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t((__z.real() - __z.imag())
* (__z.real() + __z.imag()) + _Tp(1.0),
_Tp(2.0) * __z.real() * __z.imag());
__t = std::sqrt(__t);
return std::log(__t + __z);
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_asinh(__complex__ float __z)
{ return __builtin_casinhf(__z); }
inline __complex__ double
__complex_asinh(__complex__ double __z)
{ return __builtin_casinh(__z); }
inline __complex__ long double
__complex_asinh(const __complex__ long double& __z)
{ return __builtin_casinhl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
asinh(const std::complex<_Tp>& __z)
{ return __complex_asinh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
asinh(const std::complex<_Tp>& __z)
{ return __complex_asinh(__z); }
#endif
/// @brief atanh(__z) [8.1.7].
// Effects: Behaves the same as C99 function catanh, defined
// in subclause 7.3.6.3.
template<typename _Tp>
std::complex<_Tp>
__complex_atanh(const std::complex<_Tp>& __z)
{
const _Tp __i2 = __z.imag() * __z.imag();
const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
_Tp __num = _Tp(1.0) + __z.real();
_Tp __den = _Tp(1.0) - __z.real();
__num = __i2 + __num * __num;
__den = __i2 + __den * __den;
return std::complex<_Tp>(_Tp(0.25) * (log(__num) - log(__den)),
_Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_atanh(__complex__ float __z)
{ return __builtin_catanhf(__z); }
inline __complex__ double
__complex_atanh(__complex__ double __z)
{ return __builtin_catanh(__z); }
inline __complex__ long double
__complex_atanh(const __complex__ long double& __z)
{ return __builtin_catanhl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
atanh(const std::complex<_Tp>& __z)
{ return __complex_atanh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
atanh(const std::complex<_Tp>& __z)
{ return __complex_atanh(__z); }
#endif
/// @brief fabs(__z) [8.1.8].
// Effects: Behaves the same as C99 function cabs, defined
// in subclause 7.3.8.1.
template<typename _Tp>
inline std::complex<_Tp>
fabs(const std::complex<_Tp>& __z)
{ return std::abs(__z); }
/// @brief Additional overloads [8.1.9].
//
// See common.h for the primary template.
template<typename _Tp, typename _Up>
struct __promote_2<std::complex<_Tp>, _Up>
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
template<typename _Tp, typename _Up>
struct __promote_2<_Tp, std::complex<_Up> >
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
template<typename _Tp, typename _Up>
struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
{
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
namespace tr1
{
using std::arg;
template<typename _Tp>
inline typename __promote<_Tp>::__type
arg(_Tp __x)
{
typedef typename __promote<_Tp>::__type __type;
return std::arg(std::complex<__type>(__x));
}
using std::conj;
template<typename _Tp>
inline std::complex<typename __promote<_Tp>::__type>
conj(_Tp __x)
{ return __x; }
using std::imag;
template<typename _Tp>
inline typename __promote<_Tp>::__type
imag(_Tp)
{ return _Tp(); }
using std::norm;
template<typename _Tp>
inline typename __promote<_Tp>::__type
norm(_Tp __x)
{
typedef typename __promote<_Tp>::__type __type;
return __type(__x) * __type(__x);
}
using std::polar;
template<typename _Tp, typename _Up>
inline std::complex<typename __promote_2<_Tp, _Up>::__type>
polar(const _Tp& __rho, const _Up& __theta)
{
typedef typename __promote_2<_Tp, _Up>::__type __type;
return std::polar(__type(__rho), __type(__theta));
}
using std::pow;
template<typename _Tp, typename _Up>
inline std::complex<typename __promote_2<_Tp, _Up>::__type>
pow(const std::complex<_Tp>& __x, const _Up& __y)
{
typedef typename __promote_2<_Tp, _Up>::__type __type;
return std::pow(std::complex<__type>(__x), __type(__y));
}
template<typename _Tp, typename _Up>
inline std::complex<typename __promote_2<_Tp, _Up>::__type>
pow(const _Tp& __x, const std::complex<_Up>& __y)
{
typedef typename __promote_2<_Tp, _Up>::__type __type;
return std::pow(__type(__x), std::complex<__type>(__y));
}
template<typename _Tp, typename _Up>
inline std::complex<typename __promote_2<_Tp, _Up>::__type>
pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
{
typedef typename __promote_2<_Tp, _Up>::__type __type;
return std::pow(std::complex<__type>(__x),
std::complex<__type>(__y));
}
using std::real;
template<typename _Tp>
inline typename __promote<_Tp>::__type
real(_Tp __x)
{ return __x; }
_GLIBCXX_END_NAMESPACE
}
}
#endif
#endif // _GLIBCXX_TR1_COMPLEX

View file

@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_COMPLEX_H
#define _TR1_COMPLEX_H 1
#ifndef _GLIBCXX_TR1_COMPLEX_H
#define _GLIBCXX_TR1_COMPLEX_H 1
#include <tr1/ccomplex>
#endif
#endif // _GLIBCXX_TR1_COMPLEX_H

View file

@ -1,6 +1,6 @@
// TR1 cstdarg -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CSTDARG
#define _TR1_CSTDARG 1
#ifndef _GLIBCXX_TR1_CSTDARG
#define _GLIBCXX_TR1_CSTDARG 1
#include <cstdarg>
#endif
#endif // _GLIBCXX_TR1_CSTDARG

View file

@ -31,8 +31,8 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CSTDBOOL
#define _TR1_CSTDBOOL 1
#ifndef _GLIBCXX_TR1_CSTDBOOL
#define _GLIBCXX_TR1_CSTDBOOL 1
#include <bits/c++config.h>
@ -40,4 +40,4 @@
#include_next <stdbool.h>
#endif
#endif
#endif // _GLIBCXX_TR1_CSTDBOOL

View file

@ -31,62 +31,30 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CSTDINT
#define _TR1_CSTDINT 1
#ifndef _GLIBCXX_TR1_CSTDINT
#define _GLIBCXX_TR1_CSTDINT 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <bits/c++config.h>
#if _GLIBCXX_USE_C99_STDINT_TR1
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include_next <stdint.h>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
using ::int8_t;
using ::int16_t;
using ::int32_t;
using ::int64_t;
using ::int_fast8_t;
using ::int_fast16_t;
using ::int_fast32_t;
using ::int_fast64_t;
using ::int_least8_t;
using ::int_least16_t;
using ::int_least32_t;
using ::int_least64_t;
using ::intmax_t;
using ::intptr_t;
using ::uint8_t;
using ::uint16_t;
using ::uint32_t;
using ::uint64_t;
using ::uint_fast8_t;
using ::uint_fast16_t;
using ::uint_fast32_t;
using ::uint_fast64_t;
using ::uint_least8_t;
using ::uint_least16_t;
using ::uint_least32_t;
using ::uint_least64_t;
using ::uintmax_t;
using ::uintptr_t;
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cstdint>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cstdint>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif
#endif // _GLIBCXX_TR1_CSTDINT

View file

@ -31,27 +31,29 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CSTDIO
#define _TR1_CSTDIO 1
#ifndef _GLIBCXX_TR1_CSTDIO
#define _GLIBCXX_TR1_CSTDIO 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <bits/c++config.h>
#include <cstdio>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if _GLIBCXX_USE_C99
using std::snprintf;
using std::vsnprintf;
using std::vfscanf;
using std::vscanf;
using std::vsscanf;
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cstdio>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cstdio>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
_GLIBCXX_END_NAMESPACE
}
#endif
#endif // _GLIBCXX_TR1_CSTDIO

View file

@ -31,49 +31,29 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CSTDLIB
#define _TR1_CSTDLIB 1
#ifndef _GLIBCXX_TR1_CSTDLIB
#define _GLIBCXX_TR1_CSTDLIB 1
#include <bits/c++config.h>
#pragma GCC system_header
#if _GLIBCXX_HOSTED
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cstdlib>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if _GLIBCXX_USE_C99
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
// types
using std::lldiv_t;
// functions
using std::llabs;
using std::lldiv;
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cstdlib>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cstdlib>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
using std::atoll;
using std::strtoll;
using std::strtoull;
using std::strtof;
using std::strtold;
// overloads
using std::abs;
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
using std::div;
#endif
#endif
_GLIBCXX_END_NAMESPACE
}
#endif
#endif
#endif // _GLIBCXX_TR1_CSTDLIB

View file

@ -1,6 +1,6 @@
// TR1 ctgmath -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CTGMATH
#define _TR1_CTGMATH 1
#ifndef _GLIBCXX_TR1_CTGMATH
#define _GLIBCXX_TR1_CTGMATH 1
#include <tr1/cmath>
#endif
#endif // _GLIBCXX_TR1_CTGMATH

View file

@ -1,6 +1,6 @@
// TR1 ctime -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CTIME
#define _TR1_CTIME 1
#ifndef _GLIBCXX_TR1_CTIME
#define _GLIBCXX_TR1_CTIME 1
#include <ctime>
#endif
#endif // _GLIBCXX_TR1_CTIME

View file

@ -1,6 +1,6 @@
// TR1 cwchar -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,42 +31,29 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CWCHAR
#define _TR1_CWCHAR 1
#ifndef _GLIBCXX_TR1_CWCHAR
#define _GLIBCXX_TR1_CWCHAR 1
#include <bits/c++config.h>
#pragma GCC system_header
#if _GLIBCXX_USE_WCHAR_T
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cwchar>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if _GLIBCXX_HAVE_WCSTOF
using std::wcstof;
#endif
#if _GLIBCXX_HAVE_VFWSCANF
using std::vfwscanf;
#endif
#if _GLIBCXX_HAVE_VSWSCANF
using std::vswscanf;
#endif
#if _GLIBCXX_HAVE_VWSCANF
using std::vwscanf;
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cwchar>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cwchar>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#if _GLIBCXX_USE_C99
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
#endif
_GLIBCXX_END_NAMESPACE
}
#endif
#endif
#endif // _GLIBCXX_TR1_CWCHAR

View file

@ -1,6 +1,6 @@
// TR1 cwctype -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,27 +31,29 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_CWCTYPE
#define _TR1_CWCTYPE 1
#ifndef _GLIBCXX_TR1_CWCTYPE
#define _GLIBCXX_TR1_CWCTYPE 1
#include <bits/c++config.h>
#pragma GCC system_header
#if _GLIBCXX_USE_WCHAR_T
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cwctype>
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if _GLIBCXX_HAVE_ISWBLANK
using std::iswblank;
#endif
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/cwctype>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/cwctype>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif
#endif // _GLIBCXX_TR1_CWCTYPE

View file

@ -45,12 +45,13 @@
// W. T. Vetterling, B. P. Flannery, Cambridge University Press
// (1992), pp. 261-269
#ifndef _TR1_ELL_INTEGRAL_TCC
#define _TR1_ELL_INTEGRAL_TCC 1
#ifndef _GLIBCXX_TR1_ELL_INTEGRAL_TCC
#define _GLIBCXX_TR1_ELL_INTEGRAL_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -755,8 +756,8 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_ELL_INTEGRAL_TCC
#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC

View file

@ -48,14 +48,15 @@
// 2nd ed, pp. 222-225.
//
#ifndef _TR1_EXP_INTEGRAL_TCC
#define _TR1_EXP_INTEGRAL_TCC 1
#ifndef _GLIBCXX_TR1_EXP_INTEGRAL_TCC
#define _GLIBCXX_TR1_EXP_INTEGRAL_TCC 1
#include "special_function_util.h"
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -532,7 +533,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_EXP_INTEGRAL_TCC
#endif // _GLIBCXX_TR1_EXP_INTEGRAL_TCC

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// TR1 functional -*- C++ -*-
// TR1 functional_hash.h header -*- C++ -*-
// Copyright (C) 2007 Free Software Foundation, Inc.
//
@ -32,200 +32,27 @@
* You should not attempt to use it directly.
*/
#ifndef _TR1_FUNCTIONAL_HASH_H
#define _TR1_FUNCTIONAL_HASH_H 1
#ifndef _GLIBCXX_TR1_FUNCTIONAL_HASH_H
#define _GLIBCXX_TR1_FUNCTIONAL_HASH_H 1
#include <string>
#include <cmath> // for std::frexp
#pragma GCC system_header
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// Definition of default hash function std::tr1::hash<>. The types for
// which std::tr1::hash<T> is defined is in clause 6.3.3. of the PDTR.
template<typename T>
struct hash;
#define _TR1_hashtable_define_trivial_hash(_Tp) \
template<> \
struct hash<_Tp> \
: public std::unary_function<_Tp, std::size_t> \
{ \
std::size_t \
operator()(_Tp __val) const \
{ return static_cast<std::size_t>(__val); } \
}
_TR1_hashtable_define_trivial_hash(bool);
_TR1_hashtable_define_trivial_hash(char);
_TR1_hashtable_define_trivial_hash(signed char);
_TR1_hashtable_define_trivial_hash(unsigned char);
_TR1_hashtable_define_trivial_hash(wchar_t);
_TR1_hashtable_define_trivial_hash(short);
_TR1_hashtable_define_trivial_hash(int);
_TR1_hashtable_define_trivial_hash(long);
_TR1_hashtable_define_trivial_hash(long long);
_TR1_hashtable_define_trivial_hash(unsigned short);
_TR1_hashtable_define_trivial_hash(unsigned int);
_TR1_hashtable_define_trivial_hash(unsigned long);
_TR1_hashtable_define_trivial_hash(unsigned long long);
#undef _TR1_hashtable_define_trivial_hash
template<typename _Tp>
struct hash<_Tp*>
: public std::unary_function<_Tp*, std::size_t>
{
std::size_t
operator()(_Tp* __p) const
{ return reinterpret_cast<std::size_t>(__p); }
};
// Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
// (used by the next specializations of std::tr1::hash<>)
// Dummy generic implementation (for sizeof(size_t) != 4, 8).
template<std::size_t = sizeof(std::size_t)>
struct _Fnv_hash
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result = 0;
for (; __length > 0; --__length)
__result = (__result * 131) + *__first++;
return __result;
}
};
template<>
struct _Fnv_hash<4>
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result = static_cast<std::size_t>(2166136261UL);
for (; __length > 0; --__length)
{
__result ^= static_cast<std::size_t>(*__first++);
__result *= static_cast<std::size_t>(16777619UL);
}
return __result;
}
};
template<>
struct _Fnv_hash<8>
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result =
static_cast<std::size_t>(14695981039346656037ULL);
for (; __length > 0; --__length)
{
__result ^= static_cast<std::size_t>(*__first++);
__result *= static_cast<std::size_t>(1099511628211ULL);
}
return __result;
}
};
// XXX String and floating point hashes probably shouldn't be inline
// member functions, since are nontrivial. Once we have the framework
// for TR1 .cc files, these should go in one.
template<>
struct hash<std::string>
: public std::unary_function<std::string, std::size_t>
{
std::size_t
operator()(const std::string& __s) const
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
};
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
struct hash<std::wstring>
: public std::unary_function<std::wstring, std::size_t>
{
std::size_t
operator()(const std::wstring& __s) const
{
return _Fnv_hash<>::hash(reinterpret_cast<const char*>(__s.data()),
__s.length() * sizeof(wchar_t));
}
};
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
template<>
struct hash<float>
: public std::unary_function<float, std::size_t>
{
std::size_t
operator()(float __fval) const
{
std::size_t __result = 0;
// 0 and -0 both hash to zero.
if (__fval != 0.0f)
__result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__fval),
sizeof(__fval));
return __result;
}
};
template<>
struct hash<double>
: public std::unary_function<double, std::size_t>
{
std::size_t
operator()(double __dval) const
{
std::size_t __result = 0;
// 0 and -0 both hash to zero.
if (__dval != 0.0)
__result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__dval),
sizeof(__dval));
return __result;
}
};
// For long double, careful with random padding bits (e.g., on x86,
// 10 bytes -> 12 bytes) and resort to frexp.
template<>
struct hash<long double>
: public std::unary_function<long double, std::size_t>
{
std::size_t
operator()(long double __ldval) const
{
std::size_t __result = 0;
int __exponent;
__ldval = std::frexp(__ldval, &__exponent);
__ldval = __ldval < 0.0l ? -(__ldval + 0.5l) : __ldval;
const long double __mult =
__gnu_cxx::__numeric_traits<std::size_t>::__max + 1.0l;
__ldval *= __mult;
// Try to use all the bits of the mantissa (really necessary only
// on 32-bit targets, at least for 80-bit floating point formats).
const std::size_t __hibits = (std::size_t)__ldval;
__ldval = (__ldval - (long double)__hibits) * __mult;
const std::size_t __coeff =
__gnu_cxx::__numeric_traits<std::size_t>::__max / __LDBL_MAX_EXP__;
__result = __hibits + (std::size_t)__ldval + __coeff * __exponent;
return __result;
}
};
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/functional_hash.h>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/functional_hash.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H

View file

@ -56,7 +56,8 @@
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
/**
* @ingroup tr1_math_spec_func
@ -295,9 +296,9 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
= std::numeric_limits<_Tp>::max_exponent10
* std::log(_Tp(10)) - _Tp(1);
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __coeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __n))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __k))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __n - __k));
_Tp __coeff = std::tr1::lgamma(_Tp(1 + __n))
- std::tr1::lgamma(_Tp(1 + __k))
- std::tr1::lgamma(_Tp(1 + __n - __k));
#else
_Tp __coeff = __log_gamma(_Tp(1 + __n))
- __log_gamma(_Tp(1 + __k))
@ -464,7 +465,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
{
const _Tp __hzeta = __hurwitz_zeta(_Tp(__n + 1), __x);
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __ln_nfact = std::_GLIBCXX_TR1::lgamma(_Tp(__n + 1));
const _Tp __ln_nfact = std::tr1::lgamma(_Tp(__n + 1));
#else
const _Tp __ln_nfact = __log_gamma(_Tp(__n + 1));
#endif
@ -479,7 +480,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_GAMMA_TCC

View file

@ -0,0 +1,58 @@
// TR1 hashtable.h header -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/hashtable.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _GLIBCXX_TR1_HASHTABLE_H
#define _GLIBCXX_TR1_HASHTABLE_H 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/hashtable>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/hashtable>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_HASHTABLE_H

View file

@ -44,12 +44,13 @@
// Section 6, pp. 555-566
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
#ifndef _TR1_HYPERGEOMETRIC_TCC
#define _TR1_HYPERGEOMETRIC_TCC 1
#ifndef _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
#define _GLIBCXX_TR1_HYPERGEOMETRIC_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -233,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__conf_hyperg(const _Tp __a, const _Tp __c, const _Tp __x)
{
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __c_nint = std::_GLIBCXX_TR1::nearbyint(__c);
const _Tp __c_nint = std::tr1::nearbyint(__c);
#else
const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
#endif
@ -735,9 +736,9 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__hyperg(const _Tp __a, const _Tp __b, const _Tp __c, const _Tp __x)
{
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __a_nint = std::_GLIBCXX_TR1::nearbyint(__a);
const _Tp __b_nint = std::_GLIBCXX_TR1::nearbyint(__b);
const _Tp __c_nint = std::_GLIBCXX_TR1::nearbyint(__c);
const _Tp __a_nint = std::tr1::nearbyint(__a);
const _Tp __b_nint = std::tr1::nearbyint(__b);
const _Tp __c_nint = std::tr1::nearbyint(__c);
#else
const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L));
const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L));
@ -782,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_HYPERGEOMETRIC_TCC
#endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC

View file

@ -1,6 +1,6 @@
// TR1 inttypes.h -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_INTTYPES_H
#define _TR1_INTTYPES_H 1
#ifndef _GLIBCXX_TR1_INTTYPES_H
#define _GLIBCXX_TR1_INTTYPES_H 1
#include <tr1/cinttypes>
#endif
#endif // _GLIBCXX_TR1_INTTYPES_H

View file

@ -47,14 +47,15 @@
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
// 2nd ed, pp. 252-254
#ifndef _TR1_LEGENDRE_FUNCTION_TCC
#define _TR1_LEGENDRE_FUNCTION_TCC 1
#ifndef _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
#define _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC 1
#include "special_function_util.h"
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -256,14 +257,14 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1));
const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3));
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lncirc = std::_GLIBCXX_TR1::log1p(-__x * __x);
const _Tp __lncirc = std::tr1::log1p(-__x * __x);
#else
const _Tp __lncirc = std::log(_Tp(1) - __x * __x);
#endif
// Gamma(m+1/2) / Gamma(m)
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lnpoch = std::_GLIBCXX_TR1::lgamma(_Tp(__m + _Tp(0.5L)))
- std::_GLIBCXX_TR1::lgamma(_Tp(__m));
const _Tp __lnpoch = std::tr1::lgamma(_Tp(__m + _Tp(0.5L)))
- std::tr1::lgamma(_Tp(__m));
#else
const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L)))
- __log_gamma(_Tp(__m));
@ -312,7 +313,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_LEGENDRE_FUNCTION_TCC
#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC

View file

@ -31,161 +31,161 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_MATH_H
#define _TR1_MATH_H 1
#ifndef _GLIBCXX_TR1_MATH_H
#define _GLIBCXX_TR1_MATH_H 1
#include <tr1/cmath>
#if _GLIBCXX_USE_C99_MATH_TR1
using std::_GLIBCXX_TR1::acos;
using std::_GLIBCXX_TR1::acosh;
using std::_GLIBCXX_TR1::asin;
using std::_GLIBCXX_TR1::asinh;
using std::_GLIBCXX_TR1::atan;
using std::_GLIBCXX_TR1::atan2;
using std::_GLIBCXX_TR1::atanh;
using std::_GLIBCXX_TR1::cbrt;
using std::_GLIBCXX_TR1::ceil;
using std::_GLIBCXX_TR1::copysign;
using std::_GLIBCXX_TR1::cos;
using std::_GLIBCXX_TR1::cosh;
using std::_GLIBCXX_TR1::erf;
using std::_GLIBCXX_TR1::erfc;
using std::_GLIBCXX_TR1::exp;
using std::_GLIBCXX_TR1::exp2;
using std::_GLIBCXX_TR1::expm1;
using std::_GLIBCXX_TR1::fabs;
using std::_GLIBCXX_TR1::fdim;
using std::_GLIBCXX_TR1::floor;
using std::_GLIBCXX_TR1::fma;
using std::_GLIBCXX_TR1::fmax;
using std::_GLIBCXX_TR1::fmin;
using std::_GLIBCXX_TR1::fmod;
using std::_GLIBCXX_TR1::frexp;
using std::_GLIBCXX_TR1::hypot;
using std::_GLIBCXX_TR1::ilogb;
using std::_GLIBCXX_TR1::ldexp;
using std::_GLIBCXX_TR1::lgamma;
using std::_GLIBCXX_TR1::llrint;
using std::_GLIBCXX_TR1::llround;
using std::_GLIBCXX_TR1::log;
using std::_GLIBCXX_TR1::log10;
using std::_GLIBCXX_TR1::log1p;
using std::_GLIBCXX_TR1::log2;
using std::_GLIBCXX_TR1::logb;
using std::_GLIBCXX_TR1::lrint;
using std::_GLIBCXX_TR1::lround;
using std::_GLIBCXX_TR1::nearbyint;
using std::_GLIBCXX_TR1::nextafter;
using std::_GLIBCXX_TR1::nexttoward;
using std::_GLIBCXX_TR1::pow;
using std::_GLIBCXX_TR1::remainder;
using std::_GLIBCXX_TR1::remquo;
using std::_GLIBCXX_TR1::rint;
using std::_GLIBCXX_TR1::round;
using std::_GLIBCXX_TR1::scalbln;
using std::_GLIBCXX_TR1::scalbn;
using std::_GLIBCXX_TR1::sin;
using std::_GLIBCXX_TR1::sinh;
using std::_GLIBCXX_TR1::sqrt;
using std::_GLIBCXX_TR1::tan;
using std::_GLIBCXX_TR1::tanh;
using std::_GLIBCXX_TR1::tgamma;
using std::_GLIBCXX_TR1::trunc;
using std::tr1::acos;
using std::tr1::acosh;
using std::tr1::asin;
using std::tr1::asinh;
using std::tr1::atan;
using std::tr1::atan2;
using std::tr1::atanh;
using std::tr1::cbrt;
using std::tr1::ceil;
using std::tr1::copysign;
using std::tr1::cos;
using std::tr1::cosh;
using std::tr1::erf;
using std::tr1::erfc;
using std::tr1::exp;
using std::tr1::exp2;
using std::tr1::expm1;
using std::tr1::fabs;
using std::tr1::fdim;
using std::tr1::floor;
using std::tr1::fma;
using std::tr1::fmax;
using std::tr1::fmin;
using std::tr1::fmod;
using std::tr1::frexp;
using std::tr1::hypot;
using std::tr1::ilogb;
using std::tr1::ldexp;
using std::tr1::lgamma;
using std::tr1::llrint;
using std::tr1::llround;
using std::tr1::log;
using std::tr1::log10;
using std::tr1::log1p;
using std::tr1::log2;
using std::tr1::logb;
using std::tr1::lrint;
using std::tr1::lround;
using std::tr1::nearbyint;
using std::tr1::nextafter;
using std::tr1::nexttoward;
using std::tr1::pow;
using std::tr1::remainder;
using std::tr1::remquo;
using std::tr1::rint;
using std::tr1::round;
using std::tr1::scalbln;
using std::tr1::scalbn;
using std::tr1::sin;
using std::tr1::sinh;
using std::tr1::sqrt;
using std::tr1::tan;
using std::tr1::tanh;
using std::tr1::tgamma;
using std::tr1::trunc;
#endif
using std::_GLIBCXX_TR1::assoc_laguerref;
using std::_GLIBCXX_TR1::assoc_laguerre;
using std::_GLIBCXX_TR1::assoc_laguerrel;
using std::tr1::assoc_laguerref;
using std::tr1::assoc_laguerre;
using std::tr1::assoc_laguerrel;
using std::_GLIBCXX_TR1::assoc_legendref;
using std::_GLIBCXX_TR1::assoc_legendre;
using std::_GLIBCXX_TR1::assoc_legendrel;
using std::tr1::assoc_legendref;
using std::tr1::assoc_legendre;
using std::tr1::assoc_legendrel;
using std::_GLIBCXX_TR1::betaf;
using std::_GLIBCXX_TR1::beta;
using std::_GLIBCXX_TR1::betal;
using std::tr1::betaf;
using std::tr1::beta;
using std::tr1::betal;
using std::_GLIBCXX_TR1::comp_ellint_1f;
using std::_GLIBCXX_TR1::comp_ellint_1;
using std::_GLIBCXX_TR1::comp_ellint_1l;
using std::tr1::comp_ellint_1f;
using std::tr1::comp_ellint_1;
using std::tr1::comp_ellint_1l;
using std::_GLIBCXX_TR1::comp_ellint_2f;
using std::_GLIBCXX_TR1::comp_ellint_2;
using std::_GLIBCXX_TR1::comp_ellint_2l;
using std::tr1::comp_ellint_2f;
using std::tr1::comp_ellint_2;
using std::tr1::comp_ellint_2l;
using std::_GLIBCXX_TR1::comp_ellint_3f;
using std::_GLIBCXX_TR1::comp_ellint_3;
using std::_GLIBCXX_TR1::comp_ellint_3l;
using std::tr1::comp_ellint_3f;
using std::tr1::comp_ellint_3;
using std::tr1::comp_ellint_3l;
using std::_GLIBCXX_TR1::conf_hypergf;
using std::_GLIBCXX_TR1::conf_hyperg;
using std::_GLIBCXX_TR1::conf_hypergl;
using std::tr1::conf_hypergf;
using std::tr1::conf_hyperg;
using std::tr1::conf_hypergl;
using std::_GLIBCXX_TR1::cyl_bessel_if;
using std::_GLIBCXX_TR1::cyl_bessel_i;
using std::_GLIBCXX_TR1::cyl_bessel_il;
using std::tr1::cyl_bessel_if;
using std::tr1::cyl_bessel_i;
using std::tr1::cyl_bessel_il;
using std::_GLIBCXX_TR1::cyl_bessel_jf;
using std::_GLIBCXX_TR1::cyl_bessel_j;
using std::_GLIBCXX_TR1::cyl_bessel_jl;
using std::tr1::cyl_bessel_jf;
using std::tr1::cyl_bessel_j;
using std::tr1::cyl_bessel_jl;
using std::_GLIBCXX_TR1::cyl_bessel_kf;
using std::_GLIBCXX_TR1::cyl_bessel_k;
using std::_GLIBCXX_TR1::cyl_bessel_kl;
using std::tr1::cyl_bessel_kf;
using std::tr1::cyl_bessel_k;
using std::tr1::cyl_bessel_kl;
using std::_GLIBCXX_TR1::cyl_neumannf;
using std::_GLIBCXX_TR1::cyl_neumann;
using std::_GLIBCXX_TR1::cyl_neumannl;
using std::tr1::cyl_neumannf;
using std::tr1::cyl_neumann;
using std::tr1::cyl_neumannl;
using std::_GLIBCXX_TR1::ellint_1f;
using std::_GLIBCXX_TR1::ellint_1;
using std::_GLIBCXX_TR1::ellint_1l;
using std::tr1::ellint_1f;
using std::tr1::ellint_1;
using std::tr1::ellint_1l;
using std::_GLIBCXX_TR1::ellint_2f;
using std::_GLIBCXX_TR1::ellint_2;
using std::_GLIBCXX_TR1::ellint_2l;
using std::tr1::ellint_2f;
using std::tr1::ellint_2;
using std::tr1::ellint_2l;
using std::_GLIBCXX_TR1::ellint_3f;
using std::_GLIBCXX_TR1::ellint_3;
using std::_GLIBCXX_TR1::ellint_3l;
using std::tr1::ellint_3f;
using std::tr1::ellint_3;
using std::tr1::ellint_3l;
using std::_GLIBCXX_TR1::expintf;
using std::_GLIBCXX_TR1::expint;
using std::_GLIBCXX_TR1::expintl;
using std::tr1::expintf;
using std::tr1::expint;
using std::tr1::expintl;
using std::_GLIBCXX_TR1::hermitef;
using std::_GLIBCXX_TR1::hermite;
using std::_GLIBCXX_TR1::hermitel;
using std::tr1::hermitef;
using std::tr1::hermite;
using std::tr1::hermitel;
using std::_GLIBCXX_TR1::hypergf;
using std::_GLIBCXX_TR1::hyperg;
using std::_GLIBCXX_TR1::hypergl;
using std::tr1::hypergf;
using std::tr1::hyperg;
using std::tr1::hypergl;
using std::_GLIBCXX_TR1::laguerref;
using std::_GLIBCXX_TR1::laguerre;
using std::_GLIBCXX_TR1::laguerrel;
using std::tr1::laguerref;
using std::tr1::laguerre;
using std::tr1::laguerrel;
using std::_GLIBCXX_TR1::legendref;
using std::_GLIBCXX_TR1::legendre;
using std::_GLIBCXX_TR1::legendrel;
using std::tr1::legendref;
using std::tr1::legendre;
using std::tr1::legendrel;
using std::_GLIBCXX_TR1::riemann_zetaf;
using std::_GLIBCXX_TR1::riemann_zeta;
using std::_GLIBCXX_TR1::riemann_zetal;
using std::tr1::riemann_zetaf;
using std::tr1::riemann_zeta;
using std::tr1::riemann_zetal;
using std::_GLIBCXX_TR1::sph_besself;
using std::_GLIBCXX_TR1::sph_bessel;
using std::_GLIBCXX_TR1::sph_bessell;
using std::tr1::sph_besself;
using std::tr1::sph_bessel;
using std::tr1::sph_bessell;
using std::_GLIBCXX_TR1::sph_legendref;
using std::_GLIBCXX_TR1::sph_legendre;
using std::_GLIBCXX_TR1::sph_legendrel;
using std::tr1::sph_legendref;
using std::tr1::sph_legendre;
using std::tr1::sph_legendrel;
using std::_GLIBCXX_TR1::sph_neumannf;
using std::_GLIBCXX_TR1::sph_neumann;
using std::_GLIBCXX_TR1::sph_neumannl;
using std::tr1::sph_neumannf;
using std::tr1::sph_neumann;
using std::tr1::sph_neumannl;
#endif
#endif // _GLIBCXX_TR1_MATH_H

View file

@ -32,24 +32,40 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_MEMORY
#define _TR1_MEMORY 1
#ifndef _GLIBCXX_TR1_MEMORY
#define _GLIBCXX_TR1_MEMORY 1
#include <cstddef> // std::size_t
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <memory>
#include <exception> // std::exception
#include <new> // std::bad_alloc
#include <typeinfo> // std::type_info in get_deleter
#include <bits/stl_algobase.h> // std::swap
#include <iosfwd> // std::basic_ostream
#include <memory>
#include <ext/atomicity.h>
#include <ext/concurrence.h>
#include <bits/functexcept.h>
#include <bits/stl_function.h> // std::less
#include <debug/debug.h>
#include <tr1/type_traits>
#include <tr1/type_traits> // tr1::add_reference
#include <tr1/boost_shared_ptr.h>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/boost_shared_ptr.h>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/boost_shared_ptr.h>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_MEMORY

View file

@ -49,14 +49,15 @@
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
// 2nd ed, pp. 246-249.
#ifndef _TR1_MODIFIED_BESSEL_FUNC_TCC
#define _TR1_MODIFIED_BESSEL_FUNC_TCC 1
#ifndef _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
#define _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC 1
#include "special_function_util.h"
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -444,7 +445,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_MODIFIED_BESSEL_FUNC_TCC
#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC

View file

@ -42,12 +42,13 @@
// Ed. Milton Abramowitz and Irene A. Stegun,
// Dover Publications, Section 22 pp. 773-802
#ifndef _TR1_POLY_HERMITE_TCC
#define _TR1_POLY_HERMITE_TCC 1
#ifndef _GLIBCXX_TR1_POLY_HERMITE_TCC
#define _GLIBCXX_TR1_POLY_HERMITE_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -132,7 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_POLY_HERMITE_TCC
#endif // _GLIBCXX_TR1_POLY_HERMITE_TCC

View file

@ -44,12 +44,13 @@
// Section 13, pp. 509-510, Section 22 pp. 773-802
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
#ifndef _TR1_POLY_LAGUERRE_TCC
#define _TR1_POLY_LAGUERRE_TCC 1
#ifndef _GLIBCXX_TR1_POLY_LAGUERRE_TCC
#define _GLIBCXX_TR1_POLY_LAGUERRE_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -94,8 +95,8 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
* __eta * __eta * __cos2th * __sin2th;
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lg_b = std::_GLIBCXX_TR1::lgamma(_Tp(__n) + __b);
const _Tp __lnfact = std::_GLIBCXX_TR1::lgamma(_Tp(__n + 1));
const _Tp __lg_b = std::tr1::lgamma(_Tp(__n) + __b);
const _Tp __lnfact = std::tr1::lgamma(_Tp(__n + 1));
#else
const _Tp __lg_b = __log_gamma(_Tp(__n) + __b);
const _Tp __lnfact = __log_gamma(_Tp(__n + 1));
@ -337,7 +338,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_POLY_LAGUERRE_TCC
#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -45,14 +45,15 @@
// (3) Gamma, Exploring Euler's Constant, Julian Havil,
// Princeton, 2003.
#ifndef _TR1_RIEMANN_ZETA_TCC
#define _TR1_RIEMANN_ZETA_TCC 1
#ifndef _GLIBCXX_TR1_RIEMANN_ZETA_TCC
#define _GLIBCXX_TR1_RIEMANN_ZETA_TCC 1
#include "special_function_util.h"
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
// [5.2] Special functions
@ -175,7 +176,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
if (__s < _Tp(0))
{
#if _GLIBCXX_USE_C99_MATH_TR1
if (std::_GLIBCXX_TR1::fmod(__s,_Tp(2)) == _Tp(0))
if (std::tr1::fmod(__s,_Tp(2)) == _Tp(0))
return _Tp(0);
else
#endif
@ -185,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
* __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::exp(std::_GLIBCXX_TR1::lgamma(_Tp(1) - __s))
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
@ -204,9 +205,9 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
for (unsigned int __j = 0; __j <= __i; ++__j)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bincoeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __j))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i - __j));
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
- std::tr1::lgamma(_Tp(1 + __j))
- std::tr1::lgamma(_Tp(1 + __i - __j));
#else
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
- __log_gamma(_Tp(1 + __j))
@ -309,7 +310,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::exp(std::_GLIBCXX_TR1::lgamma(_Tp(1) - __s))
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
@ -332,7 +333,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
* __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::_GLIBCXX_TR1::tgamma(_Tp(1) - __s)
* std::tr1::tgamma(_Tp(1) - __s)
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
@ -387,9 +388,9 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
for (unsigned int __j = 0; __j <= __i; ++__j)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bincoeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __j))
- std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i - __j));
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
- std::tr1::lgamma(_Tp(1 + __j))
- std::tr1::lgamma(_Tp(1 + __i - __j));
#else
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
- __log_gamma(_Tp(1 + __j))
@ -443,7 +444,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_RIEMANN_ZETA_TCC
#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC

View file

@ -39,13 +39,14 @@
// Written by Edward Smith-Rowland based on numerous mathematics books.
#ifndef _TR1_SPECIAL_FUNCTION_UTIL_H
#define _TR1_SPECIAL_FUNCTION_UTIL_H 1
#ifndef _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
#define _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H 1
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace tr1
{
namespace __detail
{
@ -148,8 +149,8 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
} // namespace __detail
_GLIBCXX_END_NAMESPACE
}
}
#endif // _TR1_SPECIAL_FUNCTION_UTIL_H
#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H

View file

@ -31,8 +31,8 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_STDLIB_H
#define _TR1_STDLIB_H 1
#ifndef _GLIBCXX_TR1_STDLIB_H
#define _GLIBCXX_TR1_STDLIB_H 1
#include <tr1/cstdlib>
@ -40,17 +40,18 @@
#if _GLIBCXX_USE_C99
using std::_GLIBCXX_TR1::atoll;
using std::_GLIBCXX_TR1::strtoll;
using std::_GLIBCXX_TR1::strtoull;
using std::tr1::atoll;
using std::tr1::strtoll;
using std::tr1::strtoull;
using std::_GLIBCXX_TR1::abs;
using std::tr1::abs;
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
using std::_GLIBCXX_TR1::div;
using std::tr1::div;
#endif
#endif
#endif
#endif
#endif // _GLIBCXX_TR1_STDLIB_H

View file

@ -1,6 +1,6 @@
// TR1 tgmath.h -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_TGMATH_H
#define _TR1_TGMATH_H 1
#ifndef _GLIBCXX_TR1_TGMATH_H
#define _GLIBCXX_TR1_TGMATH_H 1
#include <tr1/ctgmath>
#endif
#endif // _GLIBCXX_TR1_TGMATH_H

View file

@ -34,405 +34,29 @@
// Chris Jefferson <chris@bubblescope.net>
// Variadic Templates support by Douglas Gregor <doug.gregor@gmail.com>
#ifndef _TR1_TUPLE
#define _TR1_TUPLE 1
#ifndef _GLIBCXX_TR1_TUPLE
#define _GLIBCXX_TR1_TUPLE 1
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <utility>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
template<typename _Tp>
class reference_wrapper;
// Adds a const reference to a non-reference type.
template<typename _Tp>
struct __add_c_ref
{ typedef const _Tp& type; };
template<typename _Tp>
struct __add_c_ref<_Tp&>
{ typedef _Tp& type; };
// Adds a reference to a non-reference type.
template<typename _Tp>
struct __add_ref
{ typedef _Tp& type; };
template<typename _Tp>
struct __add_ref<_Tp&>
{ typedef _Tp& type; };
/**
* @if maint
* Contains the actual implementation of the @c tuple template, stored
* as a recursive inheritance hierarchy from the first element (most
* derived class) to the last (least derived class). The @c Idx
* parameter gives the 0-based index of the element stored at this
* point in the hierarchy; we use it to implement a constant-time
* get() operation.
* @endif
*/
template<int _Idx, typename... _Elements>
struct _Tuple_impl;
/**
* @if maint
* Zero-element tuple implementation. This is the basis case for the
* inheritance recursion.
* @endif maint
*/
template<int _Idx>
struct _Tuple_impl<_Idx> { };
/**
* @if maint
* Recursive tuple implementation. Here we store the @c Head element
* and derive from a @c Tuple_impl containing the remaining elements
* (which contains the @c Tail).
* @endif
*/
template<int _Idx, typename _Head, typename... _Tail>
struct _Tuple_impl<_Idx, _Head, _Tail...>
: public _Tuple_impl<_Idx + 1, _Tail...>
{
typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
_Head _M_head;
_Inherited& _M_tail() { return *this; }
const _Inherited& _M_tail() const { return *this; }
_Tuple_impl() : _Inherited(), _M_head() { }
explicit
_Tuple_impl(typename __add_c_ref<_Head>::type __head,
typename __add_c_ref<_Tail>::type... __tail)
: _Inherited(__tail...), _M_head(__head) { }
template<typename... _UElements>
_Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
: _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
_Tuple_impl(const _Tuple_impl& __in)
: _Inherited(__in._M_tail()), _M_head(__in._M_head) { }
template<typename... _UElements>
_Tuple_impl&
operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
{
_M_head = __in._M_head;
_M_tail() = __in._M_tail();
return *this;
}
_Tuple_impl&
operator=(const _Tuple_impl& __in)
{
_M_head = __in._M_head;
_M_tail() = __in._M_tail();
return *this;
}
};
template<typename... _Elements>
class tuple : public _Tuple_impl<0, _Elements...>
{
typedef _Tuple_impl<0, _Elements...> _Inherited;
public:
tuple() : _Inherited() { }
explicit
tuple(typename __add_c_ref<_Elements>::type... __elements)
: _Inherited(__elements...) { }
template<typename... _UElements>
tuple(const tuple<_UElements...>& __in)
: _Inherited(__in) { }
tuple(const tuple& __in)
: _Inherited(__in) { }
template<typename... _UElements>
tuple&
operator=(const tuple<_UElements...>& __in)
{
static_cast<_Inherited&>(*this) = __in;
return *this;
}
tuple&
operator=(const tuple& __in)
{
static_cast<_Inherited&>(*this) = __in;
return *this;
}
};
template<> class tuple<> { };
// 2-element tuple, with construction and assignment from a pair.
template<typename _T1, typename _T2>
class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
{
typedef _Tuple_impl<0, _T1, _T2> _Inherited;
public:
tuple() : _Inherited() { }
explicit
tuple(typename __add_c_ref<_T1>::type __a1,
typename __add_c_ref<_T2>::type __a2)
: _Inherited(__a1, __a2) { }
template<typename _U1, typename _U2>
tuple(const tuple<_U1, _U2>& __in)
: _Inherited(__in) { }
tuple(const tuple& __in)
: _Inherited(__in) { }
template<typename _U1, typename _U2>
tuple(const pair<_U1, _U2>& __in)
: _Inherited(_Tuple_impl<0,
typename __add_c_ref<_U1>::type,
typename __add_c_ref<_U2>::type>(__in.first,
__in.second))
{ }
template<typename _U1, typename _U2>
tuple&
operator=(const tuple<_U1, _U2>& __in)
{
static_cast<_Inherited&>(*this) = __in;
return *this;
}
tuple&
operator=(const tuple& __in)
{
static_cast<_Inherited&>(*this) = __in;
return *this;
}
template<typename _U1, typename _U2>
tuple&
operator=(const pair<_U1, _U2>& __in)
{
this->_M_head = __in.first;
this->_M_tail()._M_head = __in.second;
return *this;
}
};
/// Gives the type of the ith element of a given tuple type.
template<int __i, typename _Tp>
struct tuple_element;
/**
* @if maint
* Recursive case for tuple_element: strip off the first element in
* the tuple and retrieve the (i-1)th element of the remaining tuple.
* @endif
*/
template<int __i, typename _Head, typename... _Tail>
struct tuple_element<__i, tuple<_Head, _Tail...> >
: tuple_element<__i - 1, tuple<_Tail...> > { };
/**
* @if maint
* Basis case for tuple_element: The first element is the one we're seeking.
* @endif
*/
template<typename _Head, typename... _Tail>
struct tuple_element<0, tuple<_Head, _Tail...> >
{
typedef _Head type;
};
/// Finds the size of a given tuple type.
template<typename _Tp>
struct tuple_size;
/// @brief class tuple_size
template<typename... _Elements>
struct tuple_size<tuple<_Elements...> >
{
static const int value = sizeof...(_Elements);
};
template<typename... _Elements>
const int tuple_size<tuple<_Elements...> >::value;
template<int __i, typename _Head, typename... _Tail>
inline typename __add_ref<_Head>::type
__get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t)
{
return __t._M_head;
}
template<int __i, typename _Head, typename... _Tail>
inline typename __add_c_ref<_Head>::type
__get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t)
{
return __t._M_head;
}
// Return a reference (const reference) to the ith element of a tuple.
// Any const or non-const ref elements are returned with their original type.
template<int __i, typename... _Elements>
inline typename __add_ref<
typename tuple_element<__i, tuple<_Elements...> >::type
>::type
get(tuple<_Elements...>& __t)
{
return __get_helper<__i>(__t);
}
template<int __i, typename... _Elements>
inline typename __add_c_ref<
typename tuple_element<__i, tuple<_Elements...> >::type
>::type
get(const tuple<_Elements...>& __t)
{
return __get_helper<__i>(__t);
}
// This class helps construct the various comparison operations on tuples
template<int __check_equal_size, int __i, int __j,
typename _Tp, typename _Up>
struct __tuple_compare;
template<int __i, int __j, typename _Tp, typename _Up>
struct __tuple_compare<0, __i, __j, _Tp, _Up>
{
static bool __eq(const _Tp& __t, const _Up& __u)
{
return (get<__i>(__t) == get<__i>(__u) &&
__tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u));
}
static bool __less(const _Tp& __t, const _Up& __u)
{
return ((get<__i>(__t) < get<__i>(__u))
|| !(get<__i>(__u) < get<__i>(__t)) &&
__tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u));
}
};
template<int __i, typename _Tp, typename _Up>
struct __tuple_compare<0, __i, __i, _Tp, _Up>
{
static bool __eq(const _Tp&, const _Up&)
{ return true; }
static bool __less(const _Tp&, const _Up&)
{ return false; }
};
template<typename... _TElements, typename... _UElements>
bool
operator==(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{
typedef tuple<_TElements...> _Tp;
typedef tuple<_UElements...> _Up;
return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value,
0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
}
template<typename... _TElements, typename... _UElements>
bool
operator<(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{
typedef tuple<_TElements...> _Tp;
typedef tuple<_UElements...> _Up;
return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value,
0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
}
template<typename... _TElements, typename... _UElements>
bool
operator!=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__t == __u); }
template<typename... _TElements, typename... _UElements>
bool
operator>(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return __u < __t; }
template<typename... _TElements, typename... _UElements>
bool
operator<=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__u < __t); }
template<typename... _TElements, typename... _UElements>
bool
operator>=(const tuple<_TElements...>& __t,
const tuple<_UElements...>& __u)
{ return !(__t < __u); }
// Helper which adds a reference to a type when given a reference_wrapper
template<typename _Tp>
struct __strip_reference_wrapper
{
typedef _Tp __type;
};
template<typename _Tp>
struct __strip_reference_wrapper<reference_wrapper<_Tp> >
{
typedef _Tp& __type;
};
template<typename _Tp>
struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
{
typedef _Tp& __type;
};
template<typename... _Elements>
inline tuple<typename __strip_reference_wrapper<_Elements>::__type...>
make_tuple(_Elements... __args)
{
typedef tuple<typename __strip_reference_wrapper<_Elements>::__type...>
__result_type;
return __result_type(__args...);
}
template<typename... _Elements>
inline tuple<_Elements&...>
tie(_Elements&... __args)
{
return tuple<_Elements&...>(__args...);
}
// A class (and instance) which can be used in 'tie' when an element
// of a tuple is not required
struct _Swallow_assign
{
template<class _Tp>
_Swallow_assign&
operator=(const _Tp&)
{ return *this; }
};
// TODO: Put this in some kind of shared file.
namespace
{
_Swallow_assign ignore;
}; // anonymous namespace
_GLIBCXX_END_NAMESPACE
}
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/tuple>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/tuple>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_TUPLE

View file

@ -31,26 +31,35 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_TYPE_TRAITS
#define _TR1_TYPE_TRAITS 1
#ifndef _GLIBCXX_TR1_TYPE_TRAITS
#define _GLIBCXX_TR1_TYPE_TRAITS 1
#pragma GCC system_header
#include <bits/c++config.h>
#include <tr1/type_traitsfwd.h>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cstddef>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/type_traits>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/type_traits>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// For use in __is_convertible_simple.
struct __sfinae_types
{
typedef char __one;
typedef struct { char __arr[2]; } __two;
};
namespace tr1
{
#define _DEFINE_SPEC_BODY(_Value) \
: public integral_constant<bool, _Value> { };
@ -59,247 +68,12 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
struct _Spec \
_DEFINE_SPEC_BODY(_Value)
#define _DEFINE_SPEC_1_HELPER(_Spec, _Value) \
template<typename _Tp> \
struct _Spec \
_DEFINE_SPEC_BODY(_Value)
#define _DEFINE_SPEC_2_HELPER(_Spec, _Value) \
template<typename _Tp, typename _Cp> \
struct _Spec \
_DEFINE_SPEC_BODY(_Value)
#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
_DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type>, _Value) \
_DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const>, _Value) \
_DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type volatile>, _Value) \
_DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const volatile>, _Value)
/// @brief helper classes [4.3].
template<typename _Tp, _Tp __v>
struct integral_constant
{
static const _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
};
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
template<typename _Tp, _Tp __v>
const _Tp integral_constant<_Tp, __v>::value;
/// @brief primary type categories [4.5.1].
template<typename>
struct is_void
: public false_type { };
_DEFINE_SPEC(0, is_void, void, true)
template<typename>
struct is_integral
: public false_type { };
_DEFINE_SPEC(0, is_integral, bool, true)
_DEFINE_SPEC(0, is_integral, char, true)
_DEFINE_SPEC(0, is_integral, signed char, true)
_DEFINE_SPEC(0, is_integral, unsigned char, true)
#ifdef _GLIBCXX_USE_WCHAR_T
_DEFINE_SPEC(0, is_integral, wchar_t, true)
#endif
_DEFINE_SPEC(0, is_integral, short, true)
_DEFINE_SPEC(0, is_integral, unsigned short, true)
_DEFINE_SPEC(0, is_integral, int, true)
_DEFINE_SPEC(0, is_integral, unsigned int, true)
_DEFINE_SPEC(0, is_integral, long, true)
_DEFINE_SPEC(0, is_integral, unsigned long, true)
_DEFINE_SPEC(0, is_integral, long long, true)
_DEFINE_SPEC(0, is_integral, unsigned long long, true)
template<typename>
struct is_floating_point
: public false_type { };
_DEFINE_SPEC(0, is_floating_point, float, true)
_DEFINE_SPEC(0, is_floating_point, double, true)
_DEFINE_SPEC(0, is_floating_point, long double, true)
template<typename>
struct is_array
: public false_type { };
template<typename _Tp, std::size_t _Size>
struct is_array<_Tp[_Size]>
: public true_type { };
template<typename _Tp>
struct is_array<_Tp[]>
: public true_type { };
template<typename>
struct is_pointer
: public false_type { };
_DEFINE_SPEC(1, is_pointer, _Tp*, true)
template<typename>
struct is_reference
: public false_type { };
template<typename _Tp>
struct is_reference<_Tp&>
: public true_type { };
template<typename>
struct is_member_object_pointer
: public false_type { };
_DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*,
!is_function<_Tp>::value)
template<typename>
struct is_member_function_pointer
: public false_type { };
_DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
is_function<_Tp>::value)
template<typename _Tp>
struct is_enum
: public integral_constant<bool, __is_enum(_Tp)>
{ };
template<typename _Tp>
struct is_union
: public integral_constant<bool, __is_union(_Tp)>
{ };
template<typename _Tp>
struct is_class
: public integral_constant<bool, __is_class(_Tp)>
{ };
template<typename>
struct __is_function_helper
: public false_type { };
template<typename _Res, typename... _ArgTypes>
struct __is_function_helper<_Res(_ArgTypes...)>
: public true_type { };
template<typename _Res, typename... _ArgTypes>
struct __is_function_helper<_Res(_ArgTypes......)>
: public true_type { };
template<typename _Tp>
struct is_function
: public integral_constant<bool, (__is_function_helper<typename
remove_cv<_Tp>::type>::value)>
{ };
/// @brief composite type traits [4.5.2].
template<typename _Tp>
struct is_arithmetic
: public integral_constant<bool, (is_integral<_Tp>::value
|| is_floating_point<_Tp>::value)>
{ };
template<typename _Tp>
struct is_fundamental
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|| is_void<_Tp>::value)>
{ };
template<typename _Tp>
struct is_object
: public integral_constant<bool, !(is_function<_Tp>::value
|| is_reference<_Tp>::value
|| is_void<_Tp>::value)>
{ };
template<typename _Tp>
struct is_scalar
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|| is_enum<_Tp>::value
|| is_pointer<_Tp>::value
|| is_member_pointer<_Tp>::value)>
{ };
template<typename _Tp>
struct is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> { };
template<typename _Tp>
struct is_member_pointer
: public integral_constant<bool,
(is_member_object_pointer<_Tp>::value
|| is_member_function_pointer<_Tp>::value)>
{ };
/// @brief type properties [4.5.3].
template<typename>
struct is_const
: public false_type { };
template<typename _Tp>
struct is_const<_Tp const>
: public true_type { };
template<typename>
struct is_volatile
: public false_type { };
template<typename _Tp>
struct is_volatile<_Tp volatile>
: public true_type { };
template<typename _Tp>
struct is_pod
: public integral_constant<bool, __is_pod(_Tp) || is_void<_Tp>::value>
{ };
template<typename _Tp>
struct is_empty
: public integral_constant<bool, __is_empty(_Tp)>
{ };
template<typename _Tp>
struct is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)>
{ };
template<typename _Tp>
struct is_abstract
: public integral_constant<bool, __is_abstract(_Tp)>
{ };
template<typename _Tp>
struct has_trivial_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_trivial_copy
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_trivial_assign
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_trivial_destructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_nothrow_constructor
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_nothrow_copy
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_nothrow_assign
: public integral_constant<bool, is_pod<_Tp>::value> { };
template<typename _Tp>
struct has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)>
{ };
template<typename>
struct is_signed
: public false_type { };
@ -319,47 +93,44 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_DEFINE_SPEC(0, is_unsigned, unsigned long long, true)
template<typename _Tp>
struct alignment_of
: public integral_constant<std::size_t, __alignof__(_Tp)> { };
template<typename>
struct rank
: public integral_constant<std::size_t, 0> { };
template<typename _Tp, std::size_t _Size>
struct rank<_Tp[_Size]>
: public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
template<typename _Tp>
struct rank<_Tp[]>
: public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
template<typename, unsigned>
struct extent
: public integral_constant<std::size_t, 0> { };
template<typename _Tp, unsigned _Uint, std::size_t _Size>
struct extent<_Tp[_Size], _Uint>
: public integral_constant<std::size_t,
_Uint == 0 ? _Size : extent<_Tp,
_Uint - 1>::value>
struct is_pod
: public integral_constant<bool, __is_pod(_Tp) || is_void<_Tp>::value>
{ };
template<typename _Tp, unsigned _Uint>
struct extent<_Tp[], _Uint>
: public integral_constant<std::size_t,
_Uint == 0 ? 0 : extent<_Tp,
_Uint - 1>::value>
template<typename _Tp>
struct has_trivial_constructor
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
/// @brief relationships between types [4.6].
template<typename, typename>
struct is_same
: public false_type { };
template<typename _Tp>
struct is_same<_Tp, _Tp>
: public true_type { };
struct has_trivial_copy
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Tp>
struct has_trivial_assign
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Tp>
struct has_trivial_destructor
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Tp>
struct has_nothrow_constructor
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Tp>
struct has_nothrow_copy
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Tp>
struct has_nothrow_assign
: public integral_constant<bool, is_pod<_Tp>::value>
{ };
template<typename _Base, typename _Derived>
struct __is_base_of_helper
@ -427,188 +198,10 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__is_convertible_helper<_From, _To>::__value>
{ };
/// @brief const-volatile modifications [4.7.1].
template<typename _Tp>
struct remove_const
{ typedef _Tp type; };
template<typename _Tp>
struct remove_const<_Tp const>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_volatile
{ typedef _Tp type; };
template<typename _Tp>
struct remove_volatile<_Tp volatile>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_cv
{
typedef typename
remove_const<typename remove_volatile<_Tp>::type>::type type;
};
template<typename _Tp>
struct add_const
{ typedef _Tp const type; };
template<typename _Tp>
struct add_volatile
{ typedef _Tp volatile type; };
template<typename _Tp>
struct add_cv
{
typedef typename
add_const<typename add_volatile<_Tp>::type>::type type;
};
/// @brief reference modifications [4.7.2].
template<typename _Tp>
struct remove_reference
{ typedef _Tp type; };
template<typename _Tp>
struct remove_reference<_Tp&>
{ typedef _Tp type; };
// NB: Careful with reference to void.
template<typename _Tp, bool = (is_void<_Tp>::value
|| is_reference<_Tp>::value)>
struct __add_reference_helper
{ typedef _Tp& type; };
template<typename _Tp>
struct __add_reference_helper<_Tp, true>
{ typedef _Tp type; };
template<typename _Tp>
struct add_reference
: public __add_reference_helper<_Tp>
{ };
/// @brief array modifications [4.7.3].
template<typename _Tp>
struct remove_extent
{ typedef _Tp type; };
template<typename _Tp, std::size_t _Size>
struct remove_extent<_Tp[_Size]>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_extent<_Tp[]>
{ typedef _Tp type; };
template<typename _Tp>
struct remove_all_extents
{ typedef _Tp type; };
template<typename _Tp, std::size_t _Size>
struct remove_all_extents<_Tp[_Size]>
{ typedef typename remove_all_extents<_Tp>::type type; };
template<typename _Tp>
struct remove_all_extents<_Tp[]>
{ typedef typename remove_all_extents<_Tp>::type type; };
/// @brief pointer modifications [4.7.4].
#undef _DEFINE_SPEC_BODY
#define _DEFINE_SPEC_BODY(_Value) \
{ typedef _Tp type; };
template<typename _Tp>
struct remove_pointer
{ typedef _Tp type; };
_DEFINE_SPEC(1, remove_pointer, _Tp*, false)
template<typename _Tp>
struct add_pointer
{ typedef typename remove_reference<_Tp>::type* type; };
/// @brief other transformations [4.8].
// Due to c++/19163 and c++/17743, for the time being we cannot use
// the correct, neat implementation :-(
//
// template<std::size_t _Len, std::size_t _Align>
// struct aligned_storage
// { typedef char type[_Len] __attribute__((__aligned__(_Align))); }
//
// Temporary workaround, useful for Align up to 32:
template<std::size_t, std::size_t>
struct aligned_storage { };
template<std::size_t _Len>
struct aligned_storage<_Len, 1>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(1)));
};
};
template<std::size_t _Len>
struct aligned_storage<_Len, 2>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(2)));
};
};
template<std::size_t _Len>
struct aligned_storage<_Len, 4>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(4)));
};
};
template<std::size_t _Len>
struct aligned_storage<_Len, 8>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(8)));
};
};
template<std::size_t _Len>
struct aligned_storage<_Len, 16>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(16)));
};
};
template<std::size_t _Len>
struct aligned_storage<_Len, 32>
{
union type
{
unsigned char __data[_Len];
char __align __attribute__((__aligned__(32)));
};
};
#undef _DEFINE_SPEC_0_HELPER
#undef _DEFINE_SPEC_1_HELPER
#undef _DEFINE_SPEC_2_HELPER
#undef _DEFINE_SPEC
#undef _DEFINE_SPEC_BODY
_GLIBCXX_END_NAMESPACE
}
}
#endif
#endif // _GLIBCXX_TR1_TYPE_TRAITS

View file

@ -31,206 +31,37 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_UNORDERED_MAP
#define _TR1_UNORDERED_MAP 1
#ifndef _GLIBCXX_TR1_UNORDERED_MAP
#define _GLIBCXX_TR1_UNORDERED_MAP 1
#include <tr1/hashtable>
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cmath>
#include <string>
#include <utility>
#include <algorithm> // lower_bound
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <tr1/type_traits>
#include <tr1/functional_hash.h>
#include <tr1/hashtable.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/unordered_map>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/unordered_map>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
// XXX When we get typedef templates these class definitions
// will be unnecessary.
template<class _Key, class _Tp,
class _Hash = hash<_Key>,
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
bool __cache_hash_code = false>
class __unordered_map
: public _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, false, true>
{
typedef _Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc,
std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, false, true>
_Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
__unordered_map(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(),
__eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
{ }
template<typename _InputIterator>
__unordered_map(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(),
__eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
{ }
};
template<class _Key, class _Tp,
class _Hash = hash<_Key>,
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> >,
bool __cache_hash_code = false>
class __unordered_multimap
: public _Hashtable<_Key, std::pair<const _Key, _Tp>,
_Alloc,
std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, false, false>
{
typedef _Hashtable<_Key, std::pair<const _Key, _Tp>,
_Alloc,
std::_Select1st<std::pair<const _Key, _Tp> >, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, false, false>
_Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
__unordered_multimap(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(),
__eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
{ }
template<typename _InputIterator>
__unordered_multimap(_InputIterator __f, _InputIterator __l,
typename _Base::size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(),
__eql, std::_Select1st<std::pair<const _Key, _Tp> >(), __a)
{ }
};
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
bool __cache_hash_code>
inline void
swap(__unordered_map<_Key, _Tp, _Hash, _Pred,
_Alloc, __cache_hash_code>& __x,
__unordered_map<_Key, _Tp, _Hash, _Pred,
_Alloc, __cache_hash_code>& __y)
{ __x.swap(__y); }
template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
bool __cache_hash_code>
inline void
swap(__unordered_multimap<_Key, _Tp, _Hash, _Pred,
_Alloc, __cache_hash_code>& __x,
__unordered_multimap<_Key, _Tp, _Hash, _Pred,
_Alloc, __cache_hash_code>& __y)
{ __x.swap(__y); }
template<class _Key, class _Tp,
class _Hash = hash<_Key>,
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_map
: public __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
{
typedef __unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
unordered_map(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a)
{ }
template<typename _InputIterator>
unordered_map(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a)
{ }
};
template<class _Key, class _Tp,
class _Hash = hash<_Key>,
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_multimap
: public __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
{
typedef __unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
unordered_multimap(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a)
{ }
template<typename _InputIterator>
unordered_multimap(_InputIterator __f, _InputIterator __l,
typename _Base::size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a)
{ }
};
_GLIBCXX_END_NAMESPACE
}
#endif // _TR1_UNORDERED_MAP
#endif // _GLIBCXX_TR1_UNORDERED_MAP

View file

@ -31,204 +31,37 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_UNORDERED_SET
#define _TR1_UNORDERED_SET 1
#ifndef _GLIBCXX_TR1_UNORDERED_SET
#define _GLIBCXX_TR1_UNORDERED_SET 1
#include <tr1/hashtable>
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <cmath>
#include <string>
#include <utility>
#include <algorithm> // lower_bound
#include <bits/allocator.h>
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <tr1/type_traits>
#include <tr1/functional_hash.h>
#include <tr1/hashtable.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/unordered_set>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/unordered_set>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
// XXX When we get typedef templates these class definitions
// will be unnecessary.
template<class _Value,
class _Hash = hash<_Value>,
class _Pred = std::equal_to<_Value>,
class _Alloc = std::allocator<_Value>,
bool __cache_hash_code = false>
class __unordered_set
: public _Hashtable<_Value, _Value, _Alloc,
std::_Identity<_Value>, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, true, true>
{
typedef _Hashtable<_Value, _Value, _Alloc,
std::_Identity<_Value>, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, true, true>
_Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
__unordered_set(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(), __eql,
std::_Identity<_Value>(), __a)
{ }
template<typename _InputIterator>
__unordered_set(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(), __eql,
std::_Identity<_Value>(), __a)
{ }
};
template<class _Value,
class _Hash = hash<_Value>,
class _Pred = std::equal_to<_Value>,
class _Alloc = std::allocator<_Value>,
bool __cache_hash_code = false>
class __unordered_multiset
: public _Hashtable<_Value, _Value, _Alloc,
std::_Identity<_Value>, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, true, false>
{
typedef _Hashtable<_Value, _Value, _Alloc,
std::_Identity<_Value>, _Pred,
_Hash, __detail::_Mod_range_hashing,
__detail::_Default_ranged_hash,
__detail::_Prime_rehash_policy,
__cache_hash_code, true, false>
_Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
__unordered_multiset(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(), __eql,
std::_Identity<_Value>(), __a)
{ }
template<typename _InputIterator>
__unordered_multiset(_InputIterator __f, _InputIterator __l,
typename _Base::size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __detail::_Mod_range_hashing(),
__detail::_Default_ranged_hash(), __eql,
std::_Identity<_Value>(), __a)
{ }
};
template<class _Value, class _Hash, class _Pred, class _Alloc,
bool __cache_hash_code>
inline void
swap (__unordered_set<_Value, _Hash, _Pred,
_Alloc, __cache_hash_code>& __x,
__unordered_set<_Value, _Hash, _Pred,
_Alloc, __cache_hash_code>& __y)
{ __x.swap(__y); }
template<class _Value, class _Hash, class _Pred, class _Alloc,
bool __cache_hash_code>
inline void
swap(__unordered_multiset<_Value, _Hash, _Pred,
_Alloc, __cache_hash_code>& __x,
__unordered_multiset<_Value, _Hash, _Pred,
_Alloc, __cache_hash_code>& __y)
{ __x.swap(__y); }
template<class _Value,
class _Hash = hash<_Value>,
class _Pred = std::equal_to<_Value>,
class _Alloc = std::allocator<_Value> >
class unordered_set
: public __unordered_set<_Value, _Hash, _Pred, _Alloc>
{
typedef __unordered_set<_Value, _Hash, _Pred, _Alloc> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
unordered_set(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a)
{ }
template<typename _InputIterator>
unordered_set(_InputIterator __f, _InputIterator __l,
size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a)
{ }
};
template<class _Value,
class _Hash = hash<_Value>,
class _Pred = std::equal_to<_Value>,
class _Alloc = std::allocator<_Value> >
class unordered_multiset
: public __unordered_multiset<_Value, _Hash, _Pred, _Alloc>
{
typedef __unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
explicit
unordered_multiset(size_type __n = 10,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a)
{ }
template<typename _InputIterator>
unordered_multiset(_InputIterator __f, _InputIterator __l,
typename _Base::size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a)
{ }
};
_GLIBCXX_END_NAMESPACE
}
#endif // _TR1_UNORDERED_SET
#endif // _GLIBCXX_TR1_UNORDERED_SET

View file

@ -31,72 +31,31 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_UTILITY
#define _TR1_UTILITY 1
#ifndef _GLIBCXX_TR1_UTILITY
#define _GLIBCXX_TR1_UTILITY 1
#include <utility>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
template<class _Tp> class tuple_size;
template<int _Int, class _Tp> class tuple_element;
// Various functions which give std::pair a tuple-like interface.
template<class _Tp1, class _Tp2>
struct tuple_size<std::pair<_Tp1, _Tp2> >
{ static const int value = 2; };
template<class _Tp1, class _Tp2>
const int tuple_size<std::pair<_Tp1, _Tp2> >::value;
template<class _Tp1, class _Tp2>
struct tuple_element<0, std::pair<_Tp1, _Tp2> >
{ typedef _Tp1 type; };
template<class _Tp1, class _Tp2>
struct tuple_element<1, std::pair<_Tp1, _Tp2> >
{ typedef _Tp2 type; };
template<int _Int> struct __pair_get;
template<>
struct __pair_get<0>
{
template<typename _Tp1, typename _Tp2>
static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
{ return __pair.first; }
template<typename _Tp1, typename _Tp2>
static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
{ return __pair.first; }
};
template<>
struct __pair_get<1>
{
template<typename _Tp1, typename _Tp2>
static _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair)
{ return __pair.second; }
template<typename _Tp1, typename _Tp2>
static const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
{ return __pair.second; }
};
template<int _Int, class _Tp1, class _Tp2>
inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
get(std::pair<_Tp1, _Tp2>& __in)
{ return __pair_get<_Int>::__get(__in); }
template<int _Int, class _Tp1, class _Tp2>
inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
get(const std::pair<_Tp1, _Tp2>& __in)
{ return __pair_get<_Int>::__const_get(__in); }
_GLIBCXX_END_NAMESPACE
}
#pragma GCC system_header
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# error TR1 header cannot be included from C++0x header
#endif
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/utility>
#else
# define _GLIBCXX_INCLUDE_AS_TR1
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
# define _GLIBCXX_TR1 tr1::
# include <tr1_impl/utility>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_TR1
#endif
#endif // _GLIBCXX_TR1_UTILITY

View file

@ -1,6 +1,6 @@
// TR1 wchar.h -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_WCHAR_H
#define _TR1_WCHAR_H 1
#ifndef _GLIBCXX_TR1_WCHAR_H
#define _GLIBCXX_TR1_WCHAR_H 1
#include <tr1/cwchar>
#endif
#endif // _GLIBCXX_TR1_WCHAR_H

View file

@ -1,6 +1,6 @@
// TR1 wctype.h -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
// Copyright (C) 2006, 2007 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
@ -31,9 +31,9 @@
* This is a TR1 C++ Library header.
*/
#ifndef _TR1_WCTYPE_H
#define _TR1_WCTYPE_H 1
#ifndef _GLIBCXX_TR1_WCTYPE_H
#define _GLIBCXX_TR1_WCTYPE_H 1
#include <tr1/cwctype>
#endif
#endif // _GLIBCXX_TR1_WCTYPE_H

View file

@ -0,0 +1,239 @@
// class template array -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/array
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
/// @brief struct array [6.2.2].
/// NB: Requires complete type _Tp.
template<typename _Tp, std::size_t _Nm>
struct array
{
typedef _Tp value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// Support for zero-sized arrays mandatory.
value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__));
// No explicit construct/copy/destroy for aggregate type.
void
assign(const value_type& __u)
{ std::fill_n(begin(), size(), __u); }
void
swap(array& __other)
{ std::swap_ranges(begin(), end(), __other.begin()); }
// Iterators.
iterator
begin()
{ return iterator(&_M_instance[0]); }
const_iterator
begin() const
{ return const_iterator(&_M_instance[0]); }
iterator
end()
{ return iterator(&_M_instance[_Nm]); }
const_iterator
end() const
{ return const_iterator(&_M_instance[_Nm]); }
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
// Capacity.
size_type
size() const { return _Nm; }
size_type
max_size() const { return _Nm; }
bool
empty() const { return size() == 0; }
// Element access.
reference
operator[](size_type __n)
{ return _M_instance[__n]; }
const_reference
operator[](size_type __n) const
{ return _M_instance[__n]; }
reference
at(size_type __n)
{
_M_check<_Nm>(__n);
return _M_instance[__n];
}
const_reference
at(size_type __n) const
{
_M_check<_Nm>(__n);
return _M_instance[__n];
}
reference
front()
{ return *begin(); }
const_reference
front() const
{ return *begin(); }
reference
back()
{ return _Nm ? *(end() - 1) : *end(); }
const_reference
back() const
{ return _Nm ? *(end() - 1) : *end(); }
_Tp*
data()
{ return &_M_instance[0]; }
const _Tp*
data() const
{ return &_M_instance[0]; }
private:
template<std::size_t _Mm>
typename __gnu_cxx::__enable_if<_Mm, void>::__type
_M_check(size_type __n) const
{
if (__builtin_expect(__n >= _Mm, false))
std::__throw_out_of_range(__N("array::_M_check"));
}
// Avoid "unsigned comparison with zero" warnings.
template<std::size_t _Mm>
typename __gnu_cxx::__enable_if<!_Mm, void>::__type
_M_check(size_type) const
{ std::__throw_out_of_range(__N("array::_M_check")); }
};
// Array comparisons.
template<typename _Tp, std::size_t _Nm>
inline bool
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return std::equal(__one.begin(), __one.end(), __two.begin()); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one == __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
{
return std::lexicographical_compare(__a.begin(), __a.end(),
__b.begin(), __b.end());
}
template<typename _Tp, std::size_t _Nm>
inline bool
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return __two < __one; }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one > __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one < __two); }
// Specialized algorithms [6.2.2.2].
template<typename _Tp, std::size_t _Nm>
inline void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
{ std::swap_ranges(__one.begin(), __one.end(), __two.begin()); }
// Tuple interface to class template array [6.2.2.5].
template<typename _Tp> class tuple_size;
template<int _Int, typename _Tp> class tuple_element;
template<typename _Tp, std::size_t _Nm>
struct tuple_size<array<_Tp, _Nm> >
{ static const int value = _Nm; };
template<typename _Tp, std::size_t _Nm>
const int tuple_size<array<_Tp, _Nm> >::value;
template<int _Int, typename _Tp, std::size_t _Nm>
struct tuple_element<_Int, array<_Tp, _Nm> >
{ typedef _Tp type; };
template<int _Int, typename _Tp, std::size_t _Nm>
inline _Tp&
get(array<_Tp, _Nm>& __arr)
{ return __arr[_Int]; }
template<int _Int, typename _Tp, std::size_t _Nm>
inline const _Tp&
get(const array<_Tp, _Nm>& __arr)
{ return __arr[_Int]; }
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -1,6 +1,6 @@
// <tr1/boost_shared_ptr.h> -*- C++ -*-
// <tr1_impl/boost_shared_ptr.h> -*- C++ -*-
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// Copyright (C) 2007 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
@ -46,17 +46,14 @@
// GCC Note: based on version 1.32.0 of the Boost library.
/** @file tr1/boost_shared_ptr.h
/** @file tr1_impl/boost_shared_ptr.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _BOOST_SHARED_PTR_H
#define _BOOST_SHARED_PTR_H 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_GLIBCXX_BEGIN_NAMESPACE_TR1
class bad_weak_ptr : public std::exception
{
@ -1141,7 +1138,5 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
mutable weak_ptr<_Tp> _M_weak_this;
};
_GLIBCXX_END_NAMESPACE
} // namespace std
#endif
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -0,0 +1,48 @@
// TR1 cctype -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cctype
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_C99_CTYPE_TR1
#undef isblank
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
using ::isblank;
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,77 @@
// TR1 cfenv -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cfenv
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_C99_FENV_TR1
#include_next <fenv.h>
#undef feclearexcept
#undef fegetexceptflag
#undef feraiseexcept
#undef fesetexceptflag
#undef fetestexcept
#undef fegetround
#undef fesetround
#undef fegetenv
#undef feholdexcept
#undef fesetenv
#undef feupdateenv
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
// types
using ::fenv_t;
using ::fexcept_t;
// functions
using ::feclearexcept;
using ::fegetexceptflag;
using ::feraiseexcept;
using ::fesetexceptflag;
using ::fetestexcept;
using ::fegetround;
using ::fesetround;
using ::fegetenv;
using ::feholdexcept;
using ::fesetenv;
using ::feupdateenv;
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,73 @@
// TR1 cinttypes -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cinttypes
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_C99_INTTYPES_TR1
// For 8.11.1/1 (see C99, Note 184)
#define __STDC_FORMAT_MACROS
#include_next <inttypes.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
// types
using ::imaxdiv_t;
// functions
using ::imaxabs;
// May collide with _Longlong abs(_Longlong), and is not described
// anywhere outside the synopsis. Likely, a defect.
//
// intmax_t abs(intmax_t)
using ::imaxdiv;
// Likewise, with lldiv_t div(_Longlong, _Longlong).
//
// imaxdiv_t div(intmax_t, intmax_t)
using ::strtoimax;
using ::strtoumax;
#ifdef _GLIBCXX_USE_WCHAR_T
using ::wcstoimax;
using ::wcstoumax;
#endif
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,907 @@
// TR1 cmath -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cmath
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_C99_MATH_TR1
#undef acosh
#undef acoshf
#undef acoshl
#undef asinh
#undef asinhf
#undef asinhl
#undef atanh
#undef atanhf
#undef atanhl
#undef cbrt
#undef cbrtf
#undef cbrtl
#undef copysign
#undef copysignf
#undef copysignl
#undef erf
#undef erff
#undef erfl
#undef erfc
#undef erfcf
#undef erfcl
#undef exp2
#undef exp2f
#undef exp2l
#undef expm1
#undef expm1f
#undef expm1l
#undef fdim
#undef fdimf
#undef fdiml
#undef fma
#undef fmaf
#undef fmal
#undef fmax
#undef fmaxf
#undef fmaxl
#undef fmin
#undef fminf
#undef fminl
#undef hypot
#undef hypotf
#undef hypotl
#undef ilogb
#undef ilogbf
#undef ilogbl
#undef lgamma
#undef lgammaf
#undef lgammal
#undef llrint
#undef llrintf
#undef llrintl
#undef llround
#undef llroundf
#undef llroundl
#undef log1p
#undef log1pf
#undef log1pl
#undef log2
#undef log2f
#undef log2l
#undef logb
#undef logbf
#undef logbl
#undef lrint
#undef lrintf
#undef lrintl
#undef lround
#undef lroundf
#undef lroundl
#undef nan
#undef nanf
#undef nanl
#undef nearbyint
#undef nearbyintf
#undef nearbyintl
#undef nextafter
#undef nextafterf
#undef nextafterl
#undef nexttoward
#undef nexttowardf
#undef nexttowardl
#undef remainder
#undef remainderf
#undef remainderl
#undef remquo
#undef remquo
#undef remquo
#undef rint
#undef rintf
#undef rintl
#undef round
#undef roundf
#undef roundl
#undef scalbln
#undef scalblnf
#undef scalblnl
#undef scalbn
#undef scalbnf
#undef scalbnl
#undef tgamma
#undef tgammaf
#undef tgammal
#undef trunc
#undef truncf
#undef truncl
#endif
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
#if _GLIBCXX_USE_C99_MATH_TR1
// types
using ::double_t;
using ::float_t;
// functions
using ::acosh;
using ::acoshf;
using ::acoshl;
using ::asinh;
using ::asinhf;
using ::asinhl;
using ::atanh;
using ::atanhf;
using ::atanhl;
using ::cbrt;
using ::cbrtf;
using ::cbrtl;
using ::copysign;
using ::copysignf;
using ::copysignl;
using ::erf;
using ::erff;
using ::erfl;
using ::erfc;
using ::erfcf;
using ::erfcl;
using ::exp2;
using ::exp2f;
using ::exp2l;
using ::expm1;
using ::expm1f;
using ::expm1l;
using ::fdim;
using ::fdimf;
using ::fdiml;
using ::fma;
using ::fmaf;
using ::fmal;
using ::fmax;
using ::fmaxf;
using ::fmaxl;
using ::fmin;
using ::fminf;
using ::fminl;
using ::hypot;
using ::hypotf;
using ::hypotl;
using ::ilogb;
using ::ilogbf;
using ::ilogbl;
using ::lgamma;
using ::lgammaf;
using ::lgammal;
using ::llrint;
using ::llrintf;
using ::llrintl;
using ::llround;
using ::llroundf;
using ::llroundl;
using ::log1p;
using ::log1pf;
using ::log1pl;
using ::log2;
using ::log2f;
using ::log2l;
using ::logb;
using ::logbf;
using ::logbl;
using ::lrint;
using ::lrintf;
using ::lrintl;
using ::lround;
using ::lroundf;
using ::lroundl;
using ::nan;
using ::nanf;
using ::nanl;
using ::nearbyint;
using ::nearbyintf;
using ::nearbyintl;
using ::nextafter;
using ::nextafterf;
using ::nextafterl;
using ::nexttoward;
using ::nexttowardf;
using ::nexttowardl;
using ::remainder;
using ::remainderf;
using ::remainderl;
using ::remquo;
using ::remquo;
using ::remquo;
using ::rint;
using ::rintf;
using ::rintl;
using ::round;
using ::roundf;
using ::roundl;
using ::scalbln;
using ::scalblnf;
using ::scalblnl;
using ::scalbn;
using ::scalbnf;
using ::scalbnl;
using ::tgamma;
using ::tgammaf;
using ::tgammal;
using ::trunc;
using ::truncf;
using ::truncl;
#endif
#if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
/// @brief Function template definitions [8.16.3].
//
using std::signbit;
using std::fpclassify;
using std::isfinite;
using std::isinf;
using std::isnan;
using std::isnormal;
using std::isgreater;
using std::isgreaterequal;
using std::isless;
using std::islessequal;
using std::islessgreater;
using std::isunordered;
#endif
#endif
#if _GLIBCXX_USE_C99_MATH_TR1
/// @brief Additional overloads [8.16.4].
//
using std::acos;
inline float
acosh(float __x)
{ return __builtin_acoshf(__x); }
inline long double
acosh(long double __x)
{ return __builtin_acoshl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
acosh(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return acosh(__type(__x));
}
using std::asin;
inline float
asinh(float __x)
{ return __builtin_asinhf(__x); }
inline long double
asinh(long double __x)
{ return __builtin_asinhl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
asinh(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return asinh(__type(__x));
}
using std::atan;
using std::atan2;
inline float
atanh(float __x)
{ return __builtin_atanhf(__x); }
inline long double
atanh(long double __x)
{ return __builtin_atanhl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
atanh(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return atanh(__type(__x));
}
inline float
cbrt(float __x)
{ return __builtin_cbrtf(__x); }
inline long double
cbrt(long double __x)
{ return __builtin_cbrtl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
cbrt(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return cbrt(__type(__x));
}
using std::ceil;
inline float
copysign(float __x, float __y)
{ return __builtin_copysignf(__x, __y); }
inline long double
copysign(long double __x, long double __y)
{ return __builtin_copysignl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
copysign(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return copysign(__type(__x), __type(__y));
}
using std::cos;
using std::cosh;
inline float
erf(float __x)
{ return __builtin_erff(__x); }
inline long double
erf(long double __x)
{ return __builtin_erfl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
erf(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erf(__type(__x));
}
inline float
erfc(float __x)
{ return __builtin_erfcf(__x); }
inline long double
erfc(long double __x)
{ return __builtin_erfcl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
erfc(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return erfc(__type(__x));
}
using std::exp;
inline float
exp2(float __x)
{ return __builtin_exp2f(__x); }
inline long double
exp2(long double __x)
{ return __builtin_exp2l(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
exp2(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return exp2(__type(__x));
}
inline float
expm1(float __x)
{ return __builtin_expm1f(__x); }
inline long double
expm1(long double __x)
{ return __builtin_expm1l(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
expm1(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return expm1(__type(__x));
}
using std::fabs;
inline float
fdim(float __x, float __y)
{ return __builtin_fdimf(__x, __y); }
inline long double
fdim(long double __x, long double __y)
{ return __builtin_fdiml(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fdim(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fdim(__type(__x), __type(__y));
}
using std::floor;
inline float
fma(float __x, float __y, float __z)
{ return __builtin_fmaf(__x, __y, __z); }
inline long double
fma(long double __x, long double __y, long double __z)
{ return __builtin_fmal(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp>
inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z)
{
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
return fma(__type(__x), __type(__y), __type(__z));
}
inline float
fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
inline long double
fmax(long double __x, long double __y)
{ return __builtin_fmaxl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fmax(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fmax(__type(__x), __type(__y));
}
inline float
fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
inline long double
fmin(long double __x, long double __y)
{ return __builtin_fminl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
fmin(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return fmin(__type(__x), __type(__y));
}
using std::fmod;
using std::frexp;
inline float
hypot(float __x, float __y)
{ return __builtin_hypotf(__x, __y); }
inline long double
hypot(long double __x, long double __y)
{ return __builtin_hypotl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
hypot(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return hypot(__type(__x), __type(__y));
}
inline int
ilogb(float __x)
{ return __builtin_ilogbf(__x); }
inline int
ilogb(long double __x)
{ return __builtin_ilogbl(__x); }
template<typename _Tp>
inline int
ilogb(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return ilogb(__type(__x));
}
using std::ldexp;
inline float
lgamma(float __x)
{ return __builtin_lgammaf(__x); }
inline long double
lgamma(long double __x)
{ return __builtin_lgammal(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
lgamma(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lgamma(__type(__x));
}
inline long long
llrint(float __x)
{ return __builtin_llrintf(__x); }
inline long long
llrint(long double __x)
{ return __builtin_llrintl(__x); }
template<typename _Tp>
inline long long
llrint(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llrint(__type(__x));
}
inline long long
llround(float __x)
{ return __builtin_llroundf(__x); }
inline long long
llround(long double __x)
{ return __builtin_llroundl(__x); }
template<typename _Tp>
inline long long
llround(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return llround(__type(__x));
}
using std::log;
using std::log10;
inline float
log1p(float __x)
{ return __builtin_log1pf(__x); }
inline long double
log1p(long double __x)
{ return __builtin_log1pl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
log1p(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log1p(__type(__x));
}
// DR 568.
inline float
log2(float __x)
{ return __builtin_log2f(__x); }
inline long double
log2(long double __x)
{ return __builtin_log2l(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
log2(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return log2(__type(__x));
}
inline float
logb(float __x)
{ return __builtin_logbf(__x); }
inline long double
logb(long double __x)
{ return __builtin_logbl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
logb(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return logb(__type(__x));
}
inline long
lrint(float __x)
{ return __builtin_lrintf(__x); }
inline long
lrint(long double __x)
{ return __builtin_lrintl(__x); }
template<typename _Tp>
inline long
lrint(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lrint(__type(__x));
}
inline long
lround(float __x)
{ return __builtin_lroundf(__x); }
inline long
lround(long double __x)
{ return __builtin_lroundl(__x); }
template<typename _Tp>
inline long
lround(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return lround(__type(__x));
}
inline float
nearbyint(float __x)
{ return __builtin_nearbyintf(__x); }
inline long double
nearbyint(long double __x)
{ return __builtin_nearbyintl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
nearbyint(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nearbyint(__type(__x));
}
inline float
nextafter(float __x, float __y)
{ return __builtin_nextafterf(__x, __y); }
inline long double
nextafter(long double __x, long double __y)
{ return __builtin_nextafterl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
nextafter(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return nextafter(__type(__x), __type(__y));
}
inline float
nexttoward(float __x, long double __y)
{ return __builtin_nexttowardf(__x, __y); }
inline long double
nexttoward(long double __x, long double __y)
{ return __builtin_nexttowardl(__x, __y); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
nexttoward(_Tp __x, long double __y)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return nexttoward(__type(__x), __y);
}
using std::pow;
inline float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
inline long double
remainder(long double __x, long double __y)
{ return __builtin_remainderl(__x, __y); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
remainder(_Tp __x, _Up __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return remainder(__type(__x), __type(__y));
}
inline float
remquo(float __x, float __y, int* __pquo)
{ return __builtin_remquof(__x, __y, __pquo); }
inline long double
remquo(long double __x, long double __y, int* __pquo)
{ return __builtin_remquol(__x, __y, __pquo); }
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return remquo(__type(__x), __type(__y), __pquo);
}
inline float
rint(float __x)
{ return __builtin_rintf(__x); }
inline long double
rint(long double __x)
{ return __builtin_rintl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
rint(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return rint(__type(__x));
}
inline float
round(float __x)
{ return __builtin_roundf(__x); }
inline long double
round(long double __x)
{ return __builtin_roundl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
round(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return round(__type(__x));
}
inline float
scalbln(float __x, long __ex)
{ return __builtin_scalblnf(__x, __ex); }
inline long double
scalbln(long double __x, long __ex)
{ return __builtin_scalblnl(__x, __ex); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
scalbln(_Tp __x, long __ex)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbln(__type(__x), __ex);
}
inline float
scalbn(float __x, int __ex)
{ return __builtin_scalbnf(__x, __ex); }
inline long double
scalbn(long double __x, int __ex)
{ return __builtin_scalbnl(__x, __ex); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
scalbn(_Tp __x, int __ex)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return scalbn(__type(__x), __ex);
}
using std::sin;
using std::sinh;
using std::sqrt;
using std::tan;
using std::tanh;
inline float
tgamma(float __x)
{ return __builtin_tgammaf(__x); }
inline long double
tgamma(long double __x)
{ return __builtin_tgammal(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
tgamma(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return tgamma(__type(__x));
}
inline float
trunc(float __x)
{ return __builtin_truncf(__x); }
inline long double
trunc(long double __x)
{ return __builtin_truncl(__x); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
trunc(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return trunc(__type(__x));
}
#endif
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -0,0 +1,369 @@
// TR1 complex -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/complex
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
// Forward declarations.
template<typename _Tp> std::complex<_Tp> acos(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> asin(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> atan(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> acosh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> asinh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> atanh(const std::complex<_Tp>&);
template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&);
/// @brief acos(__z) [8.1.2].
// Effects: Behaves the same as C99 function cacos, defined
// in subclause 7.3.5.1.
template<typename _Tp>
inline std::complex<_Tp>
__complex_acos(const std::complex<_Tp>& __z)
{
const std::complex<_Tp> __t = std::_GLIBCXX_TR1 asin(__z);
const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag());
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_acos(__complex__ float __z)
{ return __builtin_cacosf(__z); }
inline __complex__ double
__complex_acos(__complex__ double __z)
{ return __builtin_cacos(__z); }
inline __complex__ long double
__complex_acos(const __complex__ long double& __z)
{ return __builtin_cacosl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
acos(const std::complex<_Tp>& __z)
{ return __complex_acos(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
acos(const std::complex<_Tp>& __z)
{ return __complex_acos(__z); }
#endif
/// @brief asin(__z) [8.1.3].
// Effects: Behaves the same as C99 function casin, defined
// in subclause 7.3.5.2.
template<typename _Tp>
inline std::complex<_Tp>
__complex_asin(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t(-__z.imag(), __z.real());
__t = std::_GLIBCXX_TR1 asinh(__t);
return std::complex<_Tp>(__t.imag(), -__t.real());
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_asin(__complex__ float __z)
{ return __builtin_casinf(__z); }
inline __complex__ double
__complex_asin(__complex__ double __z)
{ return __builtin_casin(__z); }
inline __complex__ long double
__complex_asin(const __complex__ long double& __z)
{ return __builtin_casinl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
asin(const std::complex<_Tp>& __z)
{ return __complex_asin(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
asin(const std::complex<_Tp>& __z)
{ return __complex_asin(__z); }
#endif
/// @brief atan(__z) [8.1.4].
// Effects: Behaves the same as C99 function catan, defined
// in subclause 7.3.5.3.
template<typename _Tp>
std::complex<_Tp>
__complex_atan(const std::complex<_Tp>& __z)
{
const _Tp __r2 = __z.real() * __z.real();
const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
_Tp __num = __z.imag() + _Tp(1.0);
_Tp __den = __z.imag() - _Tp(1.0);
__num = __r2 + __num * __num;
__den = __r2 + __den * __den;
return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
_Tp(0.25) * log(__num / __den));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_atan(__complex__ float __z)
{ return __builtin_catanf(__z); }
inline __complex__ double
__complex_atan(__complex__ double __z)
{ return __builtin_catan(__z); }
inline __complex__ long double
__complex_atan(const __complex__ long double& __z)
{ return __builtin_catanl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
atan(const std::complex<_Tp>& __z)
{ return __complex_atan(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
atan(const std::complex<_Tp>& __z)
{ return __complex_atan(__z); }
#endif
/// @brief acosh(__z) [8.1.5].
// Effects: Behaves the same as C99 function cacosh, defined
// in subclause 7.3.6.1.
template<typename _Tp>
std::complex<_Tp>
__complex_acosh(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t((__z.real() - __z.imag())
* (__z.real() + __z.imag()) - _Tp(1.0),
_Tp(2.0) * __z.real() * __z.imag());
__t = std::sqrt(__t);
return std::log(__t + __z);
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_acosh(__complex__ float __z)
{ return __builtin_cacoshf(__z); }
inline __complex__ double
__complex_acosh(__complex__ double __z)
{ return __builtin_cacosh(__z); }
inline __complex__ long double
__complex_acosh(const __complex__ long double& __z)
{ return __builtin_cacoshl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
acosh(const std::complex<_Tp>& __z)
{ return __complex_acosh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
acosh(const std::complex<_Tp>& __z)
{ return __complex_acosh(__z); }
#endif
/// @brief asinh(__z) [8.1.6].
// Effects: Behaves the same as C99 function casin, defined
// in subclause 7.3.6.2.
template<typename _Tp>
std::complex<_Tp>
__complex_asinh(const std::complex<_Tp>& __z)
{
std::complex<_Tp> __t((__z.real() - __z.imag())
* (__z.real() + __z.imag()) + _Tp(1.0),
_Tp(2.0) * __z.real() * __z.imag());
__t = std::sqrt(__t);
return std::log(__t + __z);
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_asinh(__complex__ float __z)
{ return __builtin_casinhf(__z); }
inline __complex__ double
__complex_asinh(__complex__ double __z)
{ return __builtin_casinh(__z); }
inline __complex__ long double
__complex_asinh(const __complex__ long double& __z)
{ return __builtin_casinhl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
asinh(const std::complex<_Tp>& __z)
{ return __complex_asinh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
asinh(const std::complex<_Tp>& __z)
{ return __complex_asinh(__z); }
#endif
/// @brief atanh(__z) [8.1.7].
// Effects: Behaves the same as C99 function catanh, defined
// in subclause 7.3.6.3.
template<typename _Tp>
std::complex<_Tp>
__complex_atanh(const std::complex<_Tp>& __z)
{
const _Tp __i2 = __z.imag() * __z.imag();
const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
_Tp __num = _Tp(1.0) + __z.real();
_Tp __den = _Tp(1.0) - __z.real();
__num = __i2 + __num * __num;
__den = __i2 + __den * __den;
return std::complex<_Tp>(_Tp(0.25) * (log(__num) - log(__den)),
_Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
}
#if _GLIBCXX_USE_C99_COMPLEX_TR1
inline __complex__ float
__complex_atanh(__complex__ float __z)
{ return __builtin_catanhf(__z); }
inline __complex__ double
__complex_atanh(__complex__ double __z)
{ return __builtin_catanh(__z); }
inline __complex__ long double
__complex_atanh(const __complex__ long double& __z)
{ return __builtin_catanhl(__z); }
template<typename _Tp>
inline std::complex<_Tp>
atanh(const std::complex<_Tp>& __z)
{ return __complex_atanh(__z.__rep()); }
#else
template<typename _Tp>
inline std::complex<_Tp>
atanh(const std::complex<_Tp>& __z)
{ return __complex_atanh(__z); }
#endif
/// @brief fabs(__z) [8.1.8].
// Effects: Behaves the same as C99 function cabs, defined
// in subclause 7.3.8.1.
template<typename _Tp>
inline std::complex<_Tp>
fabs(const std::complex<_Tp>& __z)
{ return std::abs(__z); }
#if (defined(_GLIBCXX_INCLUDE_AS_CXX0X) \
|| (defined(_GLIBCXX_INCLUDE_AS_TR1) \
&& !defined(__GXX_EXPERIMENTAL_CXX0X__)))
/// @brief Additional overloads [8.1.9].
//
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
arg(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return std::arg(std::complex<__type>(__x));
}
template<typename _Tp>
inline std::complex<typename __gnu_cxx::__promote<_Tp>::__type>
conj(_Tp __x)
{ return __x; }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
imag(_Tp)
{ return _Tp(); }
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
norm(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
return __type(__x) * __type(__x);
}
template<typename _Tp, typename _Up>
inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
polar(const _Tp& __rho, const _Up& __theta)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return std::polar(__type(__rho), __type(__theta));
}
template<typename _Tp, typename _Up>
inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
pow(const std::complex<_Tp>& __x, const _Up& __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return std::pow(std::complex<__type>(__x), __type(__y));
}
template<typename _Tp, typename _Up>
inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
pow(const _Tp& __x, const std::complex<_Up>& __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return std::pow(__type(__x), std::complex<__type>(__y));
}
template<typename _Tp, typename _Up>
inline std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type>
pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
{
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return std::pow(std::complex<__type>(__x),
std::complex<__type>(__y));
}
template<typename _Tp>
inline typename __gnu_cxx::__promote<_Tp>::__type
real(_Tp __x)
{ return __x; }
#endif
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -0,0 +1,85 @@
// TR1 cstdint -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cstdint
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_C99_STDINT_TR1
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include_next <stdint.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
using ::int8_t;
using ::int16_t;
using ::int32_t;
using ::int64_t;
using ::int_fast8_t;
using ::int_fast16_t;
using ::int_fast32_t;
using ::int_fast64_t;
using ::int_least8_t;
using ::int_least16_t;
using ::int_least32_t;
using ::int_least64_t;
using ::intmax_t;
using ::intptr_t;
using ::uint8_t;
using ::uint16_t;
using ::uint32_t;
using ::uint64_t;
using ::uint_fast8_t;
using ::uint_fast16_t;
using ::uint_fast32_t;
using ::uint_fast64_t;
using ::uint_least8_t;
using ::uint_least16_t;
using ::uint_least32_t;
using ::uint_least64_t;
using ::uintmax_t;
using ::uintptr_t;
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,49 @@
// TR1 cstdio -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cstdio
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
#if _GLIBCXX_USE_C99
using std::snprintf;
using std::vsnprintf;
using std::vfscanf;
using std::vscanf;
using std::vsscanf;
#endif
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -0,0 +1,70 @@
// TR1 cstdlib -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cstdlib
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_HOSTED
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
#if _GLIBCXX_USE_C99
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
// types
using std::lldiv_t;
// functions
using std::llabs;
using std::lldiv;
#endif
using std::atoll;
using std::strtoll;
using std::strtoull;
using std::strtof;
using std::strtold;
// overloads
using std::abs;
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
using std::div;
#endif
#endif
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,63 @@
// TR1 cwchar -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cwchar
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_WCHAR_T
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
#if _GLIBCXX_HAVE_WCSTOF
using std::wcstof;
#endif
#if _GLIBCXX_HAVE_VFWSCANF
using std::vfwscanf;
#endif
#if _GLIBCXX_HAVE_VSWSCANF
using std::vswscanf;
#endif
#if _GLIBCXX_HAVE_VWSCANF
using std::vwscanf;
#endif
#if _GLIBCXX_USE_C99
using std::wcstold;
using std::wcstoll;
using std::wcstoull;
#endif
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

View file

@ -0,0 +1,48 @@
// TR1 cwctype -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/cwctype
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#if _GLIBCXX_USE_WCHAR_T
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
#if _GLIBCXX_HAVE_ISWBLANK
using std::iswblank;
#endif
_GLIBCXX_END_NAMESPACE_TR1
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,223 @@
// TR1 functional -*- C++ -*-
// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1_impl/functional_hash.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
// Definition of default hash function std::tr1::hash<>. The types for
// which std::tr1::hash<T> is defined is in clause 6.3.3. of the PDTR.
template<typename _Tp>
struct hash;
#define _TR1_hashtable_define_trivial_hash(_Tp) \
template<> \
struct hash<_Tp> \
: public std::unary_function<_Tp, std::size_t> \
{ \
std::size_t \
operator()(_Tp __val) const \
{ return static_cast<std::size_t>(__val); } \
}
_TR1_hashtable_define_trivial_hash(bool);
_TR1_hashtable_define_trivial_hash(char);
_TR1_hashtable_define_trivial_hash(signed char);
_TR1_hashtable_define_trivial_hash(unsigned char);
_TR1_hashtable_define_trivial_hash(wchar_t);
_TR1_hashtable_define_trivial_hash(short);
_TR1_hashtable_define_trivial_hash(int);
_TR1_hashtable_define_trivial_hash(long);
_TR1_hashtable_define_trivial_hash(long long);
_TR1_hashtable_define_trivial_hash(unsigned short);
_TR1_hashtable_define_trivial_hash(unsigned int);
_TR1_hashtable_define_trivial_hash(unsigned long);
_TR1_hashtable_define_trivial_hash(unsigned long long);
#undef _TR1_hashtable_define_trivial_hash
template<typename _Tp>
struct hash<_Tp*>
: public std::unary_function<_Tp*, std::size_t>
{
std::size_t
operator()(_Tp* __p) const
{ return reinterpret_cast<std::size_t>(__p); }
};
// Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
// (used by the next specializations of std::tr1::hash<>)
// Dummy generic implementation (for sizeof(size_t) != 4, 8).
template<std::size_t = sizeof(std::size_t)>
struct _Fnv_hash
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result = 0;
for (; __length > 0; --__length)
__result = (__result * 131) + *__first++;
return __result;
}
};
template<>
struct _Fnv_hash<4>
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result = static_cast<std::size_t>(2166136261UL);
for (; __length > 0; --__length)
{
__result ^= static_cast<std::size_t>(*__first++);
__result *= static_cast<std::size_t>(16777619UL);
}
return __result;
}
};
template<>
struct _Fnv_hash<8>
{
static std::size_t
hash(const char* __first, std::size_t __length)
{
std::size_t __result =
static_cast<std::size_t>(14695981039346656037ULL);
for (; __length > 0; --__length)
{
__result ^= static_cast<std::size_t>(*__first++);
__result *= static_cast<std::size_t>(1099511628211ULL);
}
return __result;
}
};
// XXX String and floating point hashes probably shouldn't be inline
// member functions, since are nontrivial. Once we have the framework
// for TR1 .cc files, these should go in one.
template<>
struct hash<std::string>
: public std::unary_function<std::string, std::size_t>
{
std::size_t
operator()(const std::string& __s) const
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
};
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
struct hash<std::wstring>
: public std::unary_function<std::wstring, std::size_t>
{
std::size_t
operator()(const std::wstring& __s) const
{
return _Fnv_hash<>::hash(reinterpret_cast<const char*>(__s.data()),
__s.length() * sizeof(wchar_t));
}
};
#endif
template<>
struct hash<float>
: public std::unary_function<float, std::size_t>
{
std::size_t
operator()(float __fval) const
{
std::size_t __result = 0;
// 0 and -0 both hash to zero.
if (__fval != 0.0f)
__result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__fval),
sizeof(__fval));
return __result;
}
};
template<>
struct hash<double>
: public std::unary_function<double, std::size_t>
{
std::size_t
operator()(double __dval) const
{
std::size_t __result = 0;
// 0 and -0 both hash to zero.
if (__dval != 0.0)
__result = _Fnv_hash<>::hash(reinterpret_cast<const char*>(&__dval),
sizeof(__dval));
return __result;
}
};
// For long double, careful with random padding bits (e.g., on x86,
// 10 bytes -> 12 bytes) and resort to frexp.
template<>
struct hash<long double>
: public std::unary_function<long double, std::size_t>
{
std::size_t
operator()(long double __ldval) const
{
std::size_t __result = 0;
int __exponent;
__ldval = std::frexp(__ldval, &__exponent);
__ldval = __ldval < 0.0l ? -(__ldval + 0.5l) : __ldval;
const long double __mult =
__gnu_cxx::__numeric_traits<std::size_t>::__max + 1.0l;
__ldval *= __mult;
// Try to use all the bits of the mantissa (really necessary only
// on 32-bit targets, at least for 80-bit floating point formats).
const std::size_t __hibits = (std::size_t)__ldval;
__ldval = (__ldval - (long double)__hibits) * __mult;
const std::size_t __coeff =
__gnu_cxx::__numeric_traits<std::size_t>::__max / __LDBL_MAX_EXP__;
__result = __hibits + (std::size_t)__ldval + __coeff * __exponent;
return __result;
}
};
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -1,6 +1,6 @@
// Internal header for TR1 unordered_set and unordered_map -*- C++ -*-
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// Copyright (C) 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -27,8 +27,9 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/hashtable
* This is a TR1 C++ Library header.
/** @file tr1_impl/hashtable
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
// This header file defines std::tr1::hashtable, which is used to
@ -49,22 +50,11 @@
// A. Tavori and V. Dreizin, "Policy-Based Data Structures", 2004.
// http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html
#ifndef _TR1_HASHTABLE
#define _TR1_HASHTABLE 1
#include <utility> // For std::pair
#include <cstddef>
#include <cmath>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#include <bits/allocator.h>
#include <bits/functexcept.h>
#include <tr1/type_traits> // For true_type and false_type
#include <tr1/hashtable_policy.h>
#include <tr1_impl/hashtable_policy.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_GLIBCXX_BEGIN_NAMESPACE_TR1
// Class template _Hashtable, class definition.
@ -382,10 +372,10 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
typename _Hashtable::_Hash_code_type);
std::pair<iterator, bool>
_M_insert(const value_type&, std::_GLIBCXX_TR1::true_type);
_M_insert(const value_type&, std::_GLIBCXX_TR1 true_type);
iterator
_M_insert(const value_type&, std::_GLIBCXX_TR1::false_type);
_M_insert(const value_type&, std::_GLIBCXX_TR1 false_type);
void
_M_erase_node(_Node*, _Node**);
@ -394,7 +384,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// Insert and erase
_Insert_Return_Type
insert(const value_type& __v)
{ return _M_insert(__v, std::_GLIBCXX_TR1::integral_constant<bool,
{ return _M_insert(__v, std::_GLIBCXX_TR1 integral_constant<bool,
__unique_keys>()); }
iterator
@ -908,7 +898,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__chc, __cit, __uk>::iterator, bool>
_Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
_M_insert(const value_type& __v, std::_GLIBCXX_TR1::true_type)
_M_insert(const value_type& __v, std::_GLIBCXX_TR1 true_type)
{
const key_type& __k = this->_M_extract(__v);
typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
@ -929,7 +919,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
__chc, __cit, __uk>::iterator
_Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
_H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
_M_insert(const value_type& __v, std::_GLIBCXX_TR1::false_type)
_M_insert(const value_type& __v, std::_GLIBCXX_TR1 false_type)
{
std::pair<bool, std::size_t> __do_rehash
= _M_rehash_policy._M_need_rehash(_M_bucket_count,
@ -1196,8 +1186,5 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
}
}
_GLIBCXX_END_NAMESPACE
} // namespace std::tr1
#endif // _TR1_HASHTABLE
_GLIBCXX_END_NAMESPACE_TR1
}

View file

@ -1,6 +1,6 @@
// Internal policy header for TR1 unordered_set and unordered_map -*- C++ -*-
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
// Copyright (C) 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@ -27,21 +27,15 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/hashtable_policy.h
* This is a TR1 C++ Library header.
/** @file tr1_impl/hashtable_policy.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _TR1_HASHTABLE_POLICY_H
#define _TR1_HASHTABLE_POLICY_H 1
#include <algorithm> // lower_bound
#include <bits/stl_function.h> // equal_to, _Identity, _Select1st
#include <tr1/utility>
#include <ext/type_traits.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
_GLIBCXX_BEGIN_NAMESPACE_TR1
namespace __detail
{
// Helper function: return distance(first, last) for forward
@ -897,8 +891,6 @@ namespace __detail
_H2 _M_h2;
};
} // namespace __detail
_GLIBCXX_END_NAMESPACE
} // namespace std::tr1
#endif // _TR1_HASHTABLE_POLICY_H
_GLIBCXX_END_NAMESPACE_TR1
}

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more