+ The C++ Standard Library Technical Report adds many new features to
+ the library. The latest version of this effort is described in
+
Technical Report 1.
libstdc++ strives to implement all of TR1.
- The libstdc++ implementation status of the TR1 draft is listed in
- this page.
+ An overview of the implementation status
+ is available.
Briefly, the features of TR1 and the current status are:
Unordered containers - Complete -
- The unordered_set, unordered_map, unordered_multiset, and unordered_multimap containers
- are hashed versions of the map, set, multimap, and multiset containers respectively.
- These classes are suitable replacements for the SGI STL hash_map and hash_set extensions.
+ The unordered_set, unordered_map, unordered_multiset, and
+ unordered_multimap containers are hashed versions of the map, set,
+ multimap, and multiset containers respectively. These classes are
+ suitable replacements for the SGI STL hash_map and hash_set
+ extensions.
Reference-counted smart pointers - Complete -
- The shared_ptr and weak_ptr allow several object to know about a pointer and whether it is valid.
- When the last reference to the pointer is destroyed the pointer is freed.
+ The shared_ptr and weak_ptr allow several object to know about a
+ pointer and whether it is valid. When the last reference to the
+ pointer is destroyed the pointer is freed.
Type traits - Complete -
- The type_traits class gives templates the ability to probe information about the input type
- and enable type-dependent logic to be performed without the need of template specializations.
+ The type_traits class gives templates the ability to probe
+ information about the input type and enable type-dependent logic
+ to be performed without the need of template specializations.
Fixed-size arrays - Complete -
- The array class implements small fixed-sized arrays with container semantics.
+ The array class implements small fixed-sized arrays with container
+ semantics.
Tuples - Complete -
- The tuple class implements small heterogeneous arrays. This is an enhanced pair.
- In fact, the standard pair is enhanced with a tuple interface.
+ The tuple class implements small heterogeneous arrays. This is an
+ enhanced pair. In fact, the standard pair is enhanced with a tuple
+ interface.
A regular expression engine
- This library provides for regular expression objects with traversal of
- text with return of subexpressions.
+ This library provides for regular expression objects with traversal
+ of text with return of subexpressions.
A random number engine
- This library contains randow number generators with several different choices
- of distribution.
+ This library contains randow number generators with several different
+ choices of distribution.
Special functions - Under construction -
- Twenty-three mathematical functions familiar to physicists and engineers are included:
- cylindrical and spherical Bessel and Neumann functions, hypergeometric functions,
- Laguerre polynomials, Legendre functions, elliptic integrals, exponential integrals
- and the Riemann zeta function all for your computing pleasure.
+ Twenty-three mathematical functions familiar to physicists and
+ engineers are included: cylindrical and spherical Bessel and Neumann
+ functions, hypergeometric functions, Laguerre polynomials, Legendre
+ functions, elliptic integrals, exponential integrals and the Riemann
+ zeta function all for your computing pleasure.
C99 compatibility - Under construction -
- There are many features designed to minimize the divergence of the C and the C++ languages.
+ There are many features designed to minimize the divergence of the C
+ and the C++ languages.
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index dc66cbbfc6f1..2766df628aeb 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -485,6 +485,7 @@ tr1_headers = \
${tr1_srcdir}/bind_iterate.h \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/cctype \
+ ${tr1_srcdir}/cfenv \
${tr1_srcdir}/common.h \
${tr1_srcdir}/complex \
${tr1_srcdir}/functional \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 426635129608..b76fec729daa 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -702,6 +702,7 @@ tr1_headers = \
${tr1_srcdir}/bind_iterate.h \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/cctype \
+ ${tr1_srcdir}/cfenv \
${tr1_srcdir}/common.h \
${tr1_srcdir}/complex \
${tr1_srcdir}/functional \
diff --git a/libstdc++-v3/include/tr1/cfenv b/libstdc++-v3/include/tr1/cfenv
new file mode 100644
index 000000000000..d4e925a8bc39
--- /dev/null
+++ b/libstdc++-v3/include/tr1/cfenv
@@ -0,0 +1,86 @@
+// TR1 cctype -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_CFENV
+#define _TR1_CFENV 1
+
+#include
+
+#if _GLIBCXX_HAVE_FENV_H
+#include
+#endif
+
+#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::tr1
+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
+}
+
+#endif
+
+#endif
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc
index 9665a60e0f22..57d81f1ffc9f 100644
--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc
@@ -1,3 +1,5 @@
+// { dg-do compile }
+
// 2006-01-25 Paolo Carlini
//
// Copyright (C) 2006 Free Software Foundation, Inc.
@@ -22,17 +24,12 @@
#include
-void test01(int r = 0)
+void test01()
{
#if _GLIBCXX_USE_C99_CTYPE_TR1
- r = std::tr1::isblank(0);
-#else
- r = 0;
+
+ int ch = 0, r;
+ r = std::tr1::isblank(ch);
+
#endif
}
-
-int main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc
new file mode 100644
index 000000000000..9f3769fd91c7
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc
@@ -0,0 +1,52 @@
+// { dg-do compile }
+
+// 2006-01-26 Paolo Carlini
+//
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 8.6 Header
+
+#include
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_FENV_TR1
+
+ int except = 0, mode = 0;
+ std::tr1::fexcept_t* pflag = 0;
+ std::tr1::fenv_t* penv = 0;
+
+ int r;
+
+ r = std::tr1::feclearexcept(except);
+ r = std::tr1::fegetexceptflag(pflag, except);
+ r = std::tr1::feraiseexcept(except);
+ r = std::tr1::fesetexceptflag(pflag, except);
+ r = std::tr1::fetestexcept(except);
+
+ r = std::tr1::fegetround();
+ r = std::tr1::fesetround(mode);
+
+ r = std::tr1::fegetenv(penv);
+ r = std::tr1::feholdexcept(penv);
+ r = std::tr1::fesetenv(penv);
+ r = std::tr1::feupdateenv(penv);
+
+#endif
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc
new file mode 100644
index 000000000000..66186cdea28e
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc
@@ -0,0 +1,36 @@
+// { dg-do compile }
+
+// 2006-01-26 Paolo Carlini
+//
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 8.6 Header
+
+#include
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_FENV_TR1
+
+ // Check for required typedefs
+ typedef std::tr1::fenv_t fenv_t_type;
+ typedef std::tr1::fexcept_t fexcept_t_type;
+
+#endif
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc
index 1fdd10848e35..c4749e9a3735 100644
--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc
@@ -1,3 +1,5 @@
+// { dg-do compile }
+
// 2006-01-10 Paolo Carlini
//
// Copyright (C) 2006 Free Software Foundation, Inc.
@@ -25,19 +27,18 @@
template
void test01_do()
{
- using namespace std::tr1;
typedef std::complex cmplx_type;
cmplx_type ans;
- ans = acos(cmplx_type(1.0, 1.0));
- ans = asin(cmplx_type(1.0, 1.0));
- ans = atan(cmplx_type(1.0, 1.0));
+ ans = std::tr1::acos(cmplx_type(1.0, 1.0));
+ ans = std::tr1::asin(cmplx_type(1.0, 1.0));
+ ans = std::tr1::atan(cmplx_type(1.0, 1.0));
- ans = acosh(cmplx_type(1.0, 1.0));
- ans = asinh(cmplx_type(1.0, 1.0));
- ans = atanh(cmplx_type(1.0, 1.0));
- ans = fabs(cmplx_type(1.0, 1.0));
+ ans = std::tr1::acosh(cmplx_type(1.0, 1.0));
+ ans = std::tr1::asinh(cmplx_type(1.0, 1.0));
+ ans = std::tr1::atanh(cmplx_type(1.0, 1.0));
+ ans = std::tr1::fabs(cmplx_type(1.0, 1.0));
}
void test01()
@@ -46,9 +47,3 @@ void test01()
test01_do();
test01_do();
}
-
-int main()
-{
- test01();
- return 0;
-}