OSDN Git Service

2007-12-01 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Dec 2007 16:29:22 +0000 (16:29 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Dec 2007 16:29:22 +0000 (16:29 +0000)
* include/bits/stl_tempbuf.h (__get_temporary_buffer): Fold
in get_temporary_buffer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130557 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_tempbuf.h

index 5ac2a97..e5dc1f9 100644 (file)
@@ -1,6 +1,11 @@
+2007-12-01  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/stl_tempbuf.h (__get_temporary_buffer): Fold
+       in get_temporary_buffer.
+
 2007-11-29  Andris Pavenis <andris.pavenis@iki.fi>
 
-       * src/Makefile.am: Use separate vpath lines for each path.
+       * src/Makefile.am: Use separate vpath lines for each path.
 
 2007-11-28  Johannes Singler  <singler@ira.uka.de>
 
index 21adc70..3a22fab 100644 (file)
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /**
-   *  @if maint
-   *  This is a helper function.  The unused second parameter exists to
-   *  permit the real get_temporary_buffer to use template parameter deduction.
-   *  @endif
+   *  @brief Allocates a temporary buffer.
+   *  @param  len  The number of objects of type Tp.
+   *  @return See full description.
+   *
+   *  Reinventing the wheel, but this time with prettier spokes!
+   *
+   *  This function tries to obtain storage for @c len adjacent Tp
+   *  objects.  The objects themselves are not constructed, of course.
+   *  A pair<> is returned containing "the buffer s address and
+   *  capacity (in the units of sizeof(Tp)), or a pair of 0 values if
+   *  no storage can be obtained."  Note that the capacity obtained
+   *  may be less than that requested if the memory is unavailable;
+   *  you should compare len with the .second return value.
+   *
+   * Provides the nothrow exception guarantee.
    */
   template<typename _Tp>
     pair<_Tp*, ptrdiff_t>
-    __get_temporary_buffer(ptrdiff_t __len, _Tp*)
+    get_temporary_buffer(ptrdiff_t __len)
     {
       const ptrdiff_t __max =
        __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
@@ -95,28 +106,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     }
 
   /**
-   *  @brief Allocates a temporary buffer.
-   *  @param  len  The number of objects of type Tp.
-   *  @return See full description.
-   *
-   *  Reinventing the wheel, but this time with prettier spokes!
-   *
-   *  This function tries to obtain storage for @c len adjacent Tp
-   *  objects.  The objects themselves are not constructed, of course.
-   *  A pair<> is returned containing "the buffer s address and
-   *  capacity (in the units of sizeof(Tp)), or a pair of 0 values if
-   *  no storage can be obtained."  Note that the capacity obtained
-   *  may be less than that requested if the memory is unavailable;
-   *  you should compare len with the .second return value.
-   *
-   * Provides the nothrow exception guarantee.
-   */
-  template<typename _Tp>
-    inline pair<_Tp*, ptrdiff_t>
-    get_temporary_buffer(ptrdiff_t __len)
-    { return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); }
-
-  /**
    *  @brief The companion to get_temporary_buffer().
    *  @param  p  A buffer previously allocated by get_temporary_buffer.
    *  @return   None.