Created on 2009-03-11.00:00:00 last changed 172 months ago
Proposed resolution:
[memory] p2
Update the synopsis for <memory>
template <classInputIterator InIter,class ForwardIteratorOutputIterator<auto, InIter::reference> OutIter> requires ForwardIterator<OutIter>ForwardIteratorOutIter uninitialized_copy(InputIteratorInIter first,InputIteratorInIter last,ForwardIteratorOutIter result); template <classInputIterator InIter,classIntegralLike Size,class ForwardIteratorOutputIterator<auto, InIter::reference> OutIter> requires ForwardIterator<OutIter>ForwardIteratorOutIter uninitialized_copy_n(InputIteratorInIter first, Size n,ForwardIteratorOutIter result); template <classForwardIterator Iter,classObjectType T> requires Constructible< Iter::value_type, const T& > void uninitialized_fill(ForwardIteratorIter first,ForwardIteratorIter last, const T& x); template <classForwardIterator Iter,classIntegralLike Size,classObjectType T> requires Constructible< Iter::value_type, const T& > void uninitialized_fill_n(ForwardIteratorIter first, Size n, const T& x);
Update as follows:
uninitialized_copy [uninitialized.copy]
template <classInputIterator InIter,class ForwardIteratorOutputIterator<auto, InIter::reference> OutIter> requires ForwardIterator<OutIter>ForwardIteratorOutIter uninitialized_copy(InputIteratorInIter first,InputIteratorInIter last,ForwardIteratorOutIter result);-1- Effects:
for (; first != last; ++result, ++first) { new (static_cast<void*>(&*result))typename iterator_traits<ForwardIterator>OutIter::value_type(*first); }-2- Returns: result
template <classInputIterator InIter,classIntegralLike Size,class ForwardIteratorOutputIterator<auto, InIter::reference> OutIter> requires ForwardIterator<OutIter>ForwardIteratorOutIter uninitialized_copy_n(InputIteratorInIter first, Size n,ForwardIteratorOutIter result);-3- Effects:
for ( ; n > Size(0); ++result, ++first, --n) { new (static_cast<void*>(&*result))typename iterator_traits<ForwardIterator>OutIter::value_type(*first); }-4- Returns: result
uninitialized_fill [uninitialized.fill]
template <classForwardIterator Iter,classObjectType T> requires Constructible< Iter::value_type, const T& > void uninitialized_fill(ForwardIteratorIter first,ForwardIteratorIter last, const T& x);-1- Effects:
for (; first != last; ++first) { new ( static_cast<void*>( &*first) )typename iterator_traits<ForwardIterator>Iter::value_type(x); }
uninitialized_fill_n [uninitialized.fill.n]
template <classForwardIterator Iter,classIntegralLike Size,classObjectType T> requires Constructible< Iter::value_type, const T& > void uninitialized_fill_n(ForwardIteratorIter first, Size n, const T& x);-1- Effects:
for (; n--> Size(0); ++first, --n) { new ( static_cast<void*>( &*first) )typename iterator_traits<ForwardIterator>Iter::value_type(x); }
[ Post Summit: ]
Daniel adds:
- I suggest Size should require IntegralLike and not UnsignedIntegralLike, because otherwise simple int-literals could not be provided as arguments and it would conflict with other algorithms that only require IntegralLike.
The current for-loop-test relies on evaluation in boolean context which is not provided by ArithmeticLike and it's refinements. I propose to change the corresponding for-loop-headers to:
- for uninitialized_copy_n: for ( ; n > Size(0); ++result, ++first, --n) {
- for uninitialized_fill_n: for (; n > Size(0); ++first, --n) {
Alisdair adds:
For the record I agree with Daniel's suggestion.
[ Post Summit Alisdair provided wording. ]
[ Summit: ]
We look forward to a paper on this topic. We recommend no action until a paper is available.
Addresses UK 210 [CD1]
Related to 582
Specialized algorithms for memory management need requirements to be easily usable in constrained templates.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg383 |
2010-10-21 18:28:33 | admin | set | messages: + msg382 |
2010-10-21 18:28:33 | admin | set | messages: + msg381 |
2010-10-21 18:28:33 | admin | set | messages: + msg380 |
2009-03-11 00:00:00 | admin | create |