mirror of git://gcc.gnu.org/git/gcc.git
cinttypes: Remove, move contents to C++0x and TR1 headers.
2010-11-02 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1_impl/cinttypes: Remove, move contents to C++0x and TR1 headers. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/boost_sp_counted_base.h: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * src/condition_variable.cc: Adjust; consistently use _GLIBCXX_BEGIN_NAMESPACE and _GLIBCXX_END_NAMESPACE. * src/mutex.cc: Likewise. * src/future.cc: Likewise. * src/atomic.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/std/tuple: Likewise. * include/std/utility: Likewise. * include/std/thread: Likewise.: Likewise. * include/std/type_traits: Likewise. * include/std/memory: Likewise. * include/std/future: Likewise. * include/std/ratio: Likewise. * include/std/chrono: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/functional: Likewise. * include/std/complex: Likewise. * include/std/typeindex: Likewise. * include/std/array: Likewise. * include/bits/regex_compiler.h: Likewise. * include/bits/regex_grep_matcher.tcc: Likewise. * include/bits/regex_grep_matcher.h: Likewise. * include/bits/regex_constants.h: Likewise. * include/bits/regex_cursor.h: Likewise. * include/bits/regex_nfa.tcc: Likewise. * include/bits/shared_ptr_base.h: Likewise. * include/bits/regex_nfa.h: Likewise. * include/bits/random.tcc: Likewise. * include/bits/regex.h: Likewise. * include/bits/random.h: Likewise. * include/bits/regex_error.h: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/cctype: Likewise. * include/c_global/cmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cwctype: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/cinttypes: Likewise. * include/tr1/cstdio: Likewise. * include/tr1/cfenv: Likewise. * include/tr1/utility: Likewise. * include/tr1/cwchar: Likewise. * include/tr1/type_traits: Likewise. * include/tr1/memory: Likewise. * include/tr1/cstdint: Likewise. * include/tr1/regex: Likewise. * include/tr1/cwctype: Likewise. * include/tr1/cstdlib: Likewise. * include/tr1/cctype: Likewise. * include/tr1/cmath: Likewise. * include/tr1/complex: Likewise. * include/tr1/array: Likewise. * include/c_compatibility/fenv.h: Likewise. * include/c_compatibility/stdint.h: Likewise. * include/c_compatibility/inttypes.h: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: Adjust dg-error line numbers. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/ typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. * testsuite/20_util/shared_ptr/cons/43820.cc: Likewise. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. From-SVN: r166211
This commit is contained in:
parent
a9992f7f6b
commit
53dc5044ed
|
|
@ -1,3 +1,96 @@
|
||||||
|
2010-11-02 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
|
* include/tr1_impl/cinttypes: Remove, move contents to C++0x
|
||||||
|
and TR1 headers.
|
||||||
|
* include/tr1_impl/cstdlib: Likewise.
|
||||||
|
* include/tr1_impl/cstdio: Likewise.
|
||||||
|
* include/tr1_impl/cctype: Likewise.
|
||||||
|
* include/tr1_impl/boost_sp_counted_base.h: Likewise.
|
||||||
|
* include/tr1_impl/cmath: Likewise.
|
||||||
|
* include/tr1_impl/cfenv: Likewise.
|
||||||
|
* include/tr1_impl/utility: Likewise.
|
||||||
|
* include/tr1_impl/complex: Likewise.
|
||||||
|
* include/tr1_impl/cwchar: Likewise.
|
||||||
|
* include/tr1_impl/type_traits: Likewise.
|
||||||
|
* include/tr1_impl/cstdint: Likewise.
|
||||||
|
* include/tr1_impl/regex: Likewise.
|
||||||
|
* include/tr1_impl/array: Likewise.
|
||||||
|
* include/tr1_impl/cwctype: Likewise.
|
||||||
|
* include/Makefile.am: Adjust.
|
||||||
|
* include/Makefile.in: Regenerate.
|
||||||
|
* src/condition_variable.cc: Adjust; consistently use
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE and _GLIBCXX_END_NAMESPACE.
|
||||||
|
* src/mutex.cc: Likewise.
|
||||||
|
* src/future.cc: Likewise.
|
||||||
|
* src/atomic.cc: Likewise.
|
||||||
|
* src/chrono.cc: Likewise.
|
||||||
|
* src/thread.cc: Likewise.
|
||||||
|
* include/std/tuple: Likewise.
|
||||||
|
* include/std/utility: Likewise.
|
||||||
|
* include/std/thread: Likewise.: Likewise.
|
||||||
|
* include/std/type_traits: Likewise.
|
||||||
|
* include/std/memory: Likewise.
|
||||||
|
* include/std/future: Likewise.
|
||||||
|
* include/std/ratio: Likewise.
|
||||||
|
* include/std/chrono: Likewise.
|
||||||
|
* include/std/condition_variable: Likewise.
|
||||||
|
* include/std/mutex: Likewise.
|
||||||
|
* include/std/functional: Likewise.
|
||||||
|
* include/std/complex: Likewise.
|
||||||
|
* include/std/typeindex: Likewise.
|
||||||
|
* include/std/array: Likewise.
|
||||||
|
* include/bits/regex_compiler.h: Likewise.
|
||||||
|
* include/bits/regex_grep_matcher.tcc: Likewise.
|
||||||
|
* include/bits/regex_grep_matcher.h: Likewise.
|
||||||
|
* include/bits/regex_constants.h: Likewise.
|
||||||
|
* include/bits/regex_cursor.h: Likewise.
|
||||||
|
* include/bits/regex_nfa.tcc: Likewise.
|
||||||
|
* include/bits/shared_ptr_base.h: Likewise.
|
||||||
|
* include/bits/regex_nfa.h: Likewise.
|
||||||
|
* include/bits/random.tcc: Likewise.
|
||||||
|
* include/bits/regex.h: Likewise.
|
||||||
|
* include/bits/random.h: Likewise.
|
||||||
|
* include/bits/regex_error.h: Likewise.
|
||||||
|
* include/c_global/cinttypes: Likewise.
|
||||||
|
* include/c_global/cstdlib: Likewise.
|
||||||
|
* include/c_global/cstdio: Likewise.
|
||||||
|
* include/c_global/cctype: Likewise.
|
||||||
|
* include/c_global/cmath: Likewise.
|
||||||
|
* include/c_global/cfenv: Likewise.
|
||||||
|
* include/c_global/cwchar: Likewise.
|
||||||
|
* include/c_global/cstdint: Likewise.
|
||||||
|
* include/c_global/cwctype: Likewise.
|
||||||
|
* include/tr1/shared_ptr.h: Likewise.
|
||||||
|
* include/tr1/cinttypes: Likewise.
|
||||||
|
* include/tr1/cstdio: Likewise.
|
||||||
|
* include/tr1/cfenv: Likewise.
|
||||||
|
* include/tr1/utility: Likewise.
|
||||||
|
* include/tr1/cwchar: Likewise.
|
||||||
|
* include/tr1/type_traits: Likewise.
|
||||||
|
* include/tr1/memory: Likewise.
|
||||||
|
* include/tr1/cstdint: Likewise.
|
||||||
|
* include/tr1/regex: Likewise.
|
||||||
|
* include/tr1/cwctype: Likewise.
|
||||||
|
* include/tr1/cstdlib: Likewise.
|
||||||
|
* include/tr1/cctype: Likewise.
|
||||||
|
* include/tr1/cmath: Likewise.
|
||||||
|
* include/tr1/complex: Likewise.
|
||||||
|
* include/tr1/array: Likewise.
|
||||||
|
* include/c_compatibility/fenv.h: Likewise.
|
||||||
|
* include/c_compatibility/stdint.h: Likewise.
|
||||||
|
* include/c_compatibility/inttypes.h: Likewise.
|
||||||
|
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: Adjust
|
||||||
|
dg-error line numbers.
|
||||||
|
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
|
||||||
|
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
|
||||||
|
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
|
||||||
|
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
|
||||||
|
* testsuite/20_util/make_unsigned/requirements/
|
||||||
|
typedefs_neg.cc: Likewise.
|
||||||
|
* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
|
||||||
|
* testsuite/20_util/shared_ptr/cons/43820.cc: Likewise.
|
||||||
|
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.
|
||||||
|
|
||||||
2010-11-02 Paolo Carlini <paolo.carlini@oracle.com
|
2010-11-02 Paolo Carlini <paolo.carlini@oracle.com
|
||||||
|
|
||||||
* testsuite/28_regex/05_constants/syntax_option_type.cc: Avoid
|
* testsuite/28_regex/05_constants/syntax_option_type.cc: Avoid
|
||||||
|
|
|
||||||
|
|
@ -610,26 +610,6 @@ tr1_headers = \
|
||||||
${tr1_srcdir}/wchar.h \
|
${tr1_srcdir}/wchar.h \
|
||||||
${tr1_srcdir}/wctype.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_sp_counted_base.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}/regex \
|
|
||||||
${tr1_impl_srcdir}/type_traits \
|
|
||||||
${tr1_impl_srcdir}/utility
|
|
||||||
|
|
||||||
decimal_srcdir = ${glibcxx_srcdir}/include/decimal
|
decimal_srcdir = ${glibcxx_srcdir}/include/decimal
|
||||||
decimal_builddir = ./decimal
|
decimal_builddir = ./decimal
|
||||||
decimal_headers = \
|
decimal_headers = \
|
||||||
|
|
@ -908,9 +888,9 @@ endif
|
||||||
# CLEANFILES and all-local are kept up-to-date.
|
# CLEANFILES and all-local are kept up-to-date.
|
||||||
allstamped = \
|
allstamped = \
|
||||||
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
|
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
|
||||||
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr1-impl \
|
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \
|
||||||
stamp-decimal stamp-debug stamp-parallel stamp-profile \
|
stamp-debug stamp-parallel stamp-profile stamp-profile-impl \
|
||||||
stamp-profile-impl stamp-host
|
stamp-host
|
||||||
|
|
||||||
# List of all files that are created by explicit building, editing, or
|
# List of all files that are created by explicit building, editing, or
|
||||||
# catenation.
|
# catenation.
|
||||||
|
|
@ -1019,11 +999,6 @@ stamp-tr1: ${tr1_headers}
|
||||||
@-cd ${tr1_builddir} && $(LN_S) $? . 2>/dev/null
|
@-cd ${tr1_builddir} && $(LN_S) $? . 2>/dev/null
|
||||||
@$(STAMP) stamp-tr1
|
@$(STAMP) stamp-tr1
|
||||||
|
|
||||||
stamp-tr1-impl: ${tr1_impl_headers}
|
|
||||||
@-mkdir -p ${tr1_impl_builddir}
|
|
||||||
@-cd ${tr1_impl_builddir} && $(LN_S) $? . 2>/dev/null
|
|
||||||
@$(STAMP) stamp-tr1-impl
|
|
||||||
|
|
||||||
stamp-decimal: ${decimal_headers}
|
stamp-decimal: ${decimal_headers}
|
||||||
@-mkdir -p ${decimal_builddir}
|
@-mkdir -p ${decimal_builddir}
|
||||||
@-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
|
@-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
|
||||||
|
|
@ -1254,9 +1229,6 @@ install-headers:
|
||||||
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
|
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
|
||||||
for file in ${tr1_headers}; do \
|
for file in ${tr1_headers}; do \
|
||||||
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_builddir}; done
|
$(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}/${decimal_builddir}
|
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${decimal_builddir}
|
||||||
for file in ${decimal_headers}; do \
|
for file in ${decimal_headers}; do \
|
||||||
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
|
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
|
||||||
|
|
@ -1303,11 +1275,10 @@ clean-local:
|
||||||
# developer tries to create them via make in the include build
|
# 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
|
# directory. (This is more of an example of how this kind of rule can
|
||||||
# be made.)
|
# be made.)
|
||||||
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
|
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers)
|
||||||
$(decimal_headers) $(ext_headers)
|
$(decimal_headers) $(ext_headers)
|
||||||
$(std_headers): ; @:
|
$(std_headers): ; @:
|
||||||
$(c_base_headers): ; @:
|
$(c_base_headers): ; @:
|
||||||
$(tr1_headers): ; @:
|
$(tr1_headers): ; @:
|
||||||
$(tr1_impl_headers): ; @:
|
|
||||||
$(decimal_headers): ; @:
|
$(decimal_headers): ; @:
|
||||||
$(ext_headers): ; @:
|
$(ext_headers): ; @:
|
||||||
|
|
|
||||||
|
|
@ -848,25 +848,6 @@ tr1_headers = \
|
||||||
${tr1_srcdir}/wchar.h \
|
${tr1_srcdir}/wchar.h \
|
||||||
${tr1_srcdir}/wctype.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_sp_counted_base.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}/regex \
|
|
||||||
${tr1_impl_srcdir}/type_traits \
|
|
||||||
${tr1_impl_srcdir}/utility
|
|
||||||
|
|
||||||
decimal_srcdir = ${glibcxx_srcdir}/include/decimal
|
decimal_srcdir = ${glibcxx_srcdir}/include/decimal
|
||||||
decimal_builddir = ./decimal
|
decimal_builddir = ./decimal
|
||||||
decimal_headers = \
|
decimal_headers = \
|
||||||
|
|
@ -1133,9 +1114,9 @@ PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS)
|
||||||
# CLEANFILES and all-local are kept up-to-date.
|
# CLEANFILES and all-local are kept up-to-date.
|
||||||
allstamped = \
|
allstamped = \
|
||||||
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
|
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
|
||||||
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr1-impl \
|
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \
|
||||||
stamp-decimal stamp-debug stamp-parallel stamp-profile \
|
stamp-debug stamp-parallel stamp-profile stamp-profile-impl \
|
||||||
stamp-profile-impl stamp-host
|
stamp-host
|
||||||
|
|
||||||
|
|
||||||
# List of all files that are created by explicit building, editing, or
|
# List of all files that are created by explicit building, editing, or
|
||||||
|
|
@ -1406,11 +1387,6 @@ stamp-tr1: ${tr1_headers}
|
||||||
@-cd ${tr1_builddir} && $(LN_S) $? . 2>/dev/null
|
@-cd ${tr1_builddir} && $(LN_S) $? . 2>/dev/null
|
||||||
@$(STAMP) stamp-tr1
|
@$(STAMP) stamp-tr1
|
||||||
|
|
||||||
stamp-tr1-impl: ${tr1_impl_headers}
|
|
||||||
@-mkdir -p ${tr1_impl_builddir}
|
|
||||||
@-cd ${tr1_impl_builddir} && $(LN_S) $? . 2>/dev/null
|
|
||||||
@$(STAMP) stamp-tr1-impl
|
|
||||||
|
|
||||||
stamp-decimal: ${decimal_headers}
|
stamp-decimal: ${decimal_headers}
|
||||||
@-mkdir -p ${decimal_builddir}
|
@-mkdir -p ${decimal_builddir}
|
||||||
@-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
|
@-cd ${decimal_builddir} && $(LN_S) $? . 2>/dev/null
|
||||||
|
|
@ -1629,9 +1605,6 @@ install-headers:
|
||||||
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
|
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${tr1_builddir}
|
||||||
for file in ${tr1_headers}; do \
|
for file in ${tr1_headers}; do \
|
||||||
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${tr1_builddir}; done
|
$(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}/${decimal_builddir}
|
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${decimal_builddir}
|
||||||
for file in ${decimal_headers}; do \
|
for file in ${decimal_headers}; do \
|
||||||
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
|
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${decimal_builddir}; done
|
||||||
|
|
@ -1675,12 +1648,11 @@ clean-local:
|
||||||
# developer tries to create them via make in the include build
|
# 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
|
# directory. (This is more of an example of how this kind of rule can
|
||||||
# be made.)
|
# be made.)
|
||||||
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers) $(tr1_impl_headers)
|
.PRECIOUS: $(std_headers) $(c_base_headers) $(tr1_headers)
|
||||||
$(decimal_headers) $(ext_headers)
|
$(decimal_headers) $(ext_headers)
|
||||||
$(std_headers): ; @:
|
$(std_headers): ; @:
|
||||||
$(c_base_headers): ; @:
|
$(c_base_headers): ; @:
|
||||||
$(tr1_headers): ; @:
|
$(tr1_headers): ; @:
|
||||||
$(tr1_impl_headers): ; @:
|
|
||||||
$(decimal_headers): ; @:
|
$(decimal_headers): ; @:
|
||||||
$(ext_headers): ; @:
|
$(ext_headers): ; @:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
// [26.4] Random number generation
|
// [26.4] Random number generation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -5376,6 +5376,6 @@ namespace std
|
||||||
/* @} */ // group random_utilities
|
/* @} */ // group random_utilities
|
||||||
|
|
||||||
/* @} */ // group random
|
/* @} */ // group random
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
#include <numeric> // std::accumulate and std::partial_sum
|
#include <numeric> // std::accumulate and std::partial_sum
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* (Further) implementation-space details.
|
* (Further) implementation-space details.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2818,6 +2818,6 @@ namespace std
|
||||||
}
|
}
|
||||||
return __sum / __tmp;
|
return __sum / __tmp;
|
||||||
}
|
}
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,7 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup regex Regular Expressions
|
* @defgroup regex Regular Expressions
|
||||||
|
|
@ -2422,6 +2421,5 @@ namespace std
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//@} // group regex
|
//@} // group regex
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace __regex
|
namespace __regex
|
||||||
{
|
{
|
||||||
struct _Scanner_base
|
struct _Scanner_base
|
||||||
|
|
@ -1110,6 +1110,7 @@ namespace __regex
|
||||||
__f)._M_nfa())); }
|
__f)._M_nfa())); }
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 sts=2: */
|
/* vim: set ts=8 sw=2 sts=2: */
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace std::regex_constants
|
* @namespace std::regex_constants
|
||||||
|
|
@ -295,5 +294,6 @@ namespace regex_constants
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
} // namespace regex_constants
|
} // namespace regex_constants
|
||||||
} // namespace std
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace __regex
|
namespace __regex
|
||||||
{
|
{
|
||||||
// ABC for pattern matching
|
// ABC for pattern matching
|
||||||
|
|
@ -87,6 +87,5 @@ namespace __regex
|
||||||
{ return _SpecializedCursor<_FwdIterT>(__b, __e); }
|
{ return _SpecializedCursor<_FwdIterT>(__b, __e); }
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 sts=2: */
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
|
|
||||||
namespace regex_constants
|
namespace regex_constants
|
||||||
{
|
{
|
||||||
|
|
@ -156,5 +155,4 @@ namespace regex_constants
|
||||||
__throw_regex_error(regex_constants::error_type __ecode)
|
__throw_regex_error(regex_constants::error_type __ecode)
|
||||||
{ throw regex_error(__ecode); }
|
{ throw regex_error(__ecode); }
|
||||||
|
|
||||||
} // namespace std
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,8 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
template<typename _BiIter>
|
template<typename _BiIter>
|
||||||
class sub_match;
|
class sub_match;
|
||||||
|
|
||||||
|
|
@ -124,8 +123,7 @@ namespace __regex
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#include <bits/regex_grep_matcher.tcc>
|
#include <bits/regex_grep_matcher.tcc>
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 sts=2: */
|
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@
|
||||||
/**
|
/**
|
||||||
* @file bits/regex_grep_matcher.tcc
|
* @file bits/regex_grep_matcher.tcc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
@ -172,6 +172,5 @@ namespace __regex
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 sts=2: */
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
* You should not attempt to use it directly.
|
* You should not attempt to use it directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace __regex
|
namespace __regex
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -397,7 +397,8 @@ namespace __regex
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#include <bits/regex_nfa.tcc>
|
#include <bits/regex_nfa.tcc>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@
|
||||||
*/
|
*/
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace __regex
|
namespace __regex
|
||||||
{
|
{
|
||||||
#ifdef _GLIBCXX_DEBUG
|
#ifdef _GLIBCXX_DEBUG
|
||||||
|
|
@ -166,5 +166,5 @@ _M_clone()
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
} // namespace __regex
|
} // namespace __regex
|
||||||
} // namespace std
|
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,202 @@
|
||||||
|
|
||||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Exception possibly thrown by @c shared_ptr.
|
||||||
|
* @ingroup exceptions
|
||||||
|
*/
|
||||||
|
class bad_weak_ptr : public std::exception
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual char const*
|
||||||
|
what() const throw()
|
||||||
|
{ return "std::bad_weak_ptr"; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Substitute for bad_weak_ptr object in the case of -fno-exceptions.
|
||||||
|
inline void
|
||||||
|
__throw_bad_weak_ptr()
|
||||||
|
{
|
||||||
|
#if __EXCEPTIONS
|
||||||
|
throw bad_weak_ptr();
|
||||||
|
#else
|
||||||
|
__builtin_abort();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
using __gnu_cxx::_Lock_policy;
|
||||||
|
using __gnu_cxx::__default_lock_policy;
|
||||||
|
using __gnu_cxx::_S_single;
|
||||||
|
using __gnu_cxx::_S_mutex;
|
||||||
|
using __gnu_cxx::_S_atomic;
|
||||||
|
|
||||||
|
// Empty helper class except when the template argument is _S_mutex.
|
||||||
|
template<_Lock_policy _Lp>
|
||||||
|
class _Mutex_base
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
// The atomic policy uses fully-fenced builtins, single doesn't care.
|
||||||
|
enum { _S_need_barriers = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class _Mutex_base<_S_mutex>
|
||||||
|
: public __gnu_cxx::__mutex
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
// This policy is used when atomic builtins are not available.
|
||||||
|
// The replacement atomic operations might not have the necessary
|
||||||
|
// memory barriers.
|
||||||
|
enum { _S_need_barriers = 1 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<_Lock_policy _Lp = __default_lock_policy>
|
||||||
|
class _Sp_counted_base
|
||||||
|
: public _Mutex_base<_Lp>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
_Sp_counted_base()
|
||||||
|
: _M_use_count(1), _M_weak_count(1) { }
|
||||||
|
|
||||||
|
virtual
|
||||||
|
~_Sp_counted_base() // nothrow
|
||||||
|
{ }
|
||||||
|
|
||||||
|
// Called when _M_use_count drops to zero, to release the resources
|
||||||
|
// managed by *this.
|
||||||
|
virtual void
|
||||||
|
_M_dispose() = 0; // nothrow
|
||||||
|
|
||||||
|
// Called when _M_weak_count drops to zero.
|
||||||
|
virtual void
|
||||||
|
_M_destroy() // nothrow
|
||||||
|
{ delete this; }
|
||||||
|
|
||||||
|
virtual void*
|
||||||
|
_M_get_deleter(const std::type_info&) = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_add_ref_copy()
|
||||||
|
{ __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_add_ref_lock();
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_release() // nothrow
|
||||||
|
{
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_use_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_use_count);
|
||||||
|
_M_dispose();
|
||||||
|
// There must be a memory barrier between dispose() and destroy()
|
||||||
|
// to ensure that the effects of dispose() are observed in the
|
||||||
|
// thread that runs destroy().
|
||||||
|
// See http://gcc.gnu.org/ml/libstdc++/2005-11/msg00136.html
|
||||||
|
if (_Mutex_base<_Lp>::_S_need_barriers)
|
||||||
|
{
|
||||||
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
|
||||||
|
-1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
||||||
|
_M_destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_weak_add_ref() // nothrow
|
||||||
|
{ __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_weak_release() // nothrow
|
||||||
|
{
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
||||||
|
if (_Mutex_base<_Lp>::_S_need_barriers)
|
||||||
|
{
|
||||||
|
// See _M_release(),
|
||||||
|
// destroy() must observe results of dispose()
|
||||||
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
}
|
||||||
|
_M_destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long
|
||||||
|
_M_get_use_count() const // nothrow
|
||||||
|
{
|
||||||
|
// No memory barrier is used here so there is no synchronization
|
||||||
|
// with other threads.
|
||||||
|
return const_cast<const volatile _Atomic_word&>(_M_use_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
_Sp_counted_base(_Sp_counted_base const&);
|
||||||
|
_Sp_counted_base& operator=(_Sp_counted_base const&);
|
||||||
|
|
||||||
|
_Atomic_word _M_use_count; // #shared
|
||||||
|
_Atomic_word _M_weak_count; // #weak + (#shared != 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_single>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
||||||
|
{
|
||||||
|
_M_use_count = 0;
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_mutex>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
__gnu_cxx::__scoped_lock sentry(*this);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
||||||
|
{
|
||||||
|
_M_use_count = 0;
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_atomic>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
// Perform lock-free add-if-not-zero operation.
|
||||||
|
_Atomic_word __count;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
__count = _M_use_count;
|
||||||
|
if (__count == 0)
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
|
||||||
|
// Replace the current counter value with the old value + 1, as
|
||||||
|
// long as it's not changed meanwhile.
|
||||||
|
}
|
||||||
|
while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
|
||||||
|
__count + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations.
|
// Forward declarations.
|
||||||
template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
|
template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
|
||||||
class __shared_ptr;
|
class __shared_ptr;
|
||||||
|
|
|
||||||
|
|
@ -37,22 +37,46 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
#if _GLIBCXX_USE_C99_FENV_TR1
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#undef feclearexcept
|
||||||
# include <tr1_impl/cfenv>
|
#undef fegetexceptflag
|
||||||
# else
|
#undef feraiseexcept
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
#undef fesetexceptflag
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef fetestexcept
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
#undef fegetround
|
||||||
# define _GLIBCXX_TR1
|
#undef fesetround
|
||||||
# include <tr1_impl/cfenv>
|
#undef fegetenv
|
||||||
# undef _GLIBCXX_TR1
|
#undef feholdexcept
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#undef fesetenv
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef feupdateenv
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# endif
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
#endif
|
|
||||||
|
// 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
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_FENV_TR1
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif // _GLIBCXX_FENV_H
|
#endif // _GLIBCXX_FENV_H
|
||||||
|
|
|
||||||
|
|
@ -48,22 +48,38 @@
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
# endif
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# include <tr1_impl/cinttypes>
|
// types
|
||||||
# else
|
using ::imaxdiv_t;
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// functions
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
using ::imaxabs;
|
||||||
# define _GLIBCXX_TR1
|
|
||||||
# include <tr1_impl/cinttypes>
|
// May collide with _Longlong abs(_Longlong), and is not described
|
||||||
# undef _GLIBCXX_TR1
|
// anywhere outside the synopsis. Likely, a defect.
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
//
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// intmax_t abs(intmax_t)
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# endif
|
using ::imaxdiv;
|
||||||
|
|
||||||
|
// Likewise, with lldiv_t div(_Longlong, _Longlong).
|
||||||
|
//
|
||||||
|
// imaxdiv_t div(intmax_t, intmax_t)
|
||||||
|
|
||||||
|
using ::strtoimax;
|
||||||
|
using ::strtoumax;
|
||||||
|
|
||||||
|
#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
|
||||||
|
using ::wcstoimax;
|
||||||
|
using ::wcstoumax;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,22 +56,49 @@
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
# endif
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# include <tr1_impl/cstdint>
|
using ::int8_t;
|
||||||
# else
|
using ::int16_t;
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
using ::int32_t;
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using ::int64_t;
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# define _GLIBCXX_TR1
|
using ::int_fast8_t;
|
||||||
# include <tr1_impl/cstdint>
|
using ::int_fast16_t;
|
||||||
# undef _GLIBCXX_TR1
|
using ::int_fast32_t;
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
using ::int_fast64_t;
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
using ::int_least8_t;
|
||||||
# endif
|
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
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,22 +80,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
#ifdef _GLIBCXX_USE_C99_CTYPE_TR1
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#undef isblank
|
||||||
# include <tr1_impl/cctype>
|
|
||||||
# else
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using ::isblank;
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# define _GLIBCXX_TR1
|
_GLIBCXX_END_NAMESPACE
|
||||||
# include <tr1_impl/cctype>
|
|
||||||
# undef _GLIBCXX_TR1
|
#endif // _GLIBCXX_USE_C99_CTYPE_TR1
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -33,29 +33,53 @@
|
||||||
|
|
||||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
|
|
||||||
#if _GLIBCXX_HAVE_FENV_H
|
#if _GLIBCXX_HAVE_FENV_H
|
||||||
# include <fenv.h>
|
# include <fenv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#ifdef _GLIBCXX_USE_C99_FENV_TR1
|
||||||
# include <tr1_impl/cfenv>
|
|
||||||
#else
|
#undef feclearexcept
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
#undef fegetexceptflag
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef feraiseexcept
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
#undef fesetexceptflag
|
||||||
# define _GLIBCXX_TR1
|
#undef fetestexcept
|
||||||
# include <tr1_impl/cfenv>
|
#undef fegetround
|
||||||
# undef _GLIBCXX_TR1
|
#undef fesetround
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#undef fegetenv
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef feholdexcept
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
#undef fesetenv
|
||||||
#endif
|
#undef feupdateenv
|
||||||
|
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_FENV_TR1
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif // _GLIBCXX_CFENV
|
#endif // _GLIBCXX_CFENV
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,7 @@
|
||||||
|
|
||||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
@ -54,18 +50,39 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#ifdef _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
# include <tr1_impl/cinttypes>
|
|
||||||
#else
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// types
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
using ::imaxdiv_t;
|
||||||
# define _GLIBCXX_TR1
|
|
||||||
# include <tr1_impl/cinttypes>
|
// functions
|
||||||
# undef _GLIBCXX_TR1
|
using ::imaxabs;
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// May collide with _Longlong abs(_Longlong), and is not described
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
// 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;
|
||||||
|
|
||||||
|
#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
|
||||||
|
using ::wcstoimax;
|
||||||
|
using ::wcstoumax;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif // _GLIBCXX_CINTTYPES
|
#endif // _GLIBCXX_CINTTYPES
|
||||||
|
|
|
||||||
|
|
@ -846,22 +846,928 @@ _GLIBCXX_END_NAMESPACE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
#ifdef _GLIBCXX_USE_C99_MATH_TR1
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#undef acosh
|
||||||
# include <tr1_impl/cmath>
|
#undef acoshf
|
||||||
# else
|
#undef acoshl
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
#undef asinh
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef asinhf
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
#undef asinhl
|
||||||
# define _GLIBCXX_TR1
|
#undef atanh
|
||||||
# include <tr1_impl/cmath>
|
#undef atanhf
|
||||||
# undef _GLIBCXX_TR1
|
#undef atanhl
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#undef cbrt
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef cbrtf
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
#undef cbrtl
|
||||||
# endif
|
#undef copysign
|
||||||
#endif
|
#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 remquof
|
||||||
|
#undef remquol
|
||||||
|
#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
|
||||||
|
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
|
// 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 ::remquof;
|
||||||
|
using ::remquol;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
#if _GLIBCXX_USE_C99_MATH
|
||||||
|
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
|
||||||
|
|
||||||
|
/// Function template definitions [8.16.3].
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
fpclassify(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
|
||||||
|
FP_SUBNORMAL, FP_ZERO, __type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isfinite(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isfinite(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isinf(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isinf(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isnan(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isnan(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isnormal(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isnormal(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
signbit(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_signbit(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isgreater(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isgreater(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isgreaterequal(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isgreaterequal(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isless(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isless(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
islessequal(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_islessequal(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
islessgreater(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_islessgreater(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isunordered(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isunordered(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// Additional overloads [8.16.4].
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_MATH_TR1
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,7 @@
|
||||||
|
|
||||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
|
|
||||||
|
|
@ -62,18 +58,50 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
# include <tr1_impl/cstdint>
|
|
||||||
#else
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using ::int8_t;
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
using ::int16_t;
|
||||||
# define _GLIBCXX_TR1
|
using ::int32_t;
|
||||||
# include <tr1_impl/cstdint>
|
using ::int64_t;
|
||||||
# undef _GLIBCXX_TR1
|
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
using ::int_fast8_t;
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using ::int_fast16_t;
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
using ::int_fast32_t;
|
||||||
#endif
|
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
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif // _GLIBCXX_CSTDINT
|
#endif // _GLIBCXX_CSTDINT
|
||||||
|
|
|
||||||
|
|
@ -185,23 +185,4 @@ _GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_USE_C99
|
#endif // _GLIBCXX_USE_C99
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
# 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
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -215,27 +215,38 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_USE_C99
|
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
|
||||||
# include <tr1_impl/cstdlib>
|
// types
|
||||||
# else
|
using std::lldiv_t;
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// functions
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
using std::llabs;
|
||||||
# define _GLIBCXX_TR1
|
using std::lldiv;
|
||||||
# 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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99
|
||||||
|
|
||||||
#endif // !_GLIBCXX_HOSTED
|
#endif // !_GLIBCXX_HOSTED
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -273,22 +273,34 @@ _GLIBCXX_END_NAMESPACE
|
||||||
#endif //_GLIBCXX_USE_WCHAR_T
|
#endif //_GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# include <tr1_impl/cwchar>
|
|
||||||
# else
|
#if _GLIBCXX_HAVE_WCSTOF
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
using std::wcstof;
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#endif
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
#if _GLIBCXX_HAVE_VFWSCANF
|
||||||
# define _GLIBCXX_TR1
|
using std::vfwscanf;
|
||||||
# include <tr1_impl/cwchar>
|
#endif
|
||||||
# undef _GLIBCXX_TR1
|
#if _GLIBCXX_HAVE_VSWSCANF
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
using std::vswscanf;
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#endif
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
#if _GLIBCXX_HAVE_VWSCANF
|
||||||
# endif
|
using std::vwscanf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if _GLIBCXX_USE_C99
|
||||||
|
using std::wcstold;
|
||||||
|
using std::wcstoll;
|
||||||
|
using std::wcstoull;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -111,22 +111,19 @@ _GLIBCXX_END_NAMESPACE
|
||||||
#endif //_GLIBCXX_USE_WCHAR_T
|
#endif //_GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# 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
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
|
#if _GLIBCXX_HAVE_ISWBLANK
|
||||||
|
using std::iswblank;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_CWCTYPE
|
||||||
|
|
|
||||||
|
|
@ -35,26 +35,236 @@
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <bits/stl_algobase.h>
|
#include <bits/stl_algobase.h>
|
||||||
#include <bits/range_access.h>
|
#include <bits/range_access.h>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# include <tr1_impl/array>
|
|
||||||
#else
|
/**
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
* @brief A standard container for storing a fixed size sequence of elements.
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
*
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
* @ingroup sequences
|
||||||
# define _GLIBCXX_TR1
|
*
|
||||||
# include <tr1_impl/array>
|
* Meets the requirements of a <a href="tables.html#65">container</a>, a
|
||||||
# undef _GLIBCXX_TR1
|
* <a href="tables.html#66">reversible container</a>, and a
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
* <a href="tables.html#67">sequence</a>.
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
*
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
* Sets support random access iterators.
|
||||||
#endif
|
*
|
||||||
|
* @param Tp Type of element. Required to be a complete type.
|
||||||
|
* @param N Number of elements.
|
||||||
|
*/
|
||||||
|
template<typename _Tp, std::size_t _Nm>
|
||||||
|
struct array
|
||||||
|
{
|
||||||
|
typedef _Tp value_type;
|
||||||
|
typedef _Tp* pointer;
|
||||||
|
typedef const _Tp* const_pointer;
|
||||||
|
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];
|
||||||
|
|
||||||
|
// No explicit construct/copy/destroy for aggregate type.
|
||||||
|
|
||||||
|
// DR 776.
|
||||||
|
void
|
||||||
|
fill(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(std::__addressof(_M_instance[0])); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
begin() const
|
||||||
|
{ return const_iterator(std::__addressof(_M_instance[0])); }
|
||||||
|
|
||||||
|
iterator
|
||||||
|
end()
|
||||||
|
{ return iterator(std::__addressof(_M_instance[_Nm])); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
end() const
|
||||||
|
{ return const_iterator(std::__addressof(_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()); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
cbegin() const
|
||||||
|
{ return const_iterator(std::__addressof(_M_instance[0])); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
cend() const
|
||||||
|
{ return const_iterator(std::__addressof(_M_instance[_Nm])); }
|
||||||
|
|
||||||
|
const_reverse_iterator
|
||||||
|
crbegin() const
|
||||||
|
{ return const_reverse_iterator(end()); }
|
||||||
|
|
||||||
|
const_reverse_iterator
|
||||||
|
crend() const
|
||||||
|
{ return const_reverse_iterator(begin()); }
|
||||||
|
|
||||||
|
// Capacity.
|
||||||
|
constexpr size_type
|
||||||
|
size() const { return _Nm; }
|
||||||
|
|
||||||
|
constexpr size_type
|
||||||
|
max_size() const { return _Nm; }
|
||||||
|
|
||||||
|
constexpr 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)
|
||||||
|
{
|
||||||
|
if (__n >= _Nm)
|
||||||
|
std::__throw_out_of_range(__N("array::at"));
|
||||||
|
return _M_instance[__n];
|
||||||
|
}
|
||||||
|
|
||||||
|
const_reference
|
||||||
|
at(size_type __n) const
|
||||||
|
{
|
||||||
|
if (__n >= _Nm)
|
||||||
|
std::__throw_out_of_range(__N("array::at"));
|
||||||
|
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 std::__addressof(_M_instance[0]); }
|
||||||
|
|
||||||
|
const _Tp*
|
||||||
|
data() const
|
||||||
|
{ return std::__addressof(_M_instance[0]); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
{ __one.swap(__two); }
|
||||||
|
|
||||||
|
// Tuple interface to class template array [6.2.2.5].
|
||||||
|
|
||||||
|
/// tuple_size
|
||||||
|
template<typename _Tp>
|
||||||
|
class tuple_size;
|
||||||
|
|
||||||
|
/// tuple_element
|
||||||
|
template<std::size_t _Int, typename _Tp>
|
||||||
|
class tuple_element;
|
||||||
|
|
||||||
|
template<typename _Tp, std::size_t _Nm>
|
||||||
|
struct tuple_size<array<_Tp, _Nm> >
|
||||||
|
{ static const std::size_t value = _Nm; };
|
||||||
|
|
||||||
|
template<typename _Tp, std::size_t _Nm>
|
||||||
|
const std::size_t
|
||||||
|
tuple_size<array<_Tp, _Nm> >::value;
|
||||||
|
|
||||||
|
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
||||||
|
struct tuple_element<_Int, array<_Tp, _Nm> >
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
||||||
|
inline _Tp&
|
||||||
|
get(array<_Tp, _Nm>& __arr)
|
||||||
|
{ return __arr[_Int]; }
|
||||||
|
|
||||||
|
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
||||||
|
inline const _Tp&
|
||||||
|
get(const array<_Tp, _Nm>& __arr)
|
||||||
|
{ return __arr[_Int]; }
|
||||||
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,6 @@
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ratio>
|
#include <ratio>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
@ -46,8 +42,8 @@
|
||||||
|
|
||||||
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup chrono Time
|
* @defgroup chrono Time
|
||||||
* @ingroup utilities
|
* @ingroup utilities
|
||||||
|
|
@ -689,7 +685,7 @@ namespace std
|
||||||
} // namespace chrono
|
} // namespace chrono
|
||||||
|
|
||||||
// @} group chrono
|
// @} group chrono
|
||||||
} // namespace std
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif //_GLIBCXX_USE_C99_STDINT_TR1
|
#endif //_GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1523,25 +1523,323 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# 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/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
|
|
||||||
|
|
||||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
|
// 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>&);
|
||||||
|
// DR 595.
|
||||||
|
template<typename _Tp> _Tp fabs(const std::complex<_Tp>&);
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
__complex_acos(const std::complex<_Tp>& __z)
|
||||||
|
{
|
||||||
|
const std::complex<_Tp> __t = std::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
|
||||||
|
/// 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>
|
||||||
|
acos(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_acos(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
__complex_asin(const std::complex<_Tp>& __z)
|
||||||
|
{
|
||||||
|
std::complex<_Tp> __t(-__z.imag(), __z.real());
|
||||||
|
__t = std::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
|
||||||
|
/// 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>
|
||||||
|
asin(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_asin(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// atan(__z) [8.1.4].
|
||||||
|
// Effects: Behaves the same as C99 function catan, defined
|
||||||
|
// in subclause 7.3.5.3.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
atan(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_atan(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// acosh(__z) [8.1.5].
|
||||||
|
// Effects: Behaves the same as C99 function cacosh, defined
|
||||||
|
// in subclause 7.3.6.1.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
acosh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_acosh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// asinh(__z) [8.1.6].
|
||||||
|
// Effects: Behaves the same as C99 function casin, defined
|
||||||
|
// in subclause 7.3.6.2.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
asinh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_asinh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// atanh(__z) [8.1.7].
|
||||||
|
// Effects: Behaves the same as C99 function catanh, defined
|
||||||
|
// in subclause 7.3.6.3.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
atanh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_atanh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline _Tp
|
||||||
|
/// fabs(__z) [8.1.8].
|
||||||
|
// Effects: Behaves the same as C99 function cabs, defined
|
||||||
|
// in subclause 7.3.8.1.
|
||||||
|
fabs(const std::complex<_Tp>& __z)
|
||||||
|
{ return std::abs(__z); }
|
||||||
|
|
||||||
|
/// 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;
|
||||||
|
#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
|
||||||
|
return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L)
|
||||||
|
: __type();
|
||||||
|
#else
|
||||||
|
return std::arg(std::complex<__type>(__x));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
|
inline typename __gnu_cxx::__promote<_Tp>::__type
|
||||||
|
real(_Tp __x)
|
||||||
|
{ return __x; }
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
// Forward declarations.
|
// Forward declarations.
|
||||||
// DR 781.
|
// DR 781.
|
||||||
template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
|
template<typename _Tp> std::complex<_Tp> proj(const std::complex<_Tp>&);
|
||||||
|
|
@ -1594,6 +1892,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
#endif /* _GLIBCXX_COMPLEX */
|
#endif /* _GLIBCXX_COMPLEX */
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@
|
||||||
|
|
||||||
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup condition_variables Condition Variables
|
* @defgroup condition_variables Condition Variables
|
||||||
* @ingroup concurrency
|
* @ingroup concurrency
|
||||||
|
|
@ -254,7 +254,7 @@ namespace std
|
||||||
};
|
};
|
||||||
|
|
||||||
// @} group condition_variables
|
// @} group condition_variables
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@
|
||||||
#include <bits/functexcept.h>
|
#include <bits/functexcept.h>
|
||||||
#include <bits/functional_hash.h>
|
#include <bits/functional_hash.h>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
_GLIBCXX_HAS_NESTED_TYPE(result_type)
|
_GLIBCXX_HAS_NESTED_TYPE(result_type)
|
||||||
|
|
||||||
/// If we have found a result_type, extract it.
|
/// If we have found a result_type, extract it.
|
||||||
|
|
@ -2244,7 +2244,8 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
|
||||||
inline void
|
inline void
|
||||||
swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
|
swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
|
||||||
{ __x.swap(__y); }
|
{ __x.swap(__y); }
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <bits/functexcept.h>
|
#include <bits/functexcept.h>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup futures Futures
|
* @defgroup futures Futures
|
||||||
* @ingroup concurrency
|
* @ingroup concurrency
|
||||||
|
|
@ -1364,7 +1364,7 @@ namespace std
|
||||||
// && _GLIBCXX_ATOMIC_BUILTINS_4
|
// && _GLIBCXX_ATOMIC_BUILTINS_4
|
||||||
|
|
||||||
// @} group futures
|
// @} group futures
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,6 @@
|
||||||
#include <bits/stl_raw_storage_iter.h>
|
#include <bits/stl_raw_storage_iter.h>
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
# endif
|
|
||||||
# include <exception> // std::exception
|
# include <exception> // std::exception
|
||||||
# include <typeinfo> // std::type_info in get_deleter
|
# include <typeinfo> // std::type_info in get_deleter
|
||||||
# include <iosfwd> // std::basic_ostream
|
# include <iosfwd> // std::basic_ostream
|
||||||
|
|
@ -86,19 +83,6 @@
|
||||||
# include <backward/auto_ptr.h>
|
# include <backward/auto_ptr.h>
|
||||||
# endif
|
# endif
|
||||||
# include <bits/unique_ptr.h>
|
# include <bits/unique_ptr.h>
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# include <tr1_impl/boost_sp_counted_base.h>
|
|
||||||
# else
|
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# define _GLIBCXX_TR1
|
|
||||||
# include <tr1_impl/boost_sp_counted_base.h>
|
|
||||||
# undef _GLIBCXX_TR1
|
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
# endif
|
|
||||||
# include <bits/shared_ptr.h>
|
# include <bits/shared_ptr.h>
|
||||||
#else
|
#else
|
||||||
# include <backward/auto_ptr.h>
|
# include <backward/auto_ptr.h>
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@
|
||||||
|
|
||||||
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup mutexes Mutexes
|
* @defgroup mutexes Mutexes
|
||||||
* @ingroup concurrency
|
* @ingroup concurrency
|
||||||
|
|
@ -739,7 +739,7 @@ namespace std
|
||||||
}
|
}
|
||||||
|
|
||||||
// @} group mutexes
|
// @} group mutexes
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@
|
||||||
|
|
||||||
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup ratio Rational Arithmetic
|
* @defgroup ratio Rational Arithmetic
|
||||||
* @ingroup utilities
|
* @ingroup utilities
|
||||||
|
|
@ -339,7 +339,7 @@ namespace std
|
||||||
typedef ratio< 1000000000000000000, 1> exa;
|
typedef ratio< 1000000000000000000, 1> exa;
|
||||||
|
|
||||||
// @} group ratio
|
// @} group ratio
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif //_GLIBCXX_USE_C99_STDINT_TR1
|
#endif //_GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@
|
||||||
|
|
||||||
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @defgroup threads Threads
|
* @defgroup threads Threads
|
||||||
* @ingroup concurrency
|
* @ingroup concurrency
|
||||||
|
|
@ -283,7 +283,7 @@ namespace std
|
||||||
}
|
}
|
||||||
|
|
||||||
// @} group threads
|
// @} group threads
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
// Adds a const reference to a non-reference type.
|
// Adds a const reference to a non-reference type.
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct __add_c_ref
|
struct __add_c_ref
|
||||||
|
|
@ -791,7 +791,8 @@ namespace std
|
||||||
__do_cons(tuple<_Args...>&& __tuple,
|
__do_cons(tuple<_Args...>&& __tuple,
|
||||||
const _Index_tuple<_Indexes...>&)
|
const _Index_tuple<_Indexes...>&)
|
||||||
{ return _Tp(std::forward<_Args>(get<_Indexes>(__tuple))...); }
|
{ return _Tp(std::forward<_Args>(get<_Indexes>(__tuple))...); }
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,32 +35,463 @@
|
||||||
# include <bits/c++0x_warning.h>
|
# include <bits/c++0x_warning.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# error C++0x header cannot be included from TR1 header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# 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
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup metaprogramming
|
* @addtogroup metaprogramming
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
struct __sfinae_types
|
||||||
|
{
|
||||||
|
typedef char __one;
|
||||||
|
typedef struct { char __arr[2]; } __two;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_0_HELPER \
|
||||||
|
template<>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_1_HELPER \
|
||||||
|
template<typename _Tp>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_2_HELPER \
|
||||||
|
template<typename _Tp, typename _Cp>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
|
||||||
|
_DEFINE_SPEC_##_Order##_HELPER \
|
||||||
|
struct _Trait<_Type> \
|
||||||
|
: public integral_constant<bool, _Value> { };
|
||||||
|
|
||||||
|
// helper classes.
|
||||||
|
|
||||||
|
/// integral_constant
|
||||||
|
template<typename _Tp, _Tp __v>
|
||||||
|
struct integral_constant
|
||||||
|
{
|
||||||
|
static constexpr _Tp value = __v;
|
||||||
|
typedef _Tp value_type;
|
||||||
|
typedef integral_constant<_Tp, __v> type;
|
||||||
|
constexpr operator value_type() { return value; }
|
||||||
|
};
|
||||||
|
|
||||||
|
/// typedef for true_type
|
||||||
|
typedef integral_constant<bool, true> true_type;
|
||||||
|
|
||||||
|
/// typedef for false_type
|
||||||
|
typedef integral_constant<bool, false> false_type;
|
||||||
|
|
||||||
|
template<typename _Tp, _Tp __v>
|
||||||
|
constexpr _Tp integral_constant<_Tp, __v>::value;
|
||||||
|
|
||||||
|
/// remove_cv
|
||||||
|
template<typename>
|
||||||
|
struct remove_cv;
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_void_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_void_helper, void, true)
|
||||||
|
|
||||||
|
// primary type categories.
|
||||||
|
|
||||||
|
/// is_void
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_void
|
||||||
|
: public integral_constant<bool, (__is_void_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_integral_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, bool, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, char, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, signed char, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
|
||||||
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
|
||||||
|
#endif
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, short, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, int, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, long long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
|
||||||
|
|
||||||
|
/// is_integral
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_integral
|
||||||
|
: public integral_constant<bool, (__is_integral_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_floating_point_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, float, true)
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, double, true)
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
|
||||||
|
|
||||||
|
/// is_floating_point
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_floating_point
|
||||||
|
: public integral_constant<bool, (__is_floating_point_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_array
|
||||||
|
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_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
|
||||||
|
|
||||||
|
/// is_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_pointer
|
||||||
|
: public integral_constant<bool, (__is_pointer_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_reference
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_reference;
|
||||||
|
|
||||||
|
/// is_function
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_function;
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_member_object_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
|
||||||
|
!is_function<_Tp>::value)
|
||||||
|
|
||||||
|
/// is_member_object_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_object_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_object_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_member_function_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
|
||||||
|
is_function<_Tp>::value)
|
||||||
|
|
||||||
|
/// is_member_function_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_function_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_function_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_enum
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_enum
|
||||||
|
: public integral_constant<bool, __is_enum(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_union
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_union
|
||||||
|
: public integral_constant<bool, __is_union(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_class
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_class
|
||||||
|
: public integral_constant<bool, __is_class(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_function
|
||||||
|
template<typename>
|
||||||
|
struct is_function
|
||||||
|
: public false_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...)>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......)>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) const>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) const>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) const volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) const volatile>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
// composite type traits.
|
||||||
|
|
||||||
|
/// is_arithmetic
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_arithmetic
|
||||||
|
: public integral_constant<bool, (is_integral<_Tp>::value
|
||||||
|
|| is_floating_point<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_fundamental
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_fundamental
|
||||||
|
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|
||||||
|
|| is_void<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_object
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_object
|
||||||
|
: public integral_constant<bool, !(is_function<_Tp>::value
|
||||||
|
|| is_reference<_Tp>::value
|
||||||
|
|| is_void<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_member_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_pointer;
|
||||||
|
|
||||||
|
/// is_scalar
|
||||||
|
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)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_compound
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_compound
|
||||||
|
: public integral_constant<bool, !is_fundamental<_Tp>::value> { };
|
||||||
|
|
||||||
|
/// is_member_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct __is_member_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true)
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
// type properties.
|
||||||
|
/// is_const
|
||||||
|
template<typename>
|
||||||
|
struct is_const
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_const<_Tp const>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
/// is_volatile
|
||||||
|
template<typename>
|
||||||
|
struct is_volatile
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_volatile<_Tp volatile>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
/// is_empty
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_empty
|
||||||
|
: public integral_constant<bool, __is_empty(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_polymorphic
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_polymorphic
|
||||||
|
: public integral_constant<bool, __is_polymorphic(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_abstract
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_abstract
|
||||||
|
: public integral_constant<bool, __is_abstract(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// has_virtual_destructor
|
||||||
|
template<typename _Tp>
|
||||||
|
struct has_virtual_destructor
|
||||||
|
: public integral_constant<bool, __has_virtual_destructor(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// alignment_of
|
||||||
|
template<typename _Tp>
|
||||||
|
struct alignment_of
|
||||||
|
: public integral_constant<std::size_t, __alignof__(_Tp)> { };
|
||||||
|
|
||||||
|
/// rank
|
||||||
|
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> { };
|
||||||
|
|
||||||
|
/// extent
|
||||||
|
template<typename, unsigned _Uint = 0>
|
||||||
|
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>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename _Tp, unsigned _Uint>
|
||||||
|
struct extent<_Tp[], _Uint>
|
||||||
|
: public integral_constant<std::size_t,
|
||||||
|
_Uint == 0 ? 0 : extent<_Tp,
|
||||||
|
_Uint - 1>::value>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
// relationships between types [4.6].
|
||||||
|
|
||||||
|
/// is_same
|
||||||
|
template<typename, typename>
|
||||||
|
struct is_same
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_same<_Tp, _Tp>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
// const-volatile modifications [4.7.1].
|
||||||
|
|
||||||
|
/// remove_const
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_const
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_const<_Tp const>
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
/// remove_volatile
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_volatile
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_volatile<_Tp volatile>
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
/// remove_cv
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_cv
|
||||||
|
{
|
||||||
|
typedef typename
|
||||||
|
remove_const<typename remove_volatile<_Tp>::type>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// add_const
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_const
|
||||||
|
{ typedef _Tp const type; };
|
||||||
|
|
||||||
|
/// add_volatile
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_volatile
|
||||||
|
{ typedef _Tp volatile type; };
|
||||||
|
|
||||||
|
/// add_cv
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_cv
|
||||||
|
{
|
||||||
|
typedef typename
|
||||||
|
add_const<typename add_volatile<_Tp>::type>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
// array modifications.
|
||||||
|
|
||||||
|
/// remove_extent
|
||||||
|
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; };
|
||||||
|
|
||||||
|
/// remove_all_extents
|
||||||
|
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; };
|
||||||
|
|
||||||
|
// pointer modifications.
|
||||||
|
|
||||||
|
template<typename _Tp, typename>
|
||||||
|
struct __remove_pointer_helper
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp, typename _Up>
|
||||||
|
struct __remove_pointer_helper<_Tp, _Up*>
|
||||||
|
{ typedef _Up type; };
|
||||||
|
|
||||||
|
/// remove_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_pointer
|
||||||
|
: public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct remove_reference;
|
||||||
|
|
||||||
|
/// add_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_pointer
|
||||||
|
{ typedef typename remove_reference<_Tp>::type* type; };
|
||||||
|
|
||||||
// Primary classification traits.
|
// Primary classification traits.
|
||||||
|
|
||||||
|
|
@ -731,8 +1162,13 @@ namespace std
|
||||||
<typename remove_cv<_Tp>::type>::value> \
|
<typename remove_cv<_Tp>::type>::value> \
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
|
#undef _DEFINE_SPEC_0_HELPER
|
||||||
|
#undef _DEFINE_SPEC_1_HELPER
|
||||||
|
#undef _DEFINE_SPEC_2_HELPER
|
||||||
|
#undef _DEFINE_SPEC
|
||||||
|
|
||||||
// @} group metaprogramming
|
// @} group metaprogramming
|
||||||
}
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
@brief The class type_index provides a simple wrapper for type_info
|
@brief The class type_index provides a simple wrapper for type_info
|
||||||
which can be used as an index type in associative containers (23.6)
|
which can be used as an index type in associative containers (23.6)
|
||||||
|
|
@ -98,7 +98,8 @@ namespace std
|
||||||
operator()(const type_index& __ti) const
|
operator()(const type_index& __ti) const
|
||||||
{ return __ti.hash_code(); }
|
{ return __ti.hash_code(); }
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// <utility> -*- C++ -*-
|
// <utility> -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -71,24 +71,73 @@
|
||||||
#include <bits/stl_pair.h>
|
#include <bits/stl_pair.h>
|
||||||
|
|
||||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#include <bits/move.h>
|
||||||
# error C++0x header cannot be included from TR1 header
|
#include <initializer_list>
|
||||||
# endif
|
|
||||||
# if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
# include <tr1_impl/utility>
|
|
||||||
# else
|
template<class _Tp>
|
||||||
# define _GLIBCXX_INCLUDE_AS_CXX0X
|
class tuple_size;
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
|
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1
|
template<std::size_t _Int, class _Tp>
|
||||||
# define _GLIBCXX_TR1
|
class tuple_element;
|
||||||
# include <tr1_impl/utility>
|
|
||||||
# undef _GLIBCXX_TR1
|
// Various functions which give std::pair a tuple-like interface.
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
template<class _Tp1, class _Tp2>
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
struct tuple_size<std::pair<_Tp1, _Tp2> >
|
||||||
# undef _GLIBCXX_INCLUDE_AS_CXX0X
|
{ static const std::size_t value = 2; };
|
||||||
# endif
|
|
||||||
# include <bits/move.h>
|
template<class _Tp1, class _Tp2>
|
||||||
# include <initializer_list>
|
const std::size_t
|
||||||
|
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<std::size_t _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<std::size_t _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<std::size_t _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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _GLIBCXX_UTILITY */
|
#endif /* _GLIBCXX_UTILITY */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// class template array -*- C++ -*-
|
// class template array -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||||
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -31,24 +32,217 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#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>
|
#include <bits/stl_algobase.h>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
namespace std
|
||||||
# include <tr1_impl/array>
|
{
|
||||||
#else
|
namespace tr1
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
/**
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
* @brief A standard container for storing a fixed size sequence of elements.
|
||||||
# define _GLIBCXX_TR1 tr1::
|
*
|
||||||
# include <tr1_impl/array>
|
* @ingroup sequences
|
||||||
# undef _GLIBCXX_TR1
|
*
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
* Meets the requirements of a <a href="tables.html#65">container</a>, a
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
* <a href="tables.html#66">reversible container</a>, and a
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
* <a href="tables.html#67">sequence</a>.
|
||||||
#endif
|
*
|
||||||
|
* Sets support random access iterators.
|
||||||
|
*
|
||||||
|
* @param Tp Type of element. Required to be a complete type.
|
||||||
|
* @param N Number of elements.
|
||||||
|
*/
|
||||||
|
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];
|
||||||
|
|
||||||
|
// 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(std::__addressof(_M_instance[0])); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
begin() const
|
||||||
|
{ return const_iterator(std::__addressof(_M_instance[0])); }
|
||||||
|
|
||||||
|
iterator
|
||||||
|
end()
|
||||||
|
{ return iterator(std::__addressof(_M_instance[_Nm])); }
|
||||||
|
|
||||||
|
const_iterator
|
||||||
|
end() const
|
||||||
|
{ return const_iterator(std::__addressof(_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)
|
||||||
|
{
|
||||||
|
if (__n >= _Nm)
|
||||||
|
std::__throw_out_of_range(__N("array::at"));
|
||||||
|
return _M_instance[__n];
|
||||||
|
}
|
||||||
|
|
||||||
|
const_reference
|
||||||
|
at(size_type __n) const
|
||||||
|
{
|
||||||
|
if (__n >= _Nm)
|
||||||
|
std::__throw_out_of_range(__N("array::at"));
|
||||||
|
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 std::__addressof(_M_instance[0]); }
|
||||||
|
|
||||||
|
const _Tp*
|
||||||
|
data() const
|
||||||
|
{ return std::__addressof(_M_instance[0]); }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
{ __one.swap(__two); }
|
||||||
|
|
||||||
|
// Tuple interface to class template array [6.2.2.5].
|
||||||
|
|
||||||
|
/// tuple_size
|
||||||
|
template<typename _Tp>
|
||||||
|
class tuple_size;
|
||||||
|
|
||||||
|
/// tuple_element
|
||||||
|
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]; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_ARRAY
|
#endif // _GLIBCXX_TR1_ARRAY
|
||||||
|
|
|
||||||
|
|
@ -32,18 +32,18 @@
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_CTYPE_TR1
|
||||||
# include <tr1_impl/cctype>
|
|
||||||
#else
|
#undef isblank
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace std
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
namespace tr1
|
||||||
# include <tr1_impl/cctype>
|
{
|
||||||
# undef _GLIBCXX_TR1
|
using ::isblank;
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
}
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
}
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CCTYPE
|
#endif // _GLIBCXX_TR1_CCTYPE
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// TR1 cfenv -*- C++ -*-
|
// TR1 cfenv -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -32,22 +32,50 @@
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
|
|
||||||
#if _GLIBCXX_HAVE_FENV_H
|
#if _GLIBCXX_HAVE_FENV_H
|
||||||
# include <fenv.h>
|
# include <fenv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_FENV_TR1
|
||||||
# include <tr1_impl/cfenv>
|
|
||||||
#else
|
#undef feclearexcept
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
#undef fegetexceptflag
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
#undef feraiseexcept
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
#undef fesetexceptflag
|
||||||
# define _GLIBCXX_TR1 tr1::
|
#undef fetestexcept
|
||||||
# include <tr1_impl/cfenv>
|
#undef fegetround
|
||||||
# undef _GLIBCXX_TR1
|
#undef fesetround
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#undef fegetenv
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef feholdexcept
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
#undef fesetenv
|
||||||
#endif
|
#undef feupdateenv
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_FENV_TR1
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CFENV
|
#endif // _GLIBCXX_TR1_CFENV
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// TR1 cinttypes -*- C++ -*-
|
// TR1 cinttypes -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -46,18 +46,39 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
# include <tr1_impl/cinttypes>
|
|
||||||
#else
|
namespace std
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace tr1
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
// types
|
||||||
# include <tr1_impl/cinttypes>
|
using ::imaxdiv_t;
|
||||||
# undef _GLIBCXX_TR1
|
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
// functions
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using ::imaxabs;
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
|
||||||
|
using ::wcstoimax;
|
||||||
|
using ::wcstoumax;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_INTTYPES_TR1
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CINTTYPES
|
#endif // _GLIBCXX_TR1_CINTTYPES
|
||||||
|
|
|
||||||
|
|
@ -37,20 +37,973 @@
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_MATH_TR1
|
||||||
# include <tr1_impl/cmath>
|
|
||||||
#else
|
#undef acosh
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
#undef acoshf
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
#undef acoshl
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
#undef asinh
|
||||||
# define _GLIBCXX_TR1 tr1::
|
#undef asinhf
|
||||||
# include <tr1_impl/cmath>
|
#undef asinhl
|
||||||
# undef _GLIBCXX_TR1
|
#undef atanh
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#undef atanhf
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
#undef atanhl
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
#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 remquof
|
||||||
|
#undef remquol
|
||||||
|
#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
|
#endif
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
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 ::remquof;
|
||||||
|
using ::remquol;
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
/// Function template definitions [8.16.3].
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
fpclassify(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
|
||||||
|
FP_SUBNORMAL, FP_ZERO, __type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isfinite(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isfinite(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isinf(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isinf(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isnan(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isnan(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isnormal(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isnormal(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
signbit(_Tp __f)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_signbit(__type(__f));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isgreater(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isgreater(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isgreaterequal(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isgreaterequal(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isless(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isless(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
islessequal(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_islessequal(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
islessgreater(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_islessgreater(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
||||||
|
int>::__type
|
||||||
|
isunordered(_Tp __f1, _Tp __f2)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
return __builtin_isunordered(__type(__f1), __type(__f2));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if _GLIBCXX_USE_C99_MATH_TR1
|
||||||
|
|
||||||
|
/// 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DR 550. What should the return type of pow(float,int) be?
|
||||||
|
// NB: C++0x and TR1 != C++03.
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
namespace tr1
|
namespace tr1
|
||||||
|
|
|
||||||
|
|
@ -31,30 +31,334 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <complex>
|
#include <complex>
|
||||||
|
|
||||||
#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
|
namespace std
|
||||||
{
|
{
|
||||||
namespace tr1
|
namespace tr1
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @addtogroup complex_numbers
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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>&);
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
__complex_acos(const std::complex<_Tp>& __z)
|
||||||
|
{
|
||||||
|
const std::complex<_Tp> __t = std::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
|
||||||
|
/// 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>
|
||||||
|
acos(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_acos(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
__complex_asin(const std::complex<_Tp>& __z)
|
||||||
|
{
|
||||||
|
std::complex<_Tp> __t(-__z.imag(), __z.real());
|
||||||
|
__t = std::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
|
||||||
|
/// 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>
|
||||||
|
asin(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_asin(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// atan(__z) [8.1.4].
|
||||||
|
// Effects: Behaves the same as C99 function catan, defined
|
||||||
|
// in subclause 7.3.5.3.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
atan(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_atan(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// acosh(__z) [8.1.5].
|
||||||
|
// Effects: Behaves the same as C99 function cacosh, defined
|
||||||
|
// in subclause 7.3.6.1.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
acosh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_acosh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// asinh(__z) [8.1.6].
|
||||||
|
// Effects: Behaves the same as C99 function casin, defined
|
||||||
|
// in subclause 7.3.6.2.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
asinh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_asinh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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
|
||||||
|
/// atanh(__z) [8.1.7].
|
||||||
|
// Effects: Behaves the same as C99 function catanh, defined
|
||||||
|
// in subclause 7.3.6.3.
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
atanh(const std::complex<_Tp>& __z)
|
||||||
|
{ return __complex_atanh(__z); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline std::complex<_Tp>
|
||||||
|
/// fabs(__z) [8.1.8].
|
||||||
|
// Effects: Behaves the same as C99 function cabs, defined
|
||||||
|
// in subclause 7.3.8.1.
|
||||||
|
fabs(const std::complex<_Tp>& __z)
|
||||||
|
{ return std::abs(__z); }
|
||||||
|
|
||||||
|
/// Additional overloads [8.1.9].
|
||||||
|
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
inline typename __gnu_cxx::__promote<_Tp>::__type
|
||||||
|
arg(_Tp __x)
|
||||||
|
{
|
||||||
|
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
||||||
|
#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
|
||||||
|
return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L)
|
||||||
|
: __type();
|
||||||
|
#else
|
||||||
|
return std::arg(std::complex<__type>(__x));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
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>
|
||||||
|
inline typename __gnu_cxx::__promote<_Tp>::__type
|
||||||
|
real(_Tp __x)
|
||||||
|
{ return __x; }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
using std::arg;
|
using std::arg;
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
|
|
@ -95,6 +399,8 @@ namespace tr1
|
||||||
inline std::complex<_Tp>
|
inline std::complex<_Tp>
|
||||||
pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
|
pow(const std::complex<_Tp>& __x, const std::complex<_Tp>& __y)
|
||||||
{ return std::pow(__x, __y); }
|
{ return std::pow(__x, __y); }
|
||||||
|
|
||||||
|
// @} group complex_numbers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#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/c++config.h>
|
||||||
|
|
||||||
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
|
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
|
||||||
|
|
@ -58,19 +54,51 @@
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
# include <tr1_impl/cstdint>
|
|
||||||
#else
|
namespace std
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace tr1
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
using ::int8_t;
|
||||||
# include <tr1_impl/cstdint>
|
using ::int16_t;
|
||||||
# undef _GLIBCXX_TR1
|
using ::int32_t;
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
using ::int64_t;
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
using ::int_fast8_t;
|
||||||
#endif
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CSTDINT
|
#endif // _GLIBCXX_TR1_CSTDINT
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,24 +31,23 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#if _GLIBCXX_USE_C99
|
||||||
# include <tr1_impl/cstdio>
|
|
||||||
#else
|
namespace std
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace tr1
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
using std::snprintf;
|
||||||
# include <tr1_impl/cstdio>
|
using std::vsnprintf;
|
||||||
# undef _GLIBCXX_TR1
|
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
using std::vfscanf;
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using std::vscanf;
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
using std::vsscanf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CSTDIO
|
#endif // _GLIBCXX_TR1_CSTDIO
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// TR1 cstdlib -*- C++ -*-
|
// TR1 cstdlib -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -31,24 +31,42 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#if _GLIBCXX_HOSTED
|
||||||
# include <tr1_impl/cstdlib>
|
|
||||||
#else
|
#if _GLIBCXX_USE_C99
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace std
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
namespace tr1
|
||||||
# include <tr1_impl/cstdlib>
|
{
|
||||||
# undef _GLIBCXX_TR1
|
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
// types
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using std::lldiv_t;
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
|
// functions
|
||||||
|
using std::llabs;
|
||||||
|
using std::lldiv;
|
||||||
#endif
|
#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_USE_C99
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_HOSTED
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CSTDLIB
|
#endif // _GLIBCXX_TR1_CSTDLIB
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// TR1 cwchar -*- C++ -*-
|
// TR1 cwchar -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -31,24 +31,35 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
# include <tr1_impl/cwchar>
|
|
||||||
#else
|
namespace std
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace tr1
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
#if _GLIBCXX_HAVE_WCSTOF
|
||||||
# include <tr1_impl/cwchar>
|
using std::wcstof;
|
||||||
# undef _GLIBCXX_TR1
|
#endif
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
#if _GLIBCXX_HAVE_VFWSCANF
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
using std::vfwscanf;
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
#endif
|
||||||
|
#if _GLIBCXX_HAVE_VSWSCANF
|
||||||
|
using std::vswscanf;
|
||||||
|
#endif
|
||||||
|
#if _GLIBCXX_HAVE_VWSCANF
|
||||||
|
using std::vwscanf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if _GLIBCXX_USE_C99
|
||||||
|
using std::wcstold;
|
||||||
|
using std::wcstoll;
|
||||||
|
using std::wcstoull;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CWCHAR
|
#endif // _GLIBCXX_TR1_CWCHAR
|
||||||
|
|
|
||||||
|
|
@ -31,24 +31,20 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cwctype>
|
#include <cwctype>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
# include <tr1_impl/cwctype>
|
|
||||||
#else
|
namespace std
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
namespace tr1
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
{
|
||||||
# define _GLIBCXX_TR1 tr1::
|
#if _GLIBCXX_HAVE_ISWBLANK
|
||||||
# include <tr1_impl/cwctype>
|
using std::iswblank;
|
||||||
# undef _GLIBCXX_TR1
|
#endif
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
}
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
}
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
|
||||||
#endif
|
#endif // _GLIBCXX_USE_WCHAR_T
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_CWCTYPE
|
#endif // _GLIBCXX_TR1_CWCTYPE
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// <tr1/memory> -*- C++ -*-
|
// <tr1/memory> -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
|
||||||
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -47,21 +48,6 @@
|
||||||
#include <bits/stl_function.h> // std::less
|
#include <bits/stl_function.h> // std::less
|
||||||
#include <debug/debug.h>
|
#include <debug/debug.h>
|
||||||
#include <tr1/type_traits>
|
#include <tr1/type_traits>
|
||||||
|
#include <tr1/shared_ptr.h>
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
|
||||||
# include <tr1_impl/boost_sp_counted_base.h>
|
|
||||||
# include <tr1/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_sp_counted_base.h>
|
|
||||||
# include <tr1/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
|
#endif // _GLIBCXX_TR1_MEMORY
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -49,14 +49,205 @@
|
||||||
#ifndef _TR1_SHARED_PTR_H
|
#ifndef _TR1_SHARED_PTR_H
|
||||||
#define _TR1_SHARED_PTR_H 1
|
#define _TR1_SHARED_PTR_H 1
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
|
|
||||||
# error TR1 header cannot be included from C++0x header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
namespace tr1
|
namespace tr1
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @brief Exception possibly thrown by @c shared_ptr.
|
||||||
|
* @ingroup exceptions
|
||||||
|
*/
|
||||||
|
class bad_weak_ptr : public std::exception
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual char const*
|
||||||
|
what() const throw()
|
||||||
|
{ return "tr1::bad_weak_ptr"; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Substitute for bad_weak_ptr object in the case of -fno-exceptions.
|
||||||
|
inline void
|
||||||
|
__throw_bad_weak_ptr()
|
||||||
|
{
|
||||||
|
#if __EXCEPTIONS
|
||||||
|
throw bad_weak_ptr();
|
||||||
|
#else
|
||||||
|
__builtin_abort();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
using __gnu_cxx::_Lock_policy;
|
||||||
|
using __gnu_cxx::__default_lock_policy;
|
||||||
|
using __gnu_cxx::_S_single;
|
||||||
|
using __gnu_cxx::_S_mutex;
|
||||||
|
using __gnu_cxx::_S_atomic;
|
||||||
|
|
||||||
|
// Empty helper class except when the template argument is _S_mutex.
|
||||||
|
template<_Lock_policy _Lp>
|
||||||
|
class _Mutex_base
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
// The atomic policy uses fully-fenced builtins, single doesn't care.
|
||||||
|
enum { _S_need_barriers = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class _Mutex_base<_S_mutex>
|
||||||
|
: public __gnu_cxx::__mutex
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
// This policy is used when atomic builtins are not available.
|
||||||
|
// The replacement atomic operations might not have the necessary
|
||||||
|
// memory barriers.
|
||||||
|
enum { _S_need_barriers = 1 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<_Lock_policy _Lp = __default_lock_policy>
|
||||||
|
class _Sp_counted_base
|
||||||
|
: public _Mutex_base<_Lp>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
_Sp_counted_base()
|
||||||
|
: _M_use_count(1), _M_weak_count(1) { }
|
||||||
|
|
||||||
|
virtual
|
||||||
|
~_Sp_counted_base() // nothrow
|
||||||
|
{ }
|
||||||
|
|
||||||
|
// Called when _M_use_count drops to zero, to release the resources
|
||||||
|
// managed by *this.
|
||||||
|
virtual void
|
||||||
|
_M_dispose() = 0; // nothrow
|
||||||
|
|
||||||
|
// Called when _M_weak_count drops to zero.
|
||||||
|
virtual void
|
||||||
|
_M_destroy() // nothrow
|
||||||
|
{ delete this; }
|
||||||
|
|
||||||
|
virtual void*
|
||||||
|
_M_get_deleter(const std::type_info&) = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_add_ref_copy()
|
||||||
|
{ __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_add_ref_lock();
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_release() // nothrow
|
||||||
|
{
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_use_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_use_count);
|
||||||
|
_M_dispose();
|
||||||
|
// There must be a memory barrier between dispose() and destroy()
|
||||||
|
// to ensure that the effects of dispose() are observed in the
|
||||||
|
// thread that runs destroy().
|
||||||
|
// See http://gcc.gnu.org/ml/libstdc++/2005-11/msg00136.html
|
||||||
|
if (_Mutex_base<_Lp>::_S_need_barriers)
|
||||||
|
{
|
||||||
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
|
||||||
|
-1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
||||||
|
_M_destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_weak_add_ref() // nothrow
|
||||||
|
{ __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
|
||||||
|
|
||||||
|
void
|
||||||
|
_M_weak_release() // nothrow
|
||||||
|
{
|
||||||
|
// Be race-detector-friendly. For more info see bits/c++config.
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
|
||||||
|
{
|
||||||
|
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
||||||
|
if (_Mutex_base<_Lp>::_S_need_barriers)
|
||||||
|
{
|
||||||
|
// See _M_release(),
|
||||||
|
// destroy() must observe results of dispose()
|
||||||
|
_GLIBCXX_READ_MEM_BARRIER;
|
||||||
|
_GLIBCXX_WRITE_MEM_BARRIER;
|
||||||
|
}
|
||||||
|
_M_destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long
|
||||||
|
_M_get_use_count() const // nothrow
|
||||||
|
{
|
||||||
|
// No memory barrier is used here so there is no synchronization
|
||||||
|
// with other threads.
|
||||||
|
return const_cast<const volatile _Atomic_word&>(_M_use_count);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
_Sp_counted_base(_Sp_counted_base const&);
|
||||||
|
_Sp_counted_base& operator=(_Sp_counted_base const&);
|
||||||
|
|
||||||
|
_Atomic_word _M_use_count; // #shared
|
||||||
|
_Atomic_word _M_weak_count; // #weak + (#shared != 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_single>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
||||||
|
{
|
||||||
|
_M_use_count = 0;
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_mutex>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
__gnu_cxx::__scoped_lock sentry(*this);
|
||||||
|
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
||||||
|
{
|
||||||
|
_M_use_count = 0;
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline void
|
||||||
|
_Sp_counted_base<_S_atomic>::
|
||||||
|
_M_add_ref_lock()
|
||||||
|
{
|
||||||
|
// Perform lock-free add-if-not-zero operation.
|
||||||
|
_Atomic_word __count;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
__count = _M_use_count;
|
||||||
|
if (__count == 0)
|
||||||
|
__throw_bad_weak_ptr();
|
||||||
|
|
||||||
|
// Replace the current counter value with the old value + 1, as
|
||||||
|
// long as it's not changed meanwhile.
|
||||||
|
}
|
||||||
|
while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
|
||||||
|
__count + 1));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
|
template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
|
||||||
class _Sp_counted_base_impl
|
class _Sp_counted_base_impl
|
||||||
: public _Sp_counted_base<_Lp>
|
: public _Sp_counted_base<_Lp>
|
||||||
|
|
|
||||||
|
|
@ -32,35 +32,467 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#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/c++config.h>
|
||||||
|
|
||||||
#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
|
namespace std
|
||||||
{
|
{
|
||||||
namespace tr1
|
namespace tr1
|
||||||
{
|
{
|
||||||
#define _DEFINE_SPEC(_Trait, _Type) \
|
/**
|
||||||
template<> \
|
* @defgroup metaprogramming Type Traits
|
||||||
struct _Trait<_Type> \
|
* @ingroup utilities
|
||||||
|
*
|
||||||
|
* Compile time type transformation and information.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct __sfinae_types
|
||||||
|
{
|
||||||
|
typedef char __one;
|
||||||
|
typedef struct { char __arr[2]; } __two;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_0_HELPER \
|
||||||
|
template<>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_1_HELPER \
|
||||||
|
template<typename _Tp>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC_2_HELPER \
|
||||||
|
template<typename _Tp, typename _Cp>
|
||||||
|
|
||||||
|
#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
|
||||||
|
_DEFINE_SPEC_##_Order##_HELPER \
|
||||||
|
struct _Trait<_Type> \
|
||||||
|
: public integral_constant<bool, _Value> { };
|
||||||
|
|
||||||
|
// helper classes [4.3].
|
||||||
|
|
||||||
|
/// integral_constant
|
||||||
|
template<typename _Tp, _Tp __v>
|
||||||
|
struct integral_constant
|
||||||
|
{
|
||||||
|
static const _Tp value = __v;
|
||||||
|
typedef _Tp value_type;
|
||||||
|
typedef integral_constant<_Tp, __v> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// typedef for true_type
|
||||||
|
typedef integral_constant<bool, true> true_type;
|
||||||
|
|
||||||
|
/// typedef for false_type
|
||||||
|
typedef integral_constant<bool, false> false_type;
|
||||||
|
|
||||||
|
template<typename _Tp, _Tp __v>
|
||||||
|
const _Tp integral_constant<_Tp, __v>::value;
|
||||||
|
|
||||||
|
/// remove_cv
|
||||||
|
template<typename>
|
||||||
|
struct remove_cv;
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_void_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_void_helper, void, true)
|
||||||
|
|
||||||
|
// primary type categories [4.5.1].
|
||||||
|
|
||||||
|
/// is_void
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_void
|
||||||
|
: public integral_constant<bool, (__is_void_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_integral_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, bool, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, char, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, signed char, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
|
||||||
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
|
||||||
|
#endif
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, short, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, int, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, long long, true)
|
||||||
|
_DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
|
||||||
|
|
||||||
|
/// is_integral
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_integral
|
||||||
|
: public integral_constant<bool, (__is_integral_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_floating_point_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, float, true)
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, double, true)
|
||||||
|
_DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
|
||||||
|
|
||||||
|
/// is_floating_point
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_floating_point
|
||||||
|
: public integral_constant<bool, (__is_floating_point_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_array
|
||||||
|
template<typename>
|
||||||
|
struct is_array
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp, std::size_t _Size>
|
||||||
|
struct is_array<_Tp[_Size]>
|
||||||
: public true_type { };
|
: public true_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_array<_Tp[]>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
|
||||||
|
|
||||||
|
/// is_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_pointer
|
||||||
|
: public integral_constant<bool, (__is_pointer_helper<typename
|
||||||
|
remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_reference
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_reference;
|
||||||
|
|
||||||
|
/// is_function
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_function;
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_member_object_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
|
||||||
|
!is_function<_Tp>::value)
|
||||||
|
|
||||||
|
/// is_member_object_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_object_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_object_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct __is_member_function_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
|
||||||
|
is_function<_Tp>::value)
|
||||||
|
|
||||||
|
/// is_member_function_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_function_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_function_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_enum
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_enum
|
||||||
|
: public integral_constant<bool, __is_enum(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_union
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_union
|
||||||
|
: public integral_constant<bool, __is_union(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_class
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_class
|
||||||
|
: public integral_constant<bool, __is_class(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_function
|
||||||
|
template<typename>
|
||||||
|
struct is_function
|
||||||
|
: public false_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...)>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......)>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) const>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) const>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes...) const volatile>
|
||||||
|
: public true_type { };
|
||||||
|
template<typename _Res, typename... _ArgTypes>
|
||||||
|
struct is_function<_Res(_ArgTypes......) const volatile>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
// composite type traits [4.5.2].
|
||||||
|
|
||||||
|
/// is_arithmetic
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_arithmetic
|
||||||
|
: public integral_constant<bool, (is_integral<_Tp>::value
|
||||||
|
|| is_floating_point<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_fundamental
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_fundamental
|
||||||
|
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|
||||||
|
|| is_void<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_object
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_object
|
||||||
|
: public integral_constant<bool, !(is_function<_Tp>::value
|
||||||
|
|| is_reference<_Tp>::value
|
||||||
|
|| is_void<_Tp>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_member_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_pointer;
|
||||||
|
|
||||||
|
/// is_scalar
|
||||||
|
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)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_compound
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_compound
|
||||||
|
: public integral_constant<bool, !is_fundamental<_Tp>::value> { };
|
||||||
|
|
||||||
|
/// is_member_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct __is_member_pointer_helper
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true)
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_member_pointer
|
||||||
|
: public integral_constant<bool, (__is_member_pointer_helper<
|
||||||
|
typename remove_cv<_Tp>::type>::value)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
// type properties [4.5.3].
|
||||||
|
/// is_const
|
||||||
|
template<typename>
|
||||||
|
struct is_const
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_const<_Tp const>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
/// is_volatile
|
||||||
|
template<typename>
|
||||||
|
struct is_volatile
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_volatile<_Tp volatile>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
/// is_empty
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_empty
|
||||||
|
: public integral_constant<bool, __is_empty(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_polymorphic
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_polymorphic
|
||||||
|
: public integral_constant<bool, __is_polymorphic(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// is_abstract
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_abstract
|
||||||
|
: public integral_constant<bool, __is_abstract(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// has_virtual_destructor
|
||||||
|
template<typename _Tp>
|
||||||
|
struct has_virtual_destructor
|
||||||
|
: public integral_constant<bool, __has_virtual_destructor(_Tp)>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
/// alignment_of
|
||||||
|
template<typename _Tp>
|
||||||
|
struct alignment_of
|
||||||
|
: public integral_constant<std::size_t, __alignof__(_Tp)> { };
|
||||||
|
|
||||||
|
/// rank
|
||||||
|
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> { };
|
||||||
|
|
||||||
|
/// extent
|
||||||
|
template<typename, unsigned _Uint = 0>
|
||||||
|
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>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename _Tp, unsigned _Uint>
|
||||||
|
struct extent<_Tp[], _Uint>
|
||||||
|
: public integral_constant<std::size_t,
|
||||||
|
_Uint == 0 ? 0 : extent<_Tp,
|
||||||
|
_Uint - 1>::value>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
// relationships between types [4.6].
|
||||||
|
|
||||||
|
/// is_same
|
||||||
|
template<typename, typename>
|
||||||
|
struct is_same
|
||||||
|
: public false_type { };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct is_same<_Tp, _Tp>
|
||||||
|
: public true_type { };
|
||||||
|
|
||||||
|
// const-volatile modifications [4.7.1].
|
||||||
|
|
||||||
|
/// remove_const
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_const
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_const<_Tp const>
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
/// remove_volatile
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_volatile
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_volatile<_Tp volatile>
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
/// remove_cv
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_cv
|
||||||
|
{
|
||||||
|
typedef typename
|
||||||
|
remove_const<typename remove_volatile<_Tp>::type>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// add_const
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_const
|
||||||
|
{ typedef _Tp const type; };
|
||||||
|
|
||||||
|
/// add_volatile
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_volatile
|
||||||
|
{ typedef _Tp volatile type; };
|
||||||
|
|
||||||
|
/// add_cv
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_cv
|
||||||
|
{
|
||||||
|
typedef typename
|
||||||
|
add_const<typename add_volatile<_Tp>::type>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
// array modifications [4.7.3].
|
||||||
|
|
||||||
|
/// remove_extent
|
||||||
|
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; };
|
||||||
|
|
||||||
|
/// remove_all_extents
|
||||||
|
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; };
|
||||||
|
|
||||||
|
// pointer modifications [4.7.4].
|
||||||
|
|
||||||
|
template<typename _Tp, typename>
|
||||||
|
struct __remove_pointer_helper
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
|
template<typename _Tp, typename _Up>
|
||||||
|
struct __remove_pointer_helper<_Tp, _Up*>
|
||||||
|
{ typedef _Up type; };
|
||||||
|
|
||||||
|
/// remove_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct remove_pointer
|
||||||
|
: public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
template<typename>
|
||||||
|
struct remove_reference;
|
||||||
|
|
||||||
|
/// add_pointer
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_pointer
|
||||||
|
{ typedef typename remove_reference<_Tp>::type* type; };
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_reference
|
struct is_reference
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
|
|
@ -112,11 +544,11 @@ namespace tr1
|
||||||
template<typename>
|
template<typename>
|
||||||
struct __is_signed_helper
|
struct __is_signed_helper
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
_DEFINE_SPEC(__is_signed_helper, signed char)
|
_DEFINE_SPEC(0, __is_signed_helper, signed char, true)
|
||||||
_DEFINE_SPEC(__is_signed_helper, short)
|
_DEFINE_SPEC(0, __is_signed_helper, short, true)
|
||||||
_DEFINE_SPEC(__is_signed_helper, int)
|
_DEFINE_SPEC(0, __is_signed_helper, int, true)
|
||||||
_DEFINE_SPEC(__is_signed_helper, long)
|
_DEFINE_SPEC(0, __is_signed_helper, long, true)
|
||||||
_DEFINE_SPEC(__is_signed_helper, long long)
|
_DEFINE_SPEC(0, __is_signed_helper, long long, true)
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct is_signed
|
struct is_signed
|
||||||
|
|
@ -127,11 +559,11 @@ namespace tr1
|
||||||
template<typename>
|
template<typename>
|
||||||
struct __is_unsigned_helper
|
struct __is_unsigned_helper
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
_DEFINE_SPEC(__is_unsigned_helper, unsigned char)
|
_DEFINE_SPEC(0, __is_unsigned_helper, unsigned char, true)
|
||||||
_DEFINE_SPEC(__is_unsigned_helper, unsigned short)
|
_DEFINE_SPEC(0, __is_unsigned_helper, unsigned short, true)
|
||||||
_DEFINE_SPEC(__is_unsigned_helper, unsigned int)
|
_DEFINE_SPEC(0, __is_unsigned_helper, unsigned int, true)
|
||||||
_DEFINE_SPEC(__is_unsigned_helper, unsigned long)
|
_DEFINE_SPEC(0, __is_unsigned_helper, unsigned long, true)
|
||||||
_DEFINE_SPEC(__is_unsigned_helper, unsigned long long)
|
_DEFINE_SPEC(0, __is_unsigned_helper, unsigned long long, true)
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct is_unsigned
|
struct is_unsigned
|
||||||
|
|
@ -243,6 +675,9 @@ namespace tr1
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#undef _DEFINE_SPEC_0_HELPER
|
||||||
|
#undef _DEFINE_SPEC_1_HELPER
|
||||||
|
#undef _DEFINE_SPEC_2_HELPER
|
||||||
#undef _DEFINE_SPEC
|
#undef _DEFINE_SPEC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// TR1 utility -*- C++ -*-
|
// TR1 utility -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2004, 2005, 2006, 2007, 2008. 2009, 2010
|
||||||
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -31,26 +32,74 @@
|
||||||
|
|
||||||
#pragma GCC system_header
|
#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/c++config.h>
|
||||||
#include <bits/stl_relops.h>
|
#include <bits/stl_relops.h>
|
||||||
#include <bits/stl_pair.h>
|
#include <bits/stl_pair.h>
|
||||||
|
|
||||||
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
|
namespace std
|
||||||
# include <tr1_impl/utility>
|
{
|
||||||
#else
|
namespace tr1
|
||||||
# define _GLIBCXX_INCLUDE_AS_TR1
|
{
|
||||||
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
|
template<class _Tp>
|
||||||
# define _GLIBCXX_END_NAMESPACE_TR1 }
|
class tuple_size;
|
||||||
# define _GLIBCXX_TR1 tr1::
|
|
||||||
# include <tr1_impl/utility>
|
template<int _Int, class _Tp>
|
||||||
# undef _GLIBCXX_TR1
|
class tuple_element;
|
||||||
# undef _GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
|
// Various functions which give std::pair a tuple-like interface.
|
||||||
# undef _GLIBCXX_INCLUDE_AS_TR1
|
template<class _Tp1, class _Tp2>
|
||||||
#endif
|
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); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif // _GLIBCXX_TR1_UTILITY
|
#endif // _GLIBCXX_TR1_UTILITY
|
||||||
|
|
|
||||||
|
|
@ -1,291 +0,0 @@
|
||||||
// class template array -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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 A standard container for storing a fixed size sequence of elements.
|
|
||||||
*
|
|
||||||
* @ingroup sequences
|
|
||||||
*
|
|
||||||
* Meets the requirements of a <a href="tables.html#65">container</a>, a
|
|
||||||
* <a href="tables.html#66">reversible container</a>, and a
|
|
||||||
* <a href="tables.html#67">sequence</a>.
|
|
||||||
*
|
|
||||||
* Sets support random access iterators.
|
|
||||||
*
|
|
||||||
* @param Tp Type of element. Required to be a complete type.
|
|
||||||
* @param N Number of elements.
|
|
||||||
*/
|
|
||||||
template<typename _Tp, std::size_t _Nm>
|
|
||||||
struct array
|
|
||||||
{
|
|
||||||
typedef _Tp value_type;
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
typedef _Tp* pointer;
|
|
||||||
typedef const _Tp* const_pointer;
|
|
||||||
#endif
|
|
||||||
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];
|
|
||||||
|
|
||||||
// No explicit construct/copy/destroy for aggregate type.
|
|
||||||
|
|
||||||
void
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
// DR 776.
|
|
||||||
fill(const value_type& __u)
|
|
||||||
#else
|
|
||||||
assign(const value_type& __u)
|
|
||||||
#endif
|
|
||||||
{ std::fill_n(begin(), size(), __u); }
|
|
||||||
|
|
||||||
void
|
|
||||||
swap(array& __other)
|
|
||||||
{ std::swap_ranges(begin(), end(), __other.begin()); }
|
|
||||||
|
|
||||||
// Iterators.
|
|
||||||
iterator
|
|
||||||
begin()
|
|
||||||
{ return iterator(std::__addressof(_M_instance[0])); }
|
|
||||||
|
|
||||||
const_iterator
|
|
||||||
begin() const
|
|
||||||
{ return const_iterator(std::__addressof(_M_instance[0])); }
|
|
||||||
|
|
||||||
iterator
|
|
||||||
end()
|
|
||||||
{ return iterator(std::__addressof(_M_instance[_Nm])); }
|
|
||||||
|
|
||||||
const_iterator
|
|
||||||
end() const
|
|
||||||
{ return const_iterator(std::__addressof(_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()); }
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
const_iterator
|
|
||||||
cbegin() const
|
|
||||||
{ return const_iterator(std::__addressof(_M_instance[0])); }
|
|
||||||
|
|
||||||
const_iterator
|
|
||||||
cend() const
|
|
||||||
{ return const_iterator(std::__addressof(_M_instance[_Nm])); }
|
|
||||||
|
|
||||||
const_reverse_iterator
|
|
||||||
crbegin() const
|
|
||||||
{ return const_reverse_iterator(end()); }
|
|
||||||
|
|
||||||
const_reverse_iterator
|
|
||||||
crend() const
|
|
||||||
{ return const_reverse_iterator(begin()); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Capacity.
|
|
||||||
_GLIBCXX_CONSTEXPR size_type
|
|
||||||
size() const { return _Nm; }
|
|
||||||
|
|
||||||
_GLIBCXX_CONSTEXPR size_type
|
|
||||||
max_size() const { return _Nm; }
|
|
||||||
|
|
||||||
_GLIBCXX_CONSTEXPR 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)
|
|
||||||
{
|
|
||||||
if (__n >= _Nm)
|
|
||||||
std::__throw_out_of_range(__N("array::at"));
|
|
||||||
return _M_instance[__n];
|
|
||||||
}
|
|
||||||
|
|
||||||
const_reference
|
|
||||||
at(size_type __n) const
|
|
||||||
{
|
|
||||||
if (__n >= _Nm)
|
|
||||||
std::__throw_out_of_range(__N("array::at"));
|
|
||||||
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 std::__addressof(_M_instance[0]); }
|
|
||||||
|
|
||||||
const _Tp*
|
|
||||||
data() const
|
|
||||||
{ return std::__addressof(_M_instance[0]); }
|
|
||||||
};
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
{ __one.swap(__two); }
|
|
||||||
|
|
||||||
// Tuple interface to class template array [6.2.2.5].
|
|
||||||
|
|
||||||
/// tuple_size
|
|
||||||
template<typename _Tp>
|
|
||||||
class tuple_size;
|
|
||||||
|
|
||||||
/// tuple_element
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, typename _Tp>
|
|
||||||
#else
|
|
||||||
template<int _Int, typename _Tp>
|
|
||||||
#endif
|
|
||||||
class tuple_element;
|
|
||||||
|
|
||||||
template<typename _Tp, std::size_t _Nm>
|
|
||||||
struct tuple_size<array<_Tp, _Nm> >
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
{ static const std::size_t value = _Nm; };
|
|
||||||
#else
|
|
||||||
{ static const int value = _Nm; };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename _Tp, std::size_t _Nm>
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
const std::size_t
|
|
||||||
#else
|
|
||||||
const int
|
|
||||||
#endif
|
|
||||||
tuple_size<array<_Tp, _Nm> >::value;
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#else
|
|
||||||
template<int _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#endif
|
|
||||||
struct tuple_element<_Int, array<_Tp, _Nm> >
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#else
|
|
||||||
template<int _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#endif
|
|
||||||
inline _Tp&
|
|
||||||
get(array<_Tp, _Nm>& __arr)
|
|
||||||
{ return __arr[_Int]; }
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#else
|
|
||||||
template<int _Int, typename _Tp, std::size_t _Nm>
|
|
||||||
#endif
|
|
||||||
inline const _Tp&
|
|
||||||
get(const array<_Tp, _Nm>& __arr)
|
|
||||||
{ return __arr[_Int]; }
|
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
}
|
|
||||||
|
|
@ -1,254 +0,0 @@
|
||||||
// <tr1_impl/boost_sp_counted_base.h> -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
// shared_count.hpp
|
|
||||||
// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
|
|
||||||
|
|
||||||
// shared_ptr.hpp
|
|
||||||
// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes.
|
|
||||||
// Copyright (C) 2001, 2002, 2003 Peter Dimov
|
|
||||||
|
|
||||||
// weak_ptr.hpp
|
|
||||||
// Copyright (C) 2001, 2002, 2003 Peter Dimov
|
|
||||||
|
|
||||||
// enable_shared_from_this.hpp
|
|
||||||
// Copyright (C) 2002 Peter Dimov
|
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// GCC Note: based on version 1.32.0 of the Boost library.
|
|
||||||
|
|
||||||
/** @file tr1_impl/boost_sp_counted_base.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
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Exception possibly thrown by @c shared_ptr.
|
|
||||||
* @ingroup exceptions
|
|
||||||
*/
|
|
||||||
class bad_weak_ptr : public std::exception
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual char const*
|
|
||||||
what() const throw()
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
{ return "std::bad_weak_ptr"; }
|
|
||||||
#else
|
|
||||||
{ return "tr1::bad_weak_ptr"; }
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
// Substitute for bad_weak_ptr object in the case of -fno-exceptions.
|
|
||||||
inline void
|
|
||||||
__throw_bad_weak_ptr()
|
|
||||||
{
|
|
||||||
#if __EXCEPTIONS
|
|
||||||
throw bad_weak_ptr();
|
|
||||||
#else
|
|
||||||
__builtin_abort();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
using __gnu_cxx::_Lock_policy;
|
|
||||||
using __gnu_cxx::__default_lock_policy;
|
|
||||||
using __gnu_cxx::_S_single;
|
|
||||||
using __gnu_cxx::_S_mutex;
|
|
||||||
using __gnu_cxx::_S_atomic;
|
|
||||||
|
|
||||||
// Empty helper class except when the template argument is _S_mutex.
|
|
||||||
template<_Lock_policy _Lp>
|
|
||||||
class _Mutex_base
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
// The atomic policy uses fully-fenced builtins, single doesn't care.
|
|
||||||
enum { _S_need_barriers = 0 };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
class _Mutex_base<_S_mutex>
|
|
||||||
: public __gnu_cxx::__mutex
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
// This policy is used when atomic builtins are not available.
|
|
||||||
// The replacement atomic operations might not have the necessary
|
|
||||||
// memory barriers.
|
|
||||||
enum { _S_need_barriers = 1 };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<_Lock_policy _Lp = __default_lock_policy>
|
|
||||||
class _Sp_counted_base
|
|
||||||
: public _Mutex_base<_Lp>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
_Sp_counted_base()
|
|
||||||
: _M_use_count(1), _M_weak_count(1) { }
|
|
||||||
|
|
||||||
virtual
|
|
||||||
~_Sp_counted_base() // nothrow
|
|
||||||
{ }
|
|
||||||
|
|
||||||
// Called when _M_use_count drops to zero, to release the resources
|
|
||||||
// managed by *this.
|
|
||||||
virtual void
|
|
||||||
_M_dispose() = 0; // nothrow
|
|
||||||
|
|
||||||
// Called when _M_weak_count drops to zero.
|
|
||||||
virtual void
|
|
||||||
_M_destroy() // nothrow
|
|
||||||
{ delete this; }
|
|
||||||
|
|
||||||
virtual void*
|
|
||||||
_M_get_deleter(const std::type_info&) = 0;
|
|
||||||
|
|
||||||
void
|
|
||||||
_M_add_ref_copy()
|
|
||||||
{ __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
|
|
||||||
|
|
||||||
void
|
|
||||||
_M_add_ref_lock();
|
|
||||||
|
|
||||||
void
|
|
||||||
_M_release() // nothrow
|
|
||||||
{
|
|
||||||
// Be race-detector-friendly. For more info see bits/c++config.
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_use_count);
|
|
||||||
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
|
|
||||||
{
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_use_count);
|
|
||||||
_M_dispose();
|
|
||||||
// There must be a memory barrier between dispose() and destroy()
|
|
||||||
// to ensure that the effects of dispose() are observed in the
|
|
||||||
// thread that runs destroy().
|
|
||||||
// See http://gcc.gnu.org/ml/libstdc++/2005-11/msg00136.html
|
|
||||||
if (_Mutex_base<_Lp>::_S_need_barriers)
|
|
||||||
{
|
|
||||||
_GLIBCXX_READ_MEM_BARRIER;
|
|
||||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Be race-detector-friendly. For more info see bits/c++config.
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
|
||||||
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
|
|
||||||
-1) == 1)
|
|
||||||
{
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
|
||||||
_M_destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_M_weak_add_ref() // nothrow
|
|
||||||
{ __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
|
|
||||||
|
|
||||||
void
|
|
||||||
_M_weak_release() // nothrow
|
|
||||||
{
|
|
||||||
// Be race-detector-friendly. For more info see bits/c++config.
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&_M_weak_count);
|
|
||||||
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
|
|
||||||
{
|
|
||||||
_GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&_M_weak_count);
|
|
||||||
if (_Mutex_base<_Lp>::_S_need_barriers)
|
|
||||||
{
|
|
||||||
// See _M_release(),
|
|
||||||
// destroy() must observe results of dispose()
|
|
||||||
_GLIBCXX_READ_MEM_BARRIER;
|
|
||||||
_GLIBCXX_WRITE_MEM_BARRIER;
|
|
||||||
}
|
|
||||||
_M_destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
|
||||||
_M_get_use_count() const // nothrow
|
|
||||||
{
|
|
||||||
// No memory barrier is used here so there is no synchronization
|
|
||||||
// with other threads.
|
|
||||||
return const_cast<const volatile _Atomic_word&>(_M_use_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
_Sp_counted_base(_Sp_counted_base const&);
|
|
||||||
_Sp_counted_base& operator=(_Sp_counted_base const&);
|
|
||||||
|
|
||||||
_Atomic_word _M_use_count; // #shared
|
|
||||||
_Atomic_word _M_weak_count; // #weak + (#shared != 0)
|
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline void
|
|
||||||
_Sp_counted_base<_S_single>::
|
|
||||||
_M_add_ref_lock()
|
|
||||||
{
|
|
||||||
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
|
||||||
{
|
|
||||||
_M_use_count = 0;
|
|
||||||
__throw_bad_weak_ptr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline void
|
|
||||||
_Sp_counted_base<_S_mutex>::
|
|
||||||
_M_add_ref_lock()
|
|
||||||
{
|
|
||||||
__gnu_cxx::__scoped_lock sentry(*this);
|
|
||||||
if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
|
|
||||||
{
|
|
||||||
_M_use_count = 0;
|
|
||||||
__throw_bad_weak_ptr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline void
|
|
||||||
_Sp_counted_base<_S_atomic>::
|
|
||||||
_M_add_ref_lock()
|
|
||||||
{
|
|
||||||
// Perform lock-free add-if-not-zero operation.
|
|
||||||
_Atomic_word __count;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
__count = _M_use_count;
|
|
||||||
if (__count == 0)
|
|
||||||
__throw_bad_weak_ptr();
|
|
||||||
|
|
||||||
// Replace the current counter value with the old value + 1, as
|
|
||||||
// long as it's not changed meanwhile.
|
|
||||||
}
|
|
||||||
while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
|
|
||||||
__count + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
}
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
// TR1 cctype -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
// TR1 cfenv -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
// TR1 cinttypes -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
#if defined(_GLIBCXX_USE_WCHAR_T) && _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1
|
|
||||||
using ::wcstoimax;
|
|
||||||
using ::wcstoumax;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,996 +0,0 @@
|
||||||
// TR1 cmath -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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 remquof
|
|
||||||
#undef remquol
|
|
||||||
#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 ::remquof;
|
|
||||||
using ::remquol;
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
/// Function template definitions [8.16.3].
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
fpclassify(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
|
|
||||||
FP_SUBNORMAL, FP_ZERO, __type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isfinite(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isfinite(__type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isinf(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isinf(__type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isnan(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isnan(__type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isnormal(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isnormal(__type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
signbit(_Tp __f)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_signbit(__type(__f));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isgreater(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isgreater(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isgreaterequal(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isgreaterequal(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isless(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isless(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
islessequal(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_islessequal(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
islessgreater(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_islessgreater(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
|
|
||||||
int>::__type
|
|
||||||
isunordered(_Tp __f1, _Tp __f2)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
return __builtin_isunordered(__type(__f1), __type(__f2));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if _GLIBCXX_USE_C99_MATH_TR1
|
|
||||||
|
|
||||||
/// 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DR 550. What should the return type of pow(float,int) be?
|
|
||||||
// NB: C++0x and TR1 != C++03.
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
|
|
@ -1,370 +0,0 @@
|
||||||
// TR1 complex -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup complex_numbers
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
// 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>&);
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
// DR 595.
|
|
||||||
template<typename _Tp> _Tp fabs(const std::complex<_Tp>&);
|
|
||||||
#else
|
|
||||||
template<typename _Tp> std::complex<_Tp> fabs(const std::complex<_Tp>&);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// 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>
|
|
||||||
acos(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_acos(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// 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>
|
|
||||||
asin(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_asin(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// atan(__z) [8.1.4].
|
|
||||||
// Effects: Behaves the same as C99 function catan, defined
|
|
||||||
// in subclause 7.3.5.3.
|
|
||||||
template<typename _Tp>
|
|
||||||
inline std::complex<_Tp>
|
|
||||||
atan(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_atan(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// acosh(__z) [8.1.5].
|
|
||||||
// Effects: Behaves the same as C99 function cacosh, defined
|
|
||||||
// in subclause 7.3.6.1.
|
|
||||||
template<typename _Tp>
|
|
||||||
inline std::complex<_Tp>
|
|
||||||
acosh(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_acosh(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// asinh(__z) [8.1.6].
|
|
||||||
// Effects: Behaves the same as C99 function casin, defined
|
|
||||||
// in subclause 7.3.6.2.
|
|
||||||
template<typename _Tp>
|
|
||||||
inline std::complex<_Tp>
|
|
||||||
asinh(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_asinh(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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
|
|
||||||
/// atanh(__z) [8.1.7].
|
|
||||||
// Effects: Behaves the same as C99 function catanh, defined
|
|
||||||
// in subclause 7.3.6.3.
|
|
||||||
template<typename _Tp>
|
|
||||||
inline std::complex<_Tp>
|
|
||||||
atanh(const std::complex<_Tp>& __z)
|
|
||||||
{ return __complex_atanh(__z); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
inline _Tp
|
|
||||||
#else
|
|
||||||
inline std::complex<_Tp>
|
|
||||||
#endif
|
|
||||||
/// fabs(__z) [8.1.8].
|
|
||||||
// Effects: Behaves the same as C99 function cabs, defined
|
|
||||||
// in subclause 7.3.8.1.
|
|
||||||
fabs(const std::complex<_Tp>& __z)
|
|
||||||
{ return std::abs(__z); }
|
|
||||||
|
|
||||||
/// Additional overloads [8.1.9].
|
|
||||||
#if (defined(_GLIBCXX_INCLUDE_AS_CXX0X) \
|
|
||||||
|| (defined(_GLIBCXX_INCLUDE_AS_TR1) \
|
|
||||||
&& !defined(__GXX_EXPERIMENTAL_CXX0X__)))
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
inline typename __gnu_cxx::__promote<_Tp>::__type
|
|
||||||
arg(_Tp __x)
|
|
||||||
{
|
|
||||||
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
|
|
||||||
#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
|
|
||||||
return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L)
|
|
||||||
: __type();
|
|
||||||
#else
|
|
||||||
return std::arg(std::complex<__type>(__x));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
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>
|
|
||||||
inline typename __gnu_cxx::__promote<_Tp>::__type
|
|
||||||
real(_Tp __x)
|
|
||||||
{ return __x; }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
// @} group complex_numbers
|
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
}
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
// TR1 cstdint -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
// TR1 cstdio -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
}
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
// TR1 cstdlib -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
// TR1 cwchar -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
// TR1 cwctype -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2009 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @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
|
|
@ -1,506 +0,0 @@
|
||||||
// TR1 type_traits -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @file tr1_impl/type_traits
|
|
||||||
* 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
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup metaprogramming Type Traits
|
|
||||||
* @ingroup utilities
|
|
||||||
*
|
|
||||||
* Compile time type transformation and information.
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
// For use in __is_convertible_simple.
|
|
||||||
struct __sfinae_types
|
|
||||||
{
|
|
||||||
typedef char __one;
|
|
||||||
typedef struct { char __arr[2]; } __two;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define _DEFINE_SPEC_0_HELPER \
|
|
||||||
template<>
|
|
||||||
|
|
||||||
#define _DEFINE_SPEC_1_HELPER \
|
|
||||||
template<typename _Tp>
|
|
||||||
|
|
||||||
#define _DEFINE_SPEC_2_HELPER \
|
|
||||||
template<typename _Tp, typename _Cp>
|
|
||||||
|
|
||||||
#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
|
|
||||||
_DEFINE_SPEC_##_Order##_HELPER \
|
|
||||||
struct _Trait<_Type> \
|
|
||||||
: public integral_constant<bool, _Value> { };
|
|
||||||
|
|
||||||
// helper classes [4.3].
|
|
||||||
|
|
||||||
/// integral_constant
|
|
||||||
template<typename _Tp, _Tp __v>
|
|
||||||
struct integral_constant
|
|
||||||
{
|
|
||||||
static _GLIBCXX_USE_CONSTEXPR _Tp value = __v;
|
|
||||||
typedef _Tp value_type;
|
|
||||||
typedef integral_constant<_Tp, __v> type;
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
constexpr operator value_type() { return value; }
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
/// typedef for true_type
|
|
||||||
typedef integral_constant<bool, true> true_type;
|
|
||||||
|
|
||||||
/// typedef for false_type
|
|
||||||
typedef integral_constant<bool, false> false_type;
|
|
||||||
|
|
||||||
template<typename _Tp, _Tp __v>
|
|
||||||
_GLIBCXX_USE_CONSTEXPR _Tp integral_constant<_Tp, __v>::value;
|
|
||||||
|
|
||||||
/// remove_cv
|
|
||||||
template<typename>
|
|
||||||
struct remove_cv;
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct __is_void_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(0, __is_void_helper, void, true)
|
|
||||||
|
|
||||||
// primary type categories [4.5.1].
|
|
||||||
|
|
||||||
/// is_void
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_void
|
|
||||||
: public integral_constant<bool, (__is_void_helper<typename
|
|
||||||
remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct __is_integral_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, bool, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, char, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, signed char, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
|
|
||||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
|
|
||||||
#endif
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
|
|
||||||
#endif
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, short, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, int, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, long, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, long long, true)
|
|
||||||
_DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
|
|
||||||
|
|
||||||
/// is_integral
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_integral
|
|
||||||
: public integral_constant<bool, (__is_integral_helper<typename
|
|
||||||
remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct __is_floating_point_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(0, __is_floating_point_helper, float, true)
|
|
||||||
_DEFINE_SPEC(0, __is_floating_point_helper, double, true)
|
|
||||||
_DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
|
|
||||||
|
|
||||||
/// is_floating_point
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_floating_point
|
|
||||||
: public integral_constant<bool, (__is_floating_point_helper<typename
|
|
||||||
remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_array
|
|
||||||
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_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
|
|
||||||
|
|
||||||
/// is_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_pointer
|
|
||||||
: public integral_constant<bool, (__is_pointer_helper<typename
|
|
||||||
remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_reference
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_reference;
|
|
||||||
|
|
||||||
/// is_function
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_function;
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct __is_member_object_pointer_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
|
|
||||||
!is_function<_Tp>::value)
|
|
||||||
|
|
||||||
/// is_member_object_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_member_object_pointer
|
|
||||||
: public integral_constant<bool, (__is_member_object_pointer_helper<
|
|
||||||
typename remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct __is_member_function_pointer_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
|
|
||||||
is_function<_Tp>::value)
|
|
||||||
|
|
||||||
/// is_member_function_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_member_function_pointer
|
|
||||||
: public integral_constant<bool, (__is_member_function_pointer_helper<
|
|
||||||
typename remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_enum
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_enum
|
|
||||||
: public integral_constant<bool, __is_enum(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_union
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_union
|
|
||||||
: public integral_constant<bool, __is_union(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_class
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_class
|
|
||||||
: public integral_constant<bool, __is_class(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_function
|
|
||||||
template<typename>
|
|
||||||
struct is_function
|
|
||||||
: public false_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes...)>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes......)>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes...) const>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes......) const>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes...) volatile>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes......) volatile>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes...) const volatile>
|
|
||||||
: public true_type { };
|
|
||||||
template<typename _Res, typename... _ArgTypes>
|
|
||||||
struct is_function<_Res(_ArgTypes......) const volatile>
|
|
||||||
: public true_type { };
|
|
||||||
|
|
||||||
// composite type traits [4.5.2].
|
|
||||||
|
|
||||||
/// is_arithmetic
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_arithmetic
|
|
||||||
: public integral_constant<bool, (is_integral<_Tp>::value
|
|
||||||
|| is_floating_point<_Tp>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_fundamental
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_fundamental
|
|
||||||
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|
|
||||||
|| is_void<_Tp>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_object
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_object
|
|
||||||
: public integral_constant<bool, !(is_function<_Tp>::value
|
|
||||||
|| is_reference<_Tp>::value
|
|
||||||
|| is_void<_Tp>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_member_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_member_pointer;
|
|
||||||
|
|
||||||
/// is_scalar
|
|
||||||
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)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_compound
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_compound
|
|
||||||
: public integral_constant<bool, !is_fundamental<_Tp>::value> { };
|
|
||||||
|
|
||||||
/// is_member_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct __is_member_pointer_helper
|
|
||||||
: public false_type { };
|
|
||||||
_DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true)
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_member_pointer
|
|
||||||
: public integral_constant<bool, (__is_member_pointer_helper<
|
|
||||||
typename remove_cv<_Tp>::type>::value)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
// type properties [4.5.3].
|
|
||||||
/// is_const
|
|
||||||
template<typename>
|
|
||||||
struct is_const
|
|
||||||
: public false_type { };
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_const<_Tp const>
|
|
||||||
: public true_type { };
|
|
||||||
|
|
||||||
/// is_volatile
|
|
||||||
template<typename>
|
|
||||||
struct is_volatile
|
|
||||||
: public false_type { };
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_volatile<_Tp volatile>
|
|
||||||
: public true_type { };
|
|
||||||
|
|
||||||
/// is_empty
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_empty
|
|
||||||
: public integral_constant<bool, __is_empty(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_polymorphic
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_polymorphic
|
|
||||||
: public integral_constant<bool, __is_polymorphic(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// is_abstract
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_abstract
|
|
||||||
: public integral_constant<bool, __is_abstract(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// has_virtual_destructor
|
|
||||||
template<typename _Tp>
|
|
||||||
struct has_virtual_destructor
|
|
||||||
: public integral_constant<bool, __has_virtual_destructor(_Tp)>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/// alignment_of
|
|
||||||
template<typename _Tp>
|
|
||||||
struct alignment_of
|
|
||||||
: public integral_constant<std::size_t, __alignof__(_Tp)> { };
|
|
||||||
|
|
||||||
/// rank
|
|
||||||
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> { };
|
|
||||||
|
|
||||||
/// extent
|
|
||||||
template<typename, unsigned _Uint = 0>
|
|
||||||
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>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
template<typename _Tp, unsigned _Uint>
|
|
||||||
struct extent<_Tp[], _Uint>
|
|
||||||
: public integral_constant<std::size_t,
|
|
||||||
_Uint == 0 ? 0 : extent<_Tp,
|
|
||||||
_Uint - 1>::value>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
// relationships between types [4.6].
|
|
||||||
|
|
||||||
/// is_same
|
|
||||||
template<typename, typename>
|
|
||||||
struct is_same
|
|
||||||
: public false_type { };
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct is_same<_Tp, _Tp>
|
|
||||||
: public true_type { };
|
|
||||||
|
|
||||||
// const-volatile modifications [4.7.1].
|
|
||||||
|
|
||||||
/// remove_const
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_const
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_const<_Tp const>
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
/// remove_volatile
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_volatile
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_volatile<_Tp volatile>
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
/// remove_cv
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_cv
|
|
||||||
{
|
|
||||||
typedef typename
|
|
||||||
remove_const<typename remove_volatile<_Tp>::type>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// add_const
|
|
||||||
template<typename _Tp>
|
|
||||||
struct add_const
|
|
||||||
{ typedef _Tp const type; };
|
|
||||||
|
|
||||||
/// add_volatile
|
|
||||||
template<typename _Tp>
|
|
||||||
struct add_volatile
|
|
||||||
{ typedef _Tp volatile type; };
|
|
||||||
|
|
||||||
/// add_cv
|
|
||||||
template<typename _Tp>
|
|
||||||
struct add_cv
|
|
||||||
{
|
|
||||||
typedef typename
|
|
||||||
add_const<typename add_volatile<_Tp>::type>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
// array modifications [4.7.3].
|
|
||||||
|
|
||||||
/// remove_extent
|
|
||||||
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; };
|
|
||||||
|
|
||||||
/// remove_all_extents
|
|
||||||
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; };
|
|
||||||
|
|
||||||
// pointer modifications [4.7.4].
|
|
||||||
|
|
||||||
template<typename _Tp, typename>
|
|
||||||
struct __remove_pointer_helper
|
|
||||||
{ typedef _Tp type; };
|
|
||||||
|
|
||||||
template<typename _Tp, typename _Up>
|
|
||||||
struct __remove_pointer_helper<_Tp, _Up*>
|
|
||||||
{ typedef _Up type; };
|
|
||||||
|
|
||||||
/// remove_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct remove_pointer
|
|
||||||
: public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
|
|
||||||
{ };
|
|
||||||
|
|
||||||
template<typename>
|
|
||||||
struct remove_reference;
|
|
||||||
|
|
||||||
/// add_pointer
|
|
||||||
template<typename _Tp>
|
|
||||||
struct add_pointer
|
|
||||||
{ typedef typename remove_reference<_Tp>::type* type; };
|
|
||||||
|
|
||||||
#undef _DEFINE_SPEC_0_HELPER
|
|
||||||
#undef _DEFINE_SPEC_1_HELPER
|
|
||||||
#undef _DEFINE_SPEC_2_HELPER
|
|
||||||
#undef _DEFINE_SPEC
|
|
||||||
|
|
||||||
// @} group metaprogramming
|
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_TR1
|
|
||||||
}
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
||||||
// TR1 utility -*- C++ -*-
|
|
||||||
|
|
||||||
// Copyright (C) 2007, 2008, 2009, 2010 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 3, 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.
|
|
||||||
|
|
||||||
// Under Section 7 of GPL version 3, you are granted additional
|
|
||||||
// permissions described in the GCC Runtime Library Exception, version
|
|
||||||
// 3.1, as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License and
|
|
||||||
// a copy of the GCC Runtime Library Exception along with this program;
|
|
||||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
||||||
// <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
/** @file tr1_impl/utility
|
|
||||||
* 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
|
|
||||||
|
|
||||||
template<class _Tp>
|
|
||||||
class tuple_size;
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, class _Tp>
|
|
||||||
#else
|
|
||||||
template<int _Int, class _Tp>
|
|
||||||
#endif
|
|
||||||
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> >
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
{ static const std::size_t value = 2; };
|
|
||||||
#else
|
|
||||||
{ static const int value = 2; };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class _Tp1, class _Tp2>
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
const std::size_t
|
|
||||||
#else
|
|
||||||
const int
|
|
||||||
#endif
|
|
||||||
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; };
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int>
|
|
||||||
#else
|
|
||||||
template<int _Int>
|
|
||||||
#endif
|
|
||||||
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; }
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, class _Tp1, class _Tp2>
|
|
||||||
#else
|
|
||||||
template<int _Int, class _Tp1, class _Tp2>
|
|
||||||
#endif
|
|
||||||
inline typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
|
|
||||||
get(std::pair<_Tp1, _Tp2>& __in)
|
|
||||||
{ return __pair_get<_Int>::__get(__in); }
|
|
||||||
|
|
||||||
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
|
|
||||||
template<std::size_t _Int, class _Tp1, class _Tp2>
|
|
||||||
#else
|
|
||||||
template<int _Int, class _Tp1, class _Tp2>
|
|
||||||
#endif
|
|
||||||
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_TR1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -49,8 +49,8 @@ namespace
|
||||||
};
|
};
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace __atomic0
|
namespace __atomic0
|
||||||
{
|
{
|
||||||
bool
|
bool
|
||||||
|
|
@ -115,7 +115,8 @@ namespace std
|
||||||
_GLIBCXX_END_EXTERN_C
|
_GLIBCXX_END_EXTERN_C
|
||||||
|
|
||||||
} // namespace __atomic0
|
} // namespace __atomic0
|
||||||
} // namespace std
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
// XXX GLIBCXX_ABI Deprecated
|
// XXX GLIBCXX_ABI Deprecated
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace chrono
|
namespace chrono
|
||||||
{
|
{
|
||||||
const bool system_clock::is_monotonic;
|
const bool system_clock::is_monotonic;
|
||||||
|
|
@ -74,6 +74,7 @@ namespace std
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
|
|
||||||
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
condition_variable::condition_variable() throw ()
|
condition_variable::condition_variable() throw ()
|
||||||
{
|
{
|
||||||
#ifdef __GTHREAD_COND_INIT
|
#ifdef __GTHREAD_COND_INIT
|
||||||
|
|
@ -84,6 +84,7 @@ namespace std
|
||||||
|
|
||||||
condition_variable_any::~condition_variable_any() throw ()
|
condition_variable_any::~condition_variable_any() throw ()
|
||||||
{ }
|
{ }
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
const error_category& future_category()
|
const error_category& future_category()
|
||||||
{ return __future_category_instance(); }
|
{ return __future_category_instance(); }
|
||||||
|
|
||||||
|
|
@ -73,4 +73,5 @@ namespace std
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
future_error::what() const throw() { return _M_code.message().c_str(); }
|
future_error::what() const throw() { return _M_code.message().c_str(); }
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ namespace
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
#ifdef _GLIBCXX_HAVE_TLS
|
#ifdef _GLIBCXX_HAVE_TLS
|
||||||
__thread void* __once_callable;
|
__thread void* __once_callable;
|
||||||
__thread void (*__once_call)();
|
__thread void (*__once_call)();
|
||||||
|
|
@ -88,7 +88,8 @@ namespace std
|
||||||
__once_call();
|
__once_call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
// XXX GLIBCXX_ABI Deprecated
|
// XXX GLIBCXX_ABI Deprecated
|
||||||
// gcc-4.6.0
|
// gcc-4.6.0
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
|
||||||
|
|
||||||
namespace std
|
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
extern "C" void*
|
extern "C" void*
|
||||||
|
|
@ -95,6 +95,7 @@ namespace std
|
||||||
__throw_system_error(__e);
|
__throw_system_error(__e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// with this library; see the file COPYING3. If not see
|
// with this library; see the file COPYING3. If not see
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// { dg-error "static assertion failed" "" { target *-*-* } 688 }
|
// { dg-error "static assertion failed" "" { target *-*-* } 1119 }
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,5 @@ void test01()
|
||||||
test_type d;
|
test_type d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// { dg-error "rep cannot be a duration" "" { target *-*-* } 210 }
|
// { dg-error "rep cannot be a duration" "" { target *-*-* } 206 }
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 31 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 31 }
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// { dg-require-cstdint "" }
|
// { dg-require-cstdint "" }
|
||||||
// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
|
// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
|
||||||
|
|
||||||
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -32,6 +32,6 @@ void test01()
|
||||||
test_type d;
|
test_type d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// { dg-error "must be a specialization of ratio" "" { target *-*-* } 211 }
|
// { dg-error "must be a specialization of ratio" "" { target *-*-* } 207 }
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 32 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 32 }
|
||||||
// { dg-excess-errors "In instantiation of" }
|
// { dg-excess-errors "In instantiation of" }
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// { dg-require-cstdint "" }
|
// { dg-require-cstdint "" }
|
||||||
// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
|
// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
|
||||||
|
|
||||||
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
|
// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -33,5 +33,5 @@ void test01()
|
||||||
test_type d;
|
test_type d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// { dg-error "period must be positive" "" { target *-*-* } 213 }
|
// { dg-error "period must be positive" "" { target *-*-* } 209 }
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 33 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 33 }
|
||||||
|
|
|
||||||
|
|
@ -48,5 +48,5 @@ void test01()
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
|
||||||
|
|
||||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 651 }
|
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1082 }
|
||||||
// { dg-error "declaration of" "" { target *-*-* } 615 }
|
// { dg-error "declaration of" "" { target *-*-* } 1046 }
|
||||||
|
|
|
||||||
|
|
@ -48,5 +48,5 @@ void test01()
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 40 }
|
||||||
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
|
// { dg-error "instantiated from here" "" { target *-*-* } 42 }
|
||||||
|
|
||||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 574 }
|
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1005 }
|
||||||
// { dg-error "declaration of" "" { target *-*-* } 538 }
|
// { dg-error "declaration of" "" { target *-*-* } 969 }
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ void test01()
|
||||||
{
|
{
|
||||||
X* px = 0;
|
X* px = 0;
|
||||||
std::shared_ptr<X> p1(px); // { dg-error "here" }
|
std::shared_ptr<X> p1(px); // { dg-error "here" }
|
||||||
// { dg-error "incomplete" "" { target *-*-* } 566 }
|
// { dg-error "incomplete" "" { target *-*-* } 762 }
|
||||||
|
|
||||||
std::shared_ptr<X> p9(ap()); // { dg-error "here" }
|
std::shared_ptr<X> p9(ap()); // { dg-error "here" }
|
||||||
// { dg-error "incomplete" "" { target *-*-* } 658 }
|
// { dg-error "incomplete" "" { target *-*-* } 854 }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ main()
|
||||||
}
|
}
|
||||||
|
|
||||||
// { dg-warning "note" "" { target *-*-* } 347 }
|
// { dg-warning "note" "" { target *-*-* } 347 }
|
||||||
|
// { dg-warning "note" "" { target *-*-* } 1079 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 465 }
|
// { dg-warning "note" "" { target *-*-* } 465 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 883 }
|
|
||||||
// { dg-warning "note" "" { target *-*-* } 580 }
|
// { dg-warning "note" "" { target *-*-* } 580 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 1027 }
|
// { dg-warning "note" "" { target *-*-* } 1027 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 340 }
|
// { dg-warning "note" "" { target *-*-* } 340 }
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ void test01()
|
||||||
{
|
{
|
||||||
X* px = 0;
|
X* px = 0;
|
||||||
std::tr1::shared_ptr<X> p1(px); // { dg-error "here" }
|
std::tr1::shared_ptr<X> p1(px); // { dg-error "here" }
|
||||||
// { dg-error "incomplete" "" { target *-*-* } 370 }
|
// { dg-error "incomplete" "" { target *-*-* } 561 }
|
||||||
|
|
||||||
std::tr1::shared_ptr<X> p9(ap()); // { dg-error "here" }
|
std::tr1::shared_ptr<X> p9(ap()); // { dg-error "here" }
|
||||||
// { dg-error "incomplete" "" { target *-*-* } 409 }
|
// { dg-error "incomplete" "" { target *-*-* } 600 }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue