[cfe-commits] [libcxx] r119699 - in /libcxx/trunk: include/memory test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
Howard Hinnant
hhinnant at apple.com
Thu Nov 18 08:13:03 PST 2010
Author: hhinnant
Date: Thu Nov 18 10:13:03 2010
New Revision: 119699
URL: http://llvm.org/viewvc/llvm-project?rev=119699&view=rev
Log:
LWG 1339
Modified:
libcxx/trunk/include/memory
libcxx/trunk/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=119699&r1=119698&r2=119699&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Thu Nov 18 10:13:03 2010
@@ -155,7 +155,8 @@
void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x);
template <class ForwardIterator, class Size, class T>
-void uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
+ForwardIterator
+uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
template <class Y> struct auto_ptr_ref {};
@@ -2512,7 +2513,7 @@
}
template <class _ForwardIterator, class _Size, class _Tp>
-void
+_ForwardIterator
uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
{
__destruct_n __d(0);
@@ -2521,6 +2522,7 @@
for (; __n > 0; ++__f, --__n, __d.__incr((value_type*)0))
::new(&*__f) value_type(__x);
__h.release();
+ return __f;
}
class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
Modified: libcxx/trunk/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp?rev=119699&r1=119698&r2=119699&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp (original)
+++ libcxx/trunk/test/utilities/memory/specialized.algorithms/uninitialized.fill.n/uninitialized_fill_n.pass.cpp Thu Nov 18 10:13:03 2010
@@ -10,7 +10,7 @@
// <memory>
// template <class ForwardIterator, class Size, class T>
-// void
+// ForwardIterator
// uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
#include <memory>
@@ -43,7 +43,8 @@
assert(bp[i].data_ == 0);
}
B::count_ = 0;
- std::uninitialized_fill_n(bp, 2, B());
+ B* r = std::uninitialized_fill_n(bp, 2, B());
+ assert(r == bp + 2);
for (int i = 0; i < 2; ++i)
assert(bp[i].data_ == 1);
}
More information about the cfe-commits
mailing list