diff options
Diffstat (limited to 'libstdc++-v3/include/bits/stl_tempbuf.h')
-rw-r--r-- | libstdc++-v3/include/bits/stl_tempbuf.h | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h index 21adc70c9b3..e9ba10c7e8a 100644 --- a/libstdc++-v3/include/bits/stl_tempbuf.h +++ b/libstdc++-v3/include/bits/stl_tempbuf.h @@ -1,6 +1,6 @@ // Temporary buffer implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -69,14 +69,25 @@ _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. @@ -130,11 +119,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** - * @if maint * This class is used in two places: stl_algo.h and ext/memory, * where it is wrapped as the temporary_buffer class. See * temporary_buffer docs for more notes. - * @endif */ template<typename _ForwardIterator, typename _Tp> class _Temporary_buffer |