Talk:cpp/string/basic string/replace
Some overloads of std::string::replace in libstdc++
are incompatible with the standard. Specifically, libstdc++
uses iterator as a parameter type where the standard dictates const_iterator. 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)