[patch] LWG DR 1339: uninitialized_fill_n should return the end of its range
Jonathan Wakely
jwakely@redhat.com
Thu Sep 25 16:08:00 GMT 2014
On the subject of uninitialized_fill_n (and also fill_n) I'm wondering
if we should add the following:
template<typename FwdIter, typename T>
FwdIter
uninitialized_fill_n(FwdIter, FwdIter, const T&) = delete;
This would catch calls like uninitialized_fill_n(p, p+n, t) that are
almost certainly a mistake. The second argument should be n, not p+n,
but it compiles and then loops until decrementing the pointer reaches
0, or it segfaults, whichever happens first!
More information about the Libstdc++
mailing list