Talk:cpp/string/basic string/replace

Some overloads of in  are incompatible with the standard. Specifically, uses  as a parameter type where the standard dictates. I've only tested this in version 4.9.0, but would be happy to find out exactly which versions are affected if needed.

I wanted to add a note to this page describing the incompatibility so that future developers don't waste time on it. However, I'm worried that this information is outside the scope of cppreference.com.

Is there an appropriate section of the website for me to add this information?

Cyphus (talk) 14:13, 15 May 2014 (PDT)


 * the Notes section just above Example is a good place to point out such things, ideally with a link to the bug report in GCC bugzilla. --Cubbi (talk) 14:37, 15 May 2014 (PDT)


 * Yup. For example, see the page for random_device::entropy. --Nate (talk) 20:33, 15 May 2014 (PDT)

YUP, this still seems to be an issue. Given that replace modifies the target, I'm not at all sure I understand why the standard wants const_iterator here instead of iterator. 172.88.122.95 21:18, 16 January 2022 (PST)


 * The iterators are just used to point at the right places in the string, they aren't - nor could they be - used for modification of the string, the `this` argument is used for that, which isn't const qualified in these member functions --Ybab321 (talk) 02:16, 17 January 2022 (PST)