boost::regex を使用して文字列内の区切り文字を検索し (C++)、存在する場合は別のものに置き換えます。
const boost::regex esc(delimiter);
const std::string rep = "\\\\" + delimiter;
dest += boost::regex_replace(str, esc, rep,
boost::match_default | boost::format_sed);
しかし、boost::regex を使用すると、パフォーマンスが大幅に低下します (約 50%)。
誰かが理由を知っていますか?これは既知の問題ですか?