Namespaces
Variants
Views
Actions

Talk:cpp/algorithm/copy n

From cppreference.com

[edit] The InputIterator bug

Should we use the naive equivalent code for std::copy_n (the one I just posted), which is used by most existing implementations and which fails when used with single-pass InputIterators such as std::istream_iterator, or should we use the not-so-readable but bug-free version from this libc++ patch? --Cubbi 20:27, 17 August 2011 (PDT)

Better use the bug-free version. The equivalent function is there to show what actually the function does, especially in corner cases which sometimes are not be clearly described in the text (yet).P12 01:07, 18 August 2011 (PDT)
Done. Hmm, I wonder if this was filed as a GCC bug yet. --Cubbi 07:37, 18 August 2011 (PDT)
Now fixed in GCC --Cubbi 09:42, 18 August 2011 (PDT)

[edit] Using "<=" within

Hi,

I just changed the "Complexity" paragraph to:

 Zero assignments if count < 0; count assignments otherwise.

I would have liked to write "count <= 0" in lieu of "count < 0" (because that leaves no doubt about the case count ==0) but I couldn't get "<=" to work inside . Is it me?

Sorry, I couldn't get the previous message to render correctly, either. Please, look at the wiki markup directly (both for the subject and the body).