
23 Mar
2011
23 Mar
'11
6:47 p.m.
Hi, I want to apply an (un-)escaping transformation on a string (e.g., map "<" to "<", map ">" to "<", ...). I was wondering whether boost string algorithms can provide a good way of doing this or not. I was corsidering find_format, but the problem there is that the finder has to check for occurrence of "<" (by matching a string), but then the formatter needs to check again which of the strings the finder matched ("<", ">") to emit the correct character, which sounds suboptimal. A workaround would be to make the finder always succeed, and let the formatter do the actual check and emit the string if it matches. Is there a better alternative? I also noticed there's a "transform_range_copy", but this isn't documented. thanks! Remko