Commit 7fc27808 authored by Dominik Charousset's avatar Dominik Charousset

fixed uniform name for user-defined templates using std::string

parent bcad2b28
......@@ -224,11 +224,10 @@ string to_uniform_name_impl(Iterator begin, Iterator end,
template<size_t RawSize>
void replace_all(string& str, const char (&before)[RawSize], const char* after) {
// always skip the last element in `before`, because the last element
// is the null-terminator
// end(before) - 1 points to the null-terminator
auto i = search(begin(str), end(str), begin(before), end(before) - 1);
while (i != end(str)) {
str.replace(i, i + RawSize - 1, after);
str.replace(i, i + RawSize, after);
i = search(begin(str), end(str), begin(before), end(before) - 1);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment